Django says Pillow is not installed even though it is - python

I keep getting the same error when I try to run manage.py runserver:
Cannot use ImageField because Pillow is not installed.
I have seen several threads made by people that have encountered the same problem but none of them have a straightforward fix to this issue. I have already installed Pillow (pip install Pillow and pip3 install Pillow). I have uninstalled it several times, and reinstalled it. But whenever I run my server it says that Pillow is not installed.
I am on Windows 10. Any help would be appreciated.
FIXED! I removed all paths and made two new ones in my environment variables. It works now.

Try this to install or if you have already try to upgrade
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow
try importing package like this..
>>> from PIL import Image
Refer to official docs

Related

Package Installation problem with pip (Python39)

I recently updated my Python version from 38 to 39 and changed my environment variables as well.
Now, when I'm trying to install packages using
pip install numpy
or
pip3 install numpy
I'm getting following error:
import pip._internal.utils.inject_securetransport # noqa
ValueError: source code string cannot contain null bytes
I even tried reinstalling Python as well as changing the installation directory.
Can anyone provide any solution?
(PS: I'm using a Windows system)
i have seen this issue happening for most pip commands.
The solution was reinstalling Python and pip, and make sure to uprade pip:
python -m pip install --upgrade pip
if this doesn't work, it may be a problem with the ide or terminal.
Can you confirm if you can't use other pip commands? like uninstall or upgrade for example

pip stopped working after update to 20.1.1

I always install packages with the command "python -m pip install " in cmd. Today I got the notification that I am using pip and pip 20.1.1 can be installed by typing "python -m pip install --upgrade pip". I did that and now pip fails to install or uninstall programmes. This is the error message I get when trying to install a new package.
ImportError: cannot import name 'webencodings' from 'pip._vendor' (C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_vendor\__init__.py)
I am a complete beginner and don't want to mess to much with the pip directory, is there an easy solution for my problem?
It looks like this has been happening with pip 20+ when your "system" pip install gets incorrectly upgraded -- it's honestly pretty messed up that the default upgrade command that pip itself tells you to use does this "wrong" upgrade.
See this issue for a detailed discussion, a bunch of related issues, and some workarounds. This more recent report has a bunch of people reporting the same for pip20.
Potentially the easiest solution is to uninstall it:
python -m pip uninstall pip
Which should bring you back to the "system" pip installation. And then just ignore the warning, or only work inside virtualenvs, where you shuold be able to safely use updated pip.
Another possible workaround is to install an older version manually using the get-pip script:
python get-pip.py pip==19.3.1
Note: If anyone has better advice please feel free to comment / correct me.

Pip returns the same error all the time (Hide_cursor)

I have a problem when I use Pip on my computer. Whatever I do, it returns:
ImportError: cannot import name 'HIDE_CURSOR' from 'pip._vendor.progress'
(/usr/lib/python3.7/site-packages/pip/_vendor/progress/\__init\__.py)
Even with pip list, it returns the same error.
Currently, I am using Manjaro Linux.
There was an issue on GitHub about the problem:
https://github.com/pypa/pip/issues/6261
If anyone has the same problem, here is what I did:
rm -rf /usr/lib/python3.7/site-packages
python3.7 -m ensurepip
pip install --upgrade pip
Either your installation of pip got corrupted or there is a bug in pip. Try to reinstall the package.
If that doesn't help, try to download a newer/older version of pip using the instructions here: https://pip.pypa.io/en/stable/installing/
If that doesn't help, report a bug: https://github.com/pypa/pip/issues

python PIL installation on python 3.6

I have tried to install PIL, however unsuccessfully.
I used the commands:
pip install pillow
sudo pip3 install pillow
And yet python didn't recognize PIL.
Any solutions to this problem ?
You might be having PIL already installed which may be conflicting. Go to your python packages and manually delete pillow, Pillow, PIL etc and reinstall using pip install pillow
You say that it worked once and then later does not. A mistake that I have made more than once is naming a script that I am writing pil.py, and then wondering why I can't import PIL. So that could be an explanation.
If the installation is truly the problem though, here are some alternatives.
You could try python3.6 -m pip install Pillow - it does the same thing, but you never know.
You could try downloading the source code of Pillow - https://github.com/python-pillow/Pillow/releases - and running python3.6 setup.py install to install it directly. This will likely fail to lack of other requirements, but again, just giving ideas.
If you're on Linux, you could try your relevant package manger - apt install python3-pil for Ubuntu, etc.

ImportError: No module named hmmlearn.hmm python 2.7

I got this error in python script:
from hmmlearn.hmm import
GaussianHMM I know I need some libraries thats why I ran following
git clone git://github.com/hmmlearn/hmmlearn.git
pip install -U --user hmmlearn
I getting stuck because of this problem. I didn't get any solution, I tried google and many commands but problem still happen.
I solved this by cloning the repository and running:
sudo python setup.py install
It seems like according to the git-hub page of the repo it requires specific versions of some packages. Make sure you do a pip upgrade for all those packages
Python >=2.6
numpy >= 1.9.3
scipy >= 0.16.0
scikit-learn >= 0.16
then try it will work
to upgrade a package do simple
pip install --upgrade <package-name>

Categories

Resources