-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No module named PIL #3851
Comments
Could you actually show us the output of I don't suppose that you have two versions of Python set up, and you are installing into one and then trying to import from the other? |
it is installing for the right version, edit: |
Since you have 'venv' in your path, I presume that the answer to this question involves the fact that you're using a virtual environment. https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/ might prove useful. Otherwise, a quick solution might be -
|
Here's the thing: Install location : 'C:\Users\cs-admin\AppData\Local\Programs\Python\Python36\lib\site-packages', |
change PIL with pil |
simple solution, but it was really pain.... Thanks |
sorry to comment on this old question but I already tried this and this was working but now when I do "import PIL" it says "no module named PIL" but when I do "import pil" it gave the same error "no module named PIL" in capital letters. |
it doesnt for me. Edit: incase this matters, i went to the file location of where pip said it installed pillow, but couldnt find anything to do with pillow. Edit 2: actually i found it, it was installed in C: instead of C:\Users<user>\AppData\Local\Programs\Python Edit 3: ok, now ive fixed it, but its saying "cannot import name '_imaging' from 'PIL' |
I found a solution that worked for me : |
thanks |
When I exited my virtual environment it seemed to work |
i hope this helps but i belive your python is 3 version which means for you to execute the script you made instead of typing "python script.py" , you should instead use "python3 script.py" and that because you must have 2 versions of python and the pillow path in the python 3 part while the execution was made on python2 i hope this help because that what worked for me |
For me it was a python version problem. Fixed it by using |
Yep, that's why the installation instructions recommend And it's recommended to do that generally: https://snarky.ca/why-you-should-use-python-m-pip/ |
Exactly, I tried everything on the internet, nothing seems to work |
Thankfully, it's now working. What I did was, I deleted pip from the location where it was saved, which in my case was: This time, I installed it in (I changed the location with the help of that website): Then I used Then import PIL in Python and it'll work! |
Could you please write down your approach step by step? I'd like to try this suggestion but I am not sure if I can follow the directions correctly now. |
Sure. When I installed pillow from command prompt, I just entered the command So I went there ( After I installed pip, using the same cd\ and cd (Given in the site), I changed the location to Try importing PIL again in Python, and it should work! Hope it helps ☺ |
the thing is , if you install 'P'illow the debugger will be expecting PIL and if you're installing 'p'illow it will be expecting pil , apparently each one of them is somehow separated |
now this is worst for linux users |
I'm going to lock this issue because brief comments like "now this is worst for linux users" don't really help anyone, let alone us help you. If you're having problems installing, please open a new issue with details, and we'll try and help out: https://github.com/python-pillow/Pillow/issues/new/choose Thank you! |
What did you do?
i did pip install pillow and wrote from PIL import Image
but when i run it it just say no module named PIL
What did you expect to happen?
it would run fine and give no errors
What actually happened?
I got the error "no module named PIL"
What are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered: