Python - can not install some packages in latest version - python

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

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.

Cannot download Pillow in Django VSCode project (Windows)

I'm going through Django 2.2 course with Windows / VSCode / Anaconda setup. I've tried to use both Python 3.6 and 3.7 interpreters and tried to download Pillow with commands such as:
pip install Pillow
python -m pip install pillow
pip install Pillow==5.0.0
I've tried to execute this both in is Anaconda Shell Prompt and cmd. Simply put, I get error of missing Pillow package whatever I do. When I try to execute "conda install" it says the the requirement is already satisfied, but it still doesn't recognize the package.
See attached pictures about errors.
Error1
Error2
Pillow 5.0.0 doesn't support Python 3.7. So, you have to install Pillow 5.2 - 5.4 or later versions of Pillow for Python 3.7.
You can check it from pillow's documentation here: pillow documentation
Also, be careful of different versions of python installed on your computer. check it and be sure which version is using.

PIL: DLL load failed: specified procedure could not be found

I've been beginning to work with images in Python and I wanted to start using PIL (Pillow). To install it, I ran pip install Pillow. When installing, PIL was not previously installed. I also tried uninstalling it and reinstalling it, as well as using pip3 install Pillow.
When I run it in Python, my first line is:
File "C:\Program Files\Python36\lib\site-packages\PIL\Image.py", line 56, in <module>
from . import _imaging as core
ImportError: DLL load failed: The specified procedure could not be found.
I checked the directory, and the file _imaging.cp36-win_amd64.pyd is present under the PIL folder.
Why is this happening if the needed DLL is there? How can I fix it?
I had this problem as well with Python 3.6. I just avoided the problem by uninstalling pillow (4.1.0) and then installing an older version of pillow (4.0.0). It seems to run okay with the older version.
As in Sean's answer, I had to uninstall (I'm using Anaconda Python 3.6, BTW) with
conda uninstall pillow
I tried it with PIL, but there was no such package. Uninstalling pillow also meant uninstalling packages that depend on it, in my case "anaconda-navigator" and "scikit-image". After I reinstalled Pillow 4.0.0 with
conda install pillow=4.0.0
and tested it with
python -c "from PIL import Image"
which, if successful, you don't see an error message, I reinstalled the packages that were uninstalled along with Pillow 4.1.0.
conda install anaconda-navigator
conda install scikit-image
If you're using Anaconda, try
conda uninstall pillow and then pip install pillow
Came across this issue while working on Caffe2 on Windows 10 (Anaconda 4.5) and this worked for me. Here's the github post on this issue.
This problem is also fixed by upgrading Python to 3.6.1, per this GitHub discussion.
The difference is that Pillow 4.1.0 was built with Python 3.6.1 while Pillow 4.0.0 was built with Python 3.6.0.
Apparently PYTHON36.DLL from Python 3.6.0 is missing functions (PySlice_AdjustIndices and PySlice_Unpack) that are used when building with Python 3.6.1.
The solution is to upgrade to Python 3.6.1.
There's a problem in Python itself which means binary wheels build using Python 3.6.1 (like Pillow 4.1.0) won't install on Python 3.6.0.
This has affected a number of Python libraries.
However, there's the new Pillow 4.1.1 release works around this, so you can now update to Pillow 4.1.1 and use it with both Python 3.6.0 and 3.6.1.
More info:
https://github.com/python-pillow/Pillow/issues/2479
https://mail.python.org/pipermail/python-dev/2017-March/147707.html
https://bugs.python.org/issue29943
for new people 2022
i solved it
you can look at this
https://pillow.readthedocs.io/en/latest/installation.html
if PIL dont want to uninstall delete or cut it to another folder
This works for me using win10 and py 3.6.
Simply uninstall Pillow 4.1.0
pip3 uninstall Pillow
Then install Pillow 4.0.0
pip3 install Pillow==4.0.0
I had the same problem with anaconda 5.0.1, using it with caffe on windows 10. i just did
conda install PIL
it worked for me.
Seems like some issue is there with tensorflow 1.12.0 +Python 3.6.0 + win10
Working fine with conda tensorflow.
below steps worked for me for pip tensorflow.
uninstall tensorflow
replace your python version with 3.6.1
install latest version of tensorflow(1.13.0)
For installing Tensorflow follow below link:-
https://www.tensorflow.org/install/pip
If you are a Windows user and do not have Microsoft Visual C++ the error occurs. I got the same error and resolved this by installing the Microsoft Visual C++. Link for downloading can be found here.
https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0
First uninstall existing version
pip uninstall pillow
Then try installing
pip install pillow==4.0.0

Install OpenCV via pip on Python 3.5 64-bit

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.

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.

Categories