Python Forum
installing any package= impossible headache
Thread Rating:
  • 2 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
installing any package= impossible headache
#11
I will diverge a bit from Metulburr's summation, by saying, in my opinion, if you have a 64 bit processor, use the 64 bit Python. For the same reason we recommend the latest version of Python, I recommend the 64 bit Python, the reason being, 32 bit programs are also on their last legs. Plus why limit the superior capabilities of the 64 bit processor by running a 32 bit program? If you were to compare the arguments of why people were (and in some cases still are) reluctant to switch from Python 2 to Python 3, you would see they are almost identical to the reasons people still cling to 32 bit programs. Yet as both have matured and gained acceptance, most of those arguments are irrelevant.

Quote:I have like 100 small pygame programs I made in 2.7. Do I have to uninstall 2.7 and install 3.6, thus having to slightly fix all those programs whenever I run them again to make them run on 3.6? 

You have at least three options, as I see it.
  1. Toss them, escpecially if you are not using the latest version of Pygame.
  2. Use Python's builtin "2to3.py" to do most, if not all the the changes for you (located in the ~/Tools/Scripts directory
  3. Make the changes manually
I would venture to say, you're most likely to have to change because of "raw_input" vs. "input()" and "print" vs "print()".

To summarize, I recommend you uninstall Python 2.7 and Python 3.3 and just install Python 3.6.3 (according to the tutorial. As an added note, this is not the same advice I would give to Linux, Mac or *nix users.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#12
The only reason i have ever used a 32 bit python was because either
  1. The OS was 32 bit. This doesnt mean its old, just means that if you dont need so much memory, you can get away with 32 bit. There are Windows 10 32 bit OS. 
  2. I had issues with 64 bit. In this case it was building an exe with Python + Pygame + py2exe (but that was awhile ago and im no longer up to date on that)

Now saying that, i always stick to 64 bit by default unless i have an issue
Recommended Tutorials:
Reply
#13
Quote:What is the exact error you get? It would be better if we can see what your input/output of the command prompt is when you get such issues.
By the way you dont need sudo. sudo is for (admin) privledges on unix systems. If your on windows you can ignore that.

I copy/pasted the first example script here:
https://zulko.github.io/moviepy/examples...tters.html

The error was:
Traceback (most recent call last):
  File "C:\myPy\00shit.py", line 2, in <module>
    from moviepy.editor import *
  File "C:\myPy\moviepy\editor.py", line 22, in <module>
    from .video.io.VideoFileClip import VideoFileClip
  File "C:\myPy\moviepy\video\io\VideoFileClip.py", line 3, in <module>
    from moviepy.video.VideoClip import VideoClip
  File "C:\myPy\moviepy\video\VideoClip.py", line 21, in <module>
    from .io.ffmpeg_writer import ffmpeg_write_image, ffmpeg_write_video
  File "C:\myPy\moviepy\video\io\ffmpeg_writer.py", line 11, in <module>
    from moviepy.config import get_setting
  File "C:\myPy\moviepy\config.py", line 35, in <module>
    FFMPEG_BINARY = get_exe()
  File "C:\Python27\lib\site-packages\imageio\plugins\ffmpeg.py", line 86, in get_exe
    raise NeedDownloadError('Need ffmpeg exe. '
NeedDownloadError: Need ffmpeg exe. You can download it by calling:
  imageio.plugins.ffmpeg.download()
I opened command prompt and tried changing directory to:
C:\Python27\lib\site-packages\imageio
or
C:\Python27\lib\site-packages\imageio\plugins

typing "imageio.plugins.ffmpeg.download()" in either resulted in "imageio.plugins.ffmpeg.download is not recognized as an internal or external command, operable program or batch file.

And I remember similar problems making py2exe and beautiful soup, if I recall, overly difficult to install as well. So like, python 2.7 is just a pain in the neck in this way, by design, and supposedly 3.6 would make these problems go away? (and my guess is be unable to use probably a lot of older packages designed for python 2.x).

It sure isn't obvious how to make stuff work properly, so you can get to the actual coding part. Well, what if I instead downloaded something like moviepy, and instead of using pip and all of this stuff, I just paste the folder in my folder w/ my py programs. Then I look up what dependencies moviepy has and copy paste those in there as well. There might be a few bugs from using versions slightly different than authors intended, but those might be easier to fix than figuring out all this command prompt etc stuff. Not sure if that method would work or not though.
Reply
#14
It appears based on that traceback that you have, that on windows if ffmpeg is not found, they have a script to downlaod it for you. Im assuming you only have to do it once...unless you plan on moving your script around on different computers.
But try this on the same python interpreter that you installed moviepy to
>>> import imageio
>>> imageio.plugins.ffmpeg.download()
and then run your other script. I have never seen a pip install require something like that before. But i never used moviepy before either. But its weird they wouldnt add that into the pip install process? <- @[snippsat]

Quote:typing "imageio.plugins.ffmpeg.download()" in either resulted in "imageio.plugins.ffmpeg.download is not recognized as an internal or external command, operable program or batch file.
The above code is ran in the python interpreter, not the Operating Systems command prompt.

Quote:And I remember similar problems making py2exe and beautiful soup, if I recall, overly difficult to install as well.
Those should be much easier. There are no dependencies, whereas moviepy seems to require a lot depending on what you are doing.
Recommended Tutorials:
Reply
#15
The Github issue.
Quote:@Zulko
This is the new imageio behavior where imageio gets downloaded only if you run a specific command
So running what metulburr have posted should fix it.
Reply
#16
That worked! It never ends though so immediately there was another error:
Traceback (most recent call last):
  File "C:\myPy\00shit.py", line 6, in <module>
    from moviepy.video.tools.segmenting import findObjects
  File "C:\myPy\moviepy\video\tools\segmenting.py", line 2, in <module>
    import scipy.ndimage as ndi
ImportError: No module named scipy.ndimage
So I went to command prompt, went to c:\python27 and typed this:
python -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
as directed here:
https://www.scipy.org/install.html
and it worked, like it said it was downloading stuff etc and finished.
But then I try the same program that produced the traceback above (still the 1st example moviepy program) and... it gives the same exact "no module named scipy.ndimage" traceback, even though I supposedly installed it. I tried at top of py file:
import scipy
scipy.__file__
"no module named scipy"
If you don't have access to a forum full of other people that knows what's going on, a noob has no chance installing this stuff. There will probably be 5 more immediate errors even if this one is fixed. I thought pip was supposed to handle installing all these dependencies.
Reply
#17
GitHub link.
Quote:For advanced image processing, you will need one or several of the following packages:

The Python Imaging Library (PIL) or, even better, its branch Pillow.
Scipy (for tracking, segmenting, etc.) can be used to resize video clips if PIL and OpenCV are not installed.
Scikit Image may be needed for some advanced image manipulation.
OpenCV 2.4.6 or a more recent version (one that provides the package cv2) may be needed for some advanced image manipulation.
Matplotlib
For scipy download wheel for your Python version(32bit or 64bit) from Gohlke.
Place wheel file in Scripts folder.
Example:
C:\>cd python27\scripts

C:\Python27\Scripts>pip install scipy-1.0.0-cp27-cp27m-win32.whl
Processing c:\python27\scripts\scipy-1.0.0-cp27-cp27m-win32.whl
Requirement already satisfied: numpy>=1.8.2 in c:\python27\lib\site-packages (from scipy==1.0.0)
Installing collected packages: scipy
Successfully installed scipy-1.0.0

C:\Python27\Scripts>
Reply
#18
Quote:If you don't have access to a forum full of other people that knows what's going on, a noob has no chance installing this stuff. There will probably be 5 more immediate errors even if this one is fixed. I thought pip was supposed to handle installing all these dependencies.
Thats why we have a forum. And it is accessible to everyone (We are listed in python.org forum listing).

And most beginners dont install moviepy as their first 3rd party library. Apparently that one has so many dependencies and quirky download methods etc. For example it only downloads ffmpeg if you actually run code that requires it VS installing all dependencies at the get go. Most libs do not do this. You just got a rare bad initial experience. That is the first module i have seen someone have so much trouble installing
Recommended Tutorials:
Reply
#19
There are still some headache for new user with packages which has a lot of dependencies in a Windows environment.
It have gotten better with Python 3.6 and pip 9.0.1.

I have a tutorial here about Anaconda,
which can help new user with install and dependencies,
specially for data science stuff where people need a lot of packages.
As i mention in tutorial there is no problem to have both installed.

So to look at how conda handles movipy with conda install moviepy
G:\Anaconda3\Scripts
λ conda install moviepy
Fetching package metadata ...............
Solving package specifications: .

Package plan for installation in environment G:\Anaconda3:

The following NEW packages will be INSTALLED:

    backports.functools_lru_cache: 1.4-py36_1            conda-forge
    ca-certificates:               2017.7.27.1-0         conda-forge
    ffmpeg:                        3.2.4-1               conda-forge
    krb5:                          1.14.2-vc14_0         conda-forge [vc14]
    libssh2:                       1.8.0-vc14_2          conda-forge [vc14]
    moviepy:                       0.2.3.2-py36_0        conda-forge
    tqdm:                          4.11.2-py36_0         conda-forge

The following packages will be UPDATED:

    curl:                          7.52.1-vc14_0                     --> 7.55.1-vc14_0         conda-forge [vc14]
    h5py:                          2.7.0-np111py36_0                 --> 2.7.1-py36_1          conda-forge
    hdf5:                          1.8.15.1-vc14_4                   --> 1.8.18-vc14_2         conda-forge [vc14]
    icu:                           57.1-vc14_0                       --> 58.1-vc14_1           conda-forge [vc14]
    jpeg:                          9b-vc14_0                         --> 9b-vc14_1             conda-forge [vc14]
    pycurl:                        7.43.0-py36_2                     --> 7.43.0-py36h086bf4c_3
    pytables:                      3.2.2-np111py36_4                 --> 3.4.2-np111py36_4     conda-forge
    tk:                            8.5.18-vc14_0                     --> 8.6.6-vc14_5          conda-forge [vc14]

The following packages will be SUPERSEDED by a higher-priority channel:

    bzip2:                         1.0.6-vc14_3                      --> 1.0.6-vc14_1          conda-forge [vc14]
    conda:                         4.3.30-py36h7e176b0_0             --> 4.3.29-py36_0         conda-forge
    conda-env:                     2.6.0-h36134e3_1                  --> 2.6.0-0               conda-forge
    freetype:                      2.8-vc14h17c9bdf_0                --> 2.7-vc14_1            conda-forge [vc14]
    imageio:                       2.2.0-py36had6c2d2_0              --> 2.1.2-py36_0          conda-forge
    libpng:                        1.6.32-vc14h5163883_3             --> 1.6.28-vc14_2         conda-forge [vc14]
    libtiff:                       4.0.8-vc14h04e2a1e_10             --> 4.0.6-vc14_7          conda-forge [vc14]
    matplotlib:                    2.1.0-py36h11b4b9c_0              --> 2.1.0-py36_0          conda-forge
    openssl:                       1.0.2l-vc14_0                     --> 1.0.2l-vc14_0         conda-forge [vc14]
    pillow:                        4.2.1-py36hdb25ab2_0              --> 4.2.1-py36_0          conda-forge
    qt:                            5.6.2-vc14_4                      --> 5.6.2-vc14_1          conda-forge [vc14]
    zlib:                          1.2.11-vc14h1cdd9ab_1             --> 1.2.11-vc14_0         conda-forge [vc14]

Proceed ([y]/n)? y

ca-certificate 100% |###############################| Time: 0:00:00 281.62 kB/s
conda-env-2.6. 100% |###############################| Time: 0:00:00  25.15 kB/s
ffmpeg-3.2.4-1 100% |###############################| Time: 0:00:06   2.69 MB/s
bzip2-1.0.6-vc 100% |###############################| Time: 0:00:00   1.09 MB/s
jpeg-9b-vc14_1 100% |###############################| Time: 0:00:00 896.36 kB/s
krb5-1.14.2-vc 100% |###############################| Time: 0:00:00   2.08 MB/s
openssl-1.0.2l 100% |###############################| Time: 0:00:01   3.08 MB/s
zlib-1.2.11-vc 100% |###############################| Time: 0:00:00   2.97 MB/s
hdf5-1.8.18-vc 100% |###############################| Time: 0:00:04   2.98 MB/s
icu-58.1-vc14_ 100% |###############################| Time: 0:00:07   3.10 MB/s
libpng-1.6.28- 100% |###############################| Time: 0:00:00   2.24 MB/s
libssh2-1.8.0- 100% |###############################| Time: 0:00:00   3.05 MB/s
libtiff-4.0.6- 100% |###############################| Time: 0:00:00   2.98 MB/s
tk-8.6.6-vc14_ 100% |###############################| Time: 0:00:01   2.91 MB/s
curl-7.55.1-vc 100% |###############################| Time: 0:00:00   3.08 MB/s
freetype-2.7-v 100% |###############################| Time: 0:00:00   3.04 MB/s
qt-5.6.2-vc14_ 100% |###############################| Time: 0:00:18   3.15 MB/s
tqdm-4.11.2-py 100% |###############################| Time: 0:00:00   3.05 MB/s
backports.func 100% |###############################| Time: 0:00:00   2.72 MB/s
h5py-2.7.1-py3 100% |###############################| Time: 0:00:00   1.87 MB/s
pillow-4.2.1-p 100% |###############################| Time: 0:00:00   2.94 MB/s
pycurl-7.43.0- 100% |###############################| Time: 0:00:00   2.65 MB/s
imageio-2.1.2- 100% |###############################| Time: 0:00:01   2.66 MB/s
matplotlib-2.1 100% |###############################| Time: 0:00:02   3.01 MB/s
pytables-3.4.2 100% |###############################| Time: 0:00:01   2.63 MB/s
moviepy-0.2.3. 100% |###############################| Time: 0:00:00   3.05 MB/s
conda-4.3.29-p 100% |###############################| Time: 0:00:00   2.33 MB/s

G:\Anaconda3\Scripts
Se how all dependencies is found,and of course SciPy and NumPy is already a part of Anaconda.
Scipy and Numpy had been updated if there was a need for it.
Reply
#20
That anaconda looks much easier, especially since it starts w/ 100 packages so you have less to manually install. Maybe I can use that whenever I get another computer with linux, since doing all this over again would be a pain (take a guess if I was able to install linux last time I tried). Say packageA requires scipy version 1.0 and packageB requires scipy versioni 1.1. Having packageA & B installed together would already have conflicts, so it seems all this pip "easy" install stuff wouldn't have a way to make everything the "correct" version anyway. Plus my guess is maybe pip recognizes a package, maybe it doesn't. Maybe a package you create is accepted as part of anaconda's 100, maybe not. If not, your package becomes obscure and nobody uses it, sort of monopolizing packages that are pip or anaconda approved only. If pip didn't exist, maybe you would go to the moviepy site, and instead of the directions being "do this with pip/command prompt", it would simply be "download this zipped folder, unzip and paste into c:\python27" etc. Ta da, now you can import it. That seems at first glance much simpler to me so I don't really understand the need for pip/command prompt, it seems to just complicate stuff rather than simplify. But I don't know enough about it to really know what is the best way. Anyway I saw that wheel link 3 posts back has a dependency of its own (numpy+mkl) so for now maybe I have enough downloaded that I can code the relatively simple thing I wanted to code (a sort of music video that matches the tempo of an mp3).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  trouble installing python package Tuxedo 1 3,244 Apr-07-2021, 09:07 AM
Last Post: Larz60+
  Installing package in Anaconda on an Intranet Computer Secret 1 1,937 Sep-17-2020, 02:16 PM
Last Post: Larz60+
  Error when installing Seaborn package using pip chawkins 3 5,597 Jul-16-2018, 12:12 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020