Error could not find a version that satisfies the requirement pil from versions none
Error could not find a version that satisfies the requirement pil from versions none
python3—no module named PIL #3825
Comments
ljh0279 commented Nov 22, 2017
when i Loading and normalizing CIFAR10, said that ‘from PIL import Image
ModuleNotFoundError: No module named ‘PIL».
However, PIL only supports python2.7, how can i solve it?
The text was updated successfully, but these errors were encountered:
Gosicfly commented Nov 22, 2017
just try this:
pip3 install pillow
ljh0279 commented Nov 22, 2017
pillow is already installed. However, it does not work.
zou3519 commented Nov 22, 2017
I would recommend uninstalling Pillow, PIL (if they exist) and reinstalling pillow.
Something like:
ljh0279 commented Nov 22, 2017
ok. thank you! it works. I will post these questions to there in the future.
KingCyrus commented Nov 2, 2019
I would recommend uninstalling Pillow, PIL (if they exist) and reinstalling pillow.
Something like:
You saved my career! I have been on this for weeks. Thanks.
taulantisaku commented Nov 19, 2019
I would recommend uninstalling Pillow, PIL (if they exist) and reinstalling pillow.
Something like:
lukhuak commented Feb 23, 2020
Set path of NetBeans11.2 IDE to the interpreter anaconda in python 3.7.4
import cv2
import numpy as np
from PIL import Image
indolentdeveloper commented May 7, 2020
you might get below error in mac.
WARNING: The directory ‘/Users//Library/Caches/pip’ or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that director
uaahacker commented Nov 21, 2020
C:\Users\uaahacker>pip uninstall Pillow
Found existing installation: pillow 7.2.0
Uninstalling pillow-7.2.0:
Would remove:
c:\users\uaahacker\anaconda3\lib\site-packages\pil*
c:\users\uaahacker\anaconda3\lib\site-packages\pillow-7.2.0.dist-info*
Proceed (y/n)? y
Successfully uninstalled pillow-7.2.0
C:\Users\uaahacker>pip uninstall PIL
WARNING: Skipping PIL as it is not installed.
C:\Users\uaahacker>pip install Pillow
Collecting Pillow
Downloading Pillow-8.0.1-cp38-cp38-win_amd64.whl (2.1 MB)
|████████████████████████████████| 2.1 MB 261 kB/s
Installing collected packages: Pillow
Successfully installed Pillow-8.0.1
C:\Users\uaahacker>pip install PIL
ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)
ERROR: No matching distribution found for PIL
Ali-Kamel commented Jan 10, 2021
I would recommend uninstalling Pillow, PIL (if they exist) and reinstalling pillow.
Something like:
isl-raph commented Sep 6, 2021
I would recommend uninstalling Pillow, PIL (if they exist) and reinstalling pillow.
Something like:
Could not find a version that satisfies the requirement Pillow==2.7.0
I have a requirements.txt file with the line below
I download the requirements for offline mode like this and put it in vendor director
This downloads the file Pillow-2.7.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel to my vendor directory
But when I try to deploy (push) my app I get the error below:
I am deploying the app to Cloud Foundry using the Python Buildpack following this documentation http://docs.cloudfoundry.org/buildpacks/python/index.html#vendoring
2 Answers 2
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
UPDATE: Another post points out how you can specify to recent versions of pip a flag not to pull binaries (which I’m assuming is the issue). If that resolves the issues then you should pick his post as solution. I’d also poke cloudfoundry just needing to point this out.
It’s the same as the newer:
Now assuming your cloud provider is reading the requirements.txt and looking themselves in your vendor folder to install (a-not-so-wise-approach), you’d potentially have all kinds of issues with any binaries, symbolic links, etc. unless the environment you’re deploying to matches the local environment. Part of the idea with package systems like pip and a requirements file is so different platforms can pull down the needed libraries for their specific architecture, OS, etc.
This approach has so many things could go wrong.
For example, your mac probably is using a case insensitive file system. If the cloudfoundry is using linux, that’s case-sensitive. On mac, this wouldn’t matter if they saved it all lower case, but might be an issue when copying the files to a linux system expecting to match a capitlized «P».
Статья Пакуем Python в EXE
Зачем вообще это надо? Да по сути и не надо в большинстве случаев. Но бывает, что вы написали или скопировали какую-нибудь интересную тулзу, и хотите с ней поделиться. Конечно, если у того, кому вы отправляете прогу есть Python, то проблем нет. А бывает, что человек не шарит совсем в кодинге, и как пользователь тоже не имеет установленного питона нужной версии.
Вот тогда и выручает упаковка файла или файлов в EXE. Такой файл будет запускаться и работать по клику мышки, всё очень просто.
Для сборки файлов в экзешник есть разные приложения. Я рассмотрю самый простой, без всяких заморочек, с которым разберётся любой новичок.
Распаковываем архив. Внутри папки будет конвертер, запускающийся по клику мышки.
Так, нам понадобится подопытный. Для этого я сотряпал простой текстовый редактор, который открывает файл, и после редактирования сохраняет его. Ну или просто в окне можно что-то написать и сохранить.
Вот что получилось
Жмём Build, прога чуток поколдует, выдаст нам сообщение об успешной сборке.
После этого в папке с конвертором появятся 2 папки
В папке dist и будет лежать наш готовый дистрибутив в формате EXE. Переместите его куда угодно, а потом обе эти папки можно смело удалять. Теперь проверяем работоспособность выходного файла, кликнув на него.
explorer
explorer
LeMit
Member
В скомпилированном exe-файле при нажатии на кнопку «Приглашения» получаю ошибку в консоли:
explorer
LeMit
Member
Алексей Шапошников
New member
explorer
Это не поможет, так как интерпретатор python работает локально внутри exe. Нужно переписать программу, убрав внешнее подключение.
LeMit
Member
explorer
LeMit
Member
explorer
LeMit
Member
explorer
garrip91
New member
1. Пытаюсь запустить Ваш этот «Конвертер», используя «python PyInstallerGUI.py», и вижу следующее:
Traceback (most recent call last):
File «PyInstallerGUI.py», line 22, in
from PIL import Image, ImageTk, ImageOps
ModuleNotFoundError: No module named ‘PIL’
PS C:\Users\garri\OneDrive\Desktop\ЭДУАРД\Programming\PyInstallerGUI-master>
2. Пытаюсь загрузить «PIL», используя «pip install PIL», и вижу следующее:
ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)
ERROR: No matching distribution found for PIL
НУ И КАКИМ ЖЕ ОБРАЗОМ ВЫ ЗАПУСКАЕТЕ ЭТОТ ТАК НАЗЫВАЕМЫЙ «КОНВЕРТЕР».
1. Пытаюсь запустить Ваш этот «Конвертер», используя «python PyInstallerGUI.py», и вижу следующее:
Traceback (most recent call last):
File «PyInstallerGUI.py», line 22, in
from PIL import Image, ImageTk, ImageOps
ModuleNotFoundError: No module named ‘PIL’
PS C:\Users\garri\OneDrive\Desktop\ЭДУАРД\Programming\PyInstallerGUI-master>
2. Пытаюсь загрузить «PIL», используя «pip install PIL», и вижу следующее:
ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)
ERROR: No matching distribution found for PIL
НУ И КАКИМ ЖЕ ОБРАЗОМ ВЫ ЗАПУСКАЕТЕ ЭТОТ ТАК НАЗЫВАЕМЫЙ «КОНВЕРТЕР».
Убедись что запускаешь pip из того-же окружения что и pyinstaller.
А так-же, я не рекомендую использовать GUI версию pyinstaller.
Мало ли ее же тоже люди пишут и обновляют. От того и могут возникнуть ошибки.
explorer
1. Пытаюсь запустить Ваш этот «Конвертер», используя «python PyInstallerGUI.py», и вижу следующее:
Traceback (most recent call last):
File «PyInstallerGUI.py», line 22, in
from PIL import Image, ImageTk, ImageOps
ModuleNotFoundError: No module named ‘PIL’
PS C:\Users\garri\OneDrive\Desktop\ЭДУАРД\Programming\PyInstallerGUI-master>
2. Пытаюсь загрузить «PIL», используя «pip install PIL», и вижу следующее:
ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)
ERROR: No matching distribution found for PIL
НУ И КАКИМ ЖЕ ОБРАЗОМ ВЫ ЗАПУСКАЕТЕ ЭТОТ ТАК НАЗЫВАЕМЫЙ «КОНВЕРТЕР».
Уже был ответ, во-первых pyinstaller не поддерживается Python версии более чем 3.7.0 Во-вторых модуль PIL давно обновился и называется pillow, поставить можно так: sudo easy_install pillow
ff125s
New member
Vladej
New member
garrip91
New member
Александр Лисов
New member
Ну вот я и вернулся с моря. Очень хорошо что есть баг, это заставило меня провести небольшое исследование по сборке файлов в EXE.
Для этого я прогнал разные ресурсы и выяснил по крайней мере 3 причины, по которым компилл не получается как надо.
Грабли, грабли, грабли.
1. Отсутствуют некоторые библиотеки dll в самой винде.
2. Присутствует скрытый импорт в модуле. В музыкальной открытке есть предупреждение: WARNING: Hidden import «pygame._view» not found!
Соответственно сборщик не может знать путей к нужному модулю.
3. Файл «моя программа.py» изначально не запускается двойным кликом мышки, а лишь через IDLE и т.п.
Теперь выбранное расширение подставляется к имени файла.
Более сложные программы можно собрать через другие тулзы. Правда работать чуток посложнее, больше телодвижений. Одна из программ cx_Freeze.
Сначала нужно установить wheel. В cmd вводим pip install wheel или pip3 install wheel
Далее ЗДЕСЬ выбираем и скачиваем нужную версию cx_Freeze
Скачанный файлик кидаем в корень диска С и в cmd вводим команду:
pip install С:\cx_Freeze-5.1.1-cp36-cp36m-win32.whl (название своей версии, если оно отличается)
В каталоге с программой которую нужно скомпилировать создайте файл «setup.py» в который разместите код:
К сожалению, в отличии от pyinstaller, сборка не будет в один файл, а будет куча библиотек и прочего, без которых экзешник работать не будет. По сути мы получим портабл версию. В этом минус. Плюс заключается в том, что настройки гибкие, и даже очень упрямые программы можно собрать этим инструментом.
Попробовал собрать открытку из темы Ваяем музыкальную открытку на Python со стандартным файлом setup.py ничего не получилось. Пришлось колдовать часа 1,5 чтобы решить все вопросы.
Сначала cx_Freeze ругалась на модуль tkinter, так как не могла найти пути к tcl8.6 и tk8.6. Вручную прописал, на этом трудности не закончились. Дальше захотелось ей dll-ок, тоже добавил. Вдоволь поизвращавшись, прога успешно собралась.
Однако бесячее окно с надписью от модуля pygame резало глаза
Ещё малость шаманских танцев с бубном и наши победили )))
ImportError: cannot import name ‘_imaging’ from ‘PIL’ #4416
Comments
Coolgamerguy4793 commented Feb 11, 2020 •
What did you do?
Tried to run: from PIL import Image
What did you expect to happen?
To get access to the Image package contained in PIL
What actually happened?
I got the error:
What are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered:
radarhere commented Feb 14, 2020
How did you install Pillow?
Coolgamerguy4793 commented Feb 14, 2020 •
I installed it from pip
radarhere commented Feb 14, 2020
I presume you did not try and build Pillow from source.
Could you post the output of the following code?
radarhere commented Feb 20, 2020
radarhere commented Feb 26, 2020
I presume that you haven’t created a script named PIL.py that could be interfering.
HTG-YT commented Feb 29, 2020
Having the same issue here, however I am pretty sure that they aren’t installed side by side, with proof here:
radarhere commented Feb 29, 2020
@HTG-YT what operating system are you using? How did you install Pillow?
Could you post the output of the following code?
HTG-YT commented Feb 29, 2020 •
My operating system is Windows 10 Home.
The output of the code is as below:
@radarhere and I got that via pip install Pillow
HTG-YT commented Feb 29, 2020
and this is the traceback:
HTG-YT commented Feb 29, 2020
So with the traceback I wonder if it is a problem of the PIL package.
radarhere commented Feb 29, 2020
#4149 may be of interest to you
HTG-YT commented Feb 29, 2020
That doesn’t seem to work in the built-in terminal of PyCharm
HTG-YT commented Feb 29, 2020
Did that miniconda3 mean I have to install external stuff to my computer?
shiba24 commented Apr 6, 2020
radarhere commented Apr 21, 2020
I don’t want to suggest that you have to use miniconda, I’m just attempting to provide another situation in the hope that it will help and lead you towards a solution. https://stackoverflow.com/questions/55419368/in-pycharm-importerror-dll-load-failed-the-specified-module-could-not-be-found, for example, is a person who has a similar problem to this, with Anaconda, and resolves it by adding the interpreter to PyCharm. So maybe the interpreter settings could be a solution here?
HTG-YT commented May 12, 2020
Well after I updated to newer version so pip, the problem is resolved.
Linkontoask commented Jun 29, 2020
@HTG-YT I would like to know in which environment the problem was solved. I also tried to use the built code in the project.
padfoot-y2m commented Aug 28, 2020
I am using pycharm and I installed pillow from the settings,the version in 7.2.0. I am facing the same problem and after i type import PIL
print(PIL) i get this:
I am new in programming,please help me solve this issue.
radarhere commented Aug 28, 2020
The solution for @HTG-YT was to upgrade pip, so you might try
etasnadi commented Dec 2, 2020
Same issue here: ImportError: cannot import name ‘_imaging’ from ‘PIL’ (/usr/lib/python3/dist-packages/PIL/__init__.py) when using scikit-image (Pillow 7.0). Upgraded to 8.0.1 and it works.
richtong commented Feb 4, 2021
I’m getting this error on a Mac after running
This fails with the line
The Pillow version is 8.2
I also tried this with conda and with:
But when running this I get Pi
I get nearly the same error
So did something change with Pillow v8.1.0?
radarhere commented Feb 4, 2021
from PIL import images
from PIL import Images
For one thing, these are incorrect. It is from PIL import Image
ivanstepanovftw commented Sep 4, 2021
PyPy3 enjoyer is here.
Environment: Windows 10 x64 under VMWare Player. Installation was:
radarhere commented Sep 4, 2021
Did you want to try
rabiyulfahimhasim786 commented Jan 19, 2022 •
pip install pillow
Requirement already satisfied: pillow in c:\users\admin\anaconda3\lib\site-packages (8.4.0)
Note: you may need to restart the kernel to use updated packages.
pip install PIL
Note: you may need to restart the kernel to use updated packages.
ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)
ERROR: No matching distribution found for PIL
All requested packages already installed.
Note: you may need to restart the kernel to use updated packages.
could not find a version that satisfies the requirement mediapipe (from versions: none)
I have tried upgrading pip version but nothing so far seems to help
My current pip version is 21.3.1
I am running Windows 7 (32 bit) machine
3 Answers 3
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
Please note that MediaPipe Python PyPI officially supports the 64-bit version of Python 3.7 and above on the following OS:
x86_64 Linux
x86_64 macOS 10.15+
amd64 Windows
Find details From the official docs of mediapipe here
You’ll have to run python and pip binary above 3.7 on a 64-bit OS. If your OS is unsupported/this doesn’t work, you’ll have to build the python mediapipe package. Follow the steps from official docs here
if you are building the package, also make sure you have opencv pre-installed. You can use the following command to install OpenCV
Building the pipelone might seem overwelhming from a beginner perspective, however just read and follow the clearly mentioned steps and your problem will be solved.
Источники информации:
- http://stackoverflow.com/questions/40749290/could-not-find-a-version-that-satisfies-the-requirement-pillow-2-7-0
- http://codeby.net/threads/pakuem-python-v-exe.64815/page-3
- http://github.com/python-pillow/Pillow/issues/4416
- http://stackoverflow.com/questions/70061068/could-not-find-a-version-that-satisfies-the-requirement-mediapipe-from-versions