Install OpenCV via pip on Python 3.5 64-bit - python

I tried to install OpenCV, and I couldn't find any suitable pip packages for it. I decided to look online for official documentation on how to install it, and found this. Unfortunately, not only does this documentation only give support for versions using python 2.7, it also says to install OpenCV manually by downloading it from sourceforge rather than using a package manager like pip.
I want to know if there's a better or more official way of installing OpenCV in python 3.5, or failing that, a package in pip I should install instead.

What OS are you on? If it's Windows have a look at
http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv
To properly install the available wheels make sure you have pip version 8 installed.

Related

Can't install lxml for python 3.8.1 on windows

I am on Windows 10 64-bit, in a venv.
Pip install lxml return
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
So I tried to use the appropriate .whl availlable here (lxml-4.5.0-cp38-cp38-win_amd64.whl) which leads to another error:
lxml-4.5.0-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.
I tried to use pip.exe, pip3.exe, pip3.8.exe and the 64x and 32x bit versions of the .whl file without success
Am I missing something or is the Python 3.8 version of the package not compatible with Python 3.8.1?
This happens because you probably have an older version of python alongside 3.8 and when you install the package it references the older one. You can try deleting all python versions and installing Python 3.8 again
I used deactivate to get out of venv mode, then it worked.
Use "pip3 install lxml" and you will get it installed. Make sure you have updated pip3 version. You can install it by "easy_install -U pip3". Let me know in case of issues.

Python - can not install some packages in latest version

I have installed 3.6.1 version of python interpreter. I have a project that need to use "PIL" library so I try to install it but it gives me error, "Error occurred when installing package 'PIL'". I search it out why it's happening and I think it can only be installed on lower version of interpreter 2.7 or something lower. Now how can I install PIL in 3.6.1 version of interpreter? Should I downgrade my interpreter instead? But if I do, can it cause some other packages to be unable to install for it is only for 3.X version. Thanks in advance.
Install Pillow, the packaged and maintained fork of PIL, using:
pip install pillow
download pillow based on your version. from python unofficial library ..
search pillow choose your python version and distribution from it... once you download,
move onto download path or
pip install ~/Downloads/Pillow‑4.2.1‑cp36‑cp36m‑win_amd64.whl

Installing Pillow on Python

I am trying to instal Pillow-2.7.0-cp27-none-win32.whl on my Python 2.7.2:
So I open a comand prompt and type:
pip install Pillow-2.7.0-cp27-none-win32.whl
But I get the following message:
Pillow-2.7.0-cp27-none-win32.whl is not a supported wheel on this plataform.
Edited: I am on a windows 7 professional 64bit service pack one
So what now?
Go to Pillow page in pypi.python.org: https://pypi.python.org/pypi/Pillow/
Pick a distribution for your operating system. 64-bit Windows is suffixed win_amd64.whl if you need exact package, but generic
pip install Pillow should be enough
Please refer to Pillow installation guide.
I am almost certain you are trying to install 32-bit Pillow with a 64-bit Python. This is unrelated to windows being 64-bit.
Try this if you really need 2.7 instead of the latest pillow:
pip install "https://pypi.python.org/packages/cp27/P/Pillow/Pillow-2.7.0-cp27-none-win_amd64.whl#md5=f39617259e9e3d2ef5d885576fc0acda"
Unless you have a good reason though, do as others are saying and just follow the installation guide or do
pip install pillow
You need to install the 64-bit version of Pillow using the 64-bit wheel.

Errors when trying to install PIL with pip as well as pyscripter errors

I have installed pip and got a correctly functioning virtual environment (I think). I am trying to now install PIL. When I try and install it, this is the error:
C:\Users\CharlesP>python -m pip install python-imaging
Downloading/unpacking python-imaging
Could not find any downloads that satisfy the requirement python-imaging
Cleaning up...
No distributions at all found for python-imaging
Storing debug log for failure in C:\Users\CharlesP\pip\pip.log
I have no idea why this is happening. I have also installed pillow, and it says it was installed properly, but I get an error when trying to use the pillow module in PyScripter for the latest version it says that there is no such module.
This might help:
pip install PIL --allow-external PIL --allow-unverified PIL
However, you may consider using Pillow instead, this shouldn't create these kind of problems:
link
python-imaging is the name that some Linux distros give to the RPM/DEB/etc. package for PIL (the "Python Imaging Library"). There's no such package on PyPI.
PIL itself exists, but it often can't be cleanly installed. It's basically an abandoned project, and you almost certainly don't want it.
What you want is the modern fork Pillow. One of the many enhancements made over the years is working properly with pip. So:
pip install pillow
If for some reason you can't use Pillow (and I can't think of any good reason, except for needing to work with ancient versions of Python, which don't support pip…), you can download the source to PIL 1.1.7 and install it manually, or use one of the various "pipify"-ing wrappers (search PyPI for PIL and you'll find two or three of them) that may or may not work.

Why would a python framework installation guide advise the use of easy_install for some required packages and pip for others?

After a failed attempt at a "streamlined" install of the SimpleCV framework superpack for Windows. I'm now working through a manual installation guide (which I'm OK with as I have more control over the installation and might finally learn about installing Python Packages properly in Windows!)
Rather than just blindly follow the guide I'm trying to understand each step, so I'm confused by this..
easy_install pyreadline
easy_install PIL
easy_install cython
easy_install pip
pip install ipython
pip install https://github.com/ingenuitas/SimpleCV/zipball/1.3
Why not easy_install pip as soon as possible then pip the other packages?..
easy_install pip {{{I intend to research and probably use get-pip.py here}}}
pip install pyreadline
pip install PIL
pip install cython
pip install ipython
pip install https://github.com/ingenuitas/SimpleCV/zipball/1.3
Is there a pitfall doing it this way? (My limited understanding is that it's always preferable to use pip rather than easy_install.)
I know this question relates directly to SimpleCV but I want to learn the correct approach for when I'm installing package collections in the future without the benefit of a guide.
pip fetches the source code of the packages you're trying to install and compiles them. So if you don't have a compiler installed and configured it will fail to do so for packages which contain extensions written in C, which in this case applies to pyreadline, PIL and cython.
easy_install uses the precompiled packages from pypi (at least for windows if they're available), which means you don't need to compile everything yourself.
For pure python packages it's no problem using pip instead of easy_install, and if you have a compiler and the neccessary build dependencies installed it should also work.
I believe the answer is that pip does not currently support the installation of binary distributions, i.e. Python packages that include pre-compiled C extension modules. easy_install does.
BTW, there is work afoot to provide replacements for pip (and easy_install) that will fully support binary distributions on all platforms. See here for an overview.

Categories