I have installed python 3.5, and need to install pywin (pywin32)
however, pip cannot find it. Note, i have just PIP install’ed send2trash and gitpython successfully
Could not find a version that satisfies the requirement pywin32 (from versions: )
A few possibly relevant data points:
- new install of python 3.5
- windows 7 x64
- python 2.7 was previously installed on the machine
- as mentioned, several other packages were installed fine via PIP
- running these commands from git-bash, which came from the git windows installer, installed some time ago.
— I have gnu grep in my path, so i believe i selected the git installer option to put the whole mysys toolchain in my path
full —verbose output:
C:UsersUSER>pip install pywin32 --proxy http://proxy.COMPANY.com:8080
Collecting pywin32
Could not find a version that satisfies the requirement pywin32 (from versions: )
No matching distribution found for pywin32
C:UsersUSER>pip install pywin32 --proxy http://proxy.COMPANY.com:8080 --verbose
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Collecting pywin32
1 location(s) to search for versions of pywin32:
* https://pypi.python.org/simple/pywin32/
Getting page https://pypi.python.org/simple/pywin32/
Looking up "https://pypi.python.org/simple/pywin32/" in the cache
Current age based on date: 61
Freshness lifetime from max-age: 600
Freshness lifetime from request max-age: 600
The response is "fresh", returning cached response
600 > 61
Analyzing links from page https://pypi.python.org/simple/pywin32/
Could not find a version that satisfies the requirement pywin32 (from versions: )
Cleaning up...
No matching distribution found for pywin32
Exception information:
Traceback (most recent call last):
File "c:usersUSERappdatalocalprogramspythonpython35libsite-packagespipbasecommand.py", line 215, in main
status = self.run(options, args)
File "c:usersUSERappdatalocalprogramspythonpython35libsite-packagespipcommandsinstall.py", line 324, in run
requirement_set.prepare_files(finder)
File "c:usersUSERappdatalocalprogramspythonpython35libsite-packagespipreqreq_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "c:usersUSERappdatalocalprogramspythonpython35libsite-packagespipreqreq_set.py", line 554, in _prepare_file
require_hashes
File "c:usersUSERappdatalocalprogramspythonpython35libsite-packagespipreqreq_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "c:usersUSERappdatalocalprogramspythonpython35libsite-packagespipindex.py", line 514, in find_requirement
'No matching distribution found for %s' % req
pip.exceptions.DistributionNotFound: No matching distribution found for pywin32
Comments
vincentcox
changed the title
Could not find a version that satisfies the requirement pywin32>=223 (from pypiwin32)
<duplicate>
Feb 28, 2018
vincentcox
changed the title
<duplicate>
Could not find a version that satisfies the requirement pywin32>=223
Feb 28, 2018
JMSwag
added a commit
to Digital-Sapphire/PyUpdater
that referenced
this issue
Mar 29, 2018
JMSwag
added a commit
to Digital-Sapphire/PyUpdater
that referenced
this issue
Mar 29, 2018
izmmisha
added a commit
to izmmisha/clcache
that referenced
this issue
Aug 6, 2018
Sometimes you get an error when you’re trying to install a Python package
using pip. It looks like this:
Could not find a version that satisfies the requirement (from versions:)
No matching distribution found for
Some probable reasons for this error are:
-
PyPI server isn’t responding to your requests. It can happen either because
the PyPI server is down or because it has blacklisted your IP address. This
happened to me once when I was trying installing packages on a server.
This can be fixed by using a proxy with pip. See the solution below. -
You’re running an older pip (especially on Mac). This can be fixed by
upgrading your pip.
See this post on Stack Overflow.
Thanks to Anupam Jain who pointed this in a comment. -
The package you’re trying to install is not available for your Python version.
-
The package is not available for your operating system. This is a rare case
and only happens when the package is not pure-Python, i.e. it’s been
partially written in C or Cython. Such a package needs to be compiled for
every operating system (Windows/Mac/Linux) and architecture (32-bit/64-bit).
Suppose a package has only been compiled for Windows 64-bit, then you’ll get
this error if you try to install it on Windows 32-bit, or any other
OS. -
The package is not present on PyPI server. In this case pip will not work. So
you’ll have to download and install the package manually from Github or wherever
it is available.
Solution¶
I had this issue because PyPI server had blacklisted the IP
of my hosting provider, the obvious solution was to make pip
install via a proxy.
But to see if that’s also the case with you, you can test it like this:
$ curl https://pypi.org
The requestors Network has been blacklisted due to excessive request volume.
If you are a hosting customer, please contact your hosting company's support.
If you are the hosting company, please contact infrastructure-staff@python.org to resolve
If you see the message similar to above, that means your IP has also been
blacklisted by https://pypi.org.
If you don’t see this message then the reason for the pip error could be that you’re using
an older version. See this post on Stack Overflow
for a solution.
Anyways, this can be fixed by using a proxy with pip.
Supplying a proxy address to pip
is easy:
$ pip install -r requirements.txt --proxy address:port
Above, address
and port
are IP address and port of the proxy.
To find proxies, just search Google for proxy list.
Other things that I tried¶
These are some other things that I tried to get rid of this issue.
Although they didn’t work for me, but they might work for you.
- Changing DNS resolver of my server.
This makes sense if your server’s DNS resolver can’t find PyPI servers. - Reconfiguring SSL, reinstalling CA certificates.
This makes sense if you don’t have updated CA certificates which are used by
PyPI servers. - Downloading packages using
wget
.
This is an alternative way to install Python packages. Download them viawget
and then install them usingpython setup.py install
. In my case, the server was
blacklisted by PyPI so I was getting a 403 Forbidden error. - Downloading packages using
curl
.
Alternative towget
. In my case I didn’t get a 403 error but rather it just
created invalid tarball files, instead of actually downloading them. - Downloading packages using
git
orhg
.
If your desired packages havegit
orhg
repositories that you can clone, this
is a good workaround.
To Solve this Could not find a version that satisfies the requirement You need to update your pip and setup tools and that will resolve this error.
Contents
- Solution 1: Just update the pip
- Solution 2: Use this command.
- Solution 3: For Requirements.txt
- Solution 4: Make Sure the Right Python version Using
- Frequently Asked Questions
- Summary
Solution 1: Just update the pip
You just need to update the pip and your error will be resolved. Just follow this command.
If you are a windows user Then run this command.
python -m pip install --upgrade pip
Mac users who use pip and PyPI
curl https://bootstrap.pypa.io/get-pip.py | python
And then also upgrade setuptools after doing the above.
pip install --upgrade setuptools
Solution 2: Use this command.
On Debian-based systems, I’d try
apt-get update && apt-get upgrade python-pip
Red Hat Linux-based systems:
yum update python-pip
On Mac:
sudo easy_install -U pip
Solution 3: For Requirements.txt
If You are trying to install Requirements.txt and you are facing this error then You need to use -r in the command line. Just Like This.
pip install -r requirements.txt
And now, Your error will be resolved.
Solution 4: Make Sure the Right Python version Using
Please Make Sure You are Using Right Python Version In your Command line. If You have installed Python 3 and You are trying to use Python2 then You might face this error.
python3 -m pip install <your_pkg>
Frequently Asked Questions
- How to solve Could not find a version that satisfies the requirement error?
to solve Could not find a version that satisfies the requirement error If You are trying to install Requirements.txt and you are facing this error then You need to use -r in the command line. Just Like This: pip install -r requirements.txt And now, Your error will be resolved.
- Could not find a version that satisfies the requirement
to solve Could not find a version that satisfies the requirement error Please Make Sure You are Using Right Python Version In your Command line. If You have installed Python 3 and You are trying to use Python2 then You might face this error: python3 -m pip install <your_pkg>
Summary
The solution is simple you just need to update your PIP to the very latest version and then update setuptools will resolve this error. Comment below if you are still facing this error.
Also, Read
- pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it’s not in your path
If you encounter problems importing or building mbed projects, please try resetting your Python environment as shown on this page.
- Clear the Tools->Options->VisualGDB->General->Tools->Python Directory setting:
- Delete the %LOCALAPPDATA%VisualGDBPython* directories.
- Restart Visual Studio and open the Mbed Project Wizard. When prompted to install Python, try installing the latest Python 3:
This will install a version of Python that was tested with mbed scripts on our side, and it should work exactly as described in our mbed tutorials.
- If you still get an error while trying to clone an mbed repository, the selected mbed version might be referencing packages that are not available in the currently used Python version. If this happens, click the “Show output from failed command” link in the error message shown by VisualGDB:
The log will contain output similar to the one shown below:
Run «C:Usersvirtual.SYSPROGSAppDataLocalVisualGDBPython3python.exe «C:Usersvirtual.SYSPROGSAppDataLocalVisualGDBPython3libsite—packagesmbedmbed.py» update mbed-os-6.9.0″ in directory «c:projectstempMbedProject2mbed-os» on local computer
—————————
Requirement already satisfied: colorama==0.3.9 in c:usersvirtual.sysprogsappdatalocalvisualgdbpython3libsite—packages (from —r c:projectstempMbedProject2mbed—osrequirements.txt (line 1)) (0.3.9)
<...>
ERROR: Could not find a version that satisfies the requirement pywin32==224 (from versions: 225, 226, 227, 228, 300, 301, 302)
ERROR: No matching distribution found for pywin32==224
WARNING: You are using pip version 21.1.1; however, version 21.3.1 is available.
You should consider upgrading via the ‘C:Usersvirtual.SYSPROGSAppDataLocalVisualGDBPython3python.exe -m pip install —upgrade pip’ command.
—————————
Command exited with code 1
Take a note of the following parameters:
- Python executable used to run the command (in this example, C:Usersvirtual.SYSPROGSAppDataLocalVisualGDBPython3python.exe)
- The requirements file (in this example, c:projectstempMbedProject2mbed-osrequirements.txt)
- The exact package versions that failed (in this example, pywin32==224) and the available versions (in this example, 225..302)
- In order to make that mbed version work, you will need to adjust the requirements.txt file to reference the nearest package version provided by your Python distro. In this example, it would mean replacing the following line in requirements.txt:
pywin32==224;platform_system==‘Windows’
with the following one:
pywin32==225;platform_system==‘Windows’
- Now you can re-run the “mbed update” command as shown in the log file, e.g.:
cd c:projectstempMbedProject2mbed—os
C:Usersvirtual.SYSPROGSAppDataLocalVisualGDBPython3python.exe «C:Usersvirtual.SYSPROGSAppDataLocalVisualGDBPython3libsite-packagesmbedmbed.py» update mbed—os—6.9.0
- Now you can import the manually patched mbed checkout into VisualGDB by selecting the “import” mode in the wizard:
#python #pip
Вопрос:
Я обновился до Python 3.10.0 и не могу установить несколько модулей с помощью pip
. Этой проблемы не было для более старых версий.
Когда я пытаюсь pip install pypiwin32
это сделать , это выдает следующую ошибку:
ERROR: Command errored out with exit status 1:
command: 'C:UsersusernameAppDataLocalProgramsPythonPython310python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:UsersusernameAppDataLocalTemppip-install-d9m6kfyxpypiwin32_e35bdff1e22f442e83e718653c555e3asetup.py'"'"'; __file__='"'"'C:UsersusernameAppDataLocalTemppip-install-d9m6kfyxpypiwin32_e35bdff1e22f442e83e718653c555e3asetup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:UsersusernameAppDataLocalTemppip-pip-egg-info-c3dic37e'
cwd: C:UsersusernameAppDataLocalTemppip-install-d9m6kfyxpypiwin32_e35bdff1e22f442e83e718653c555e3a
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:UsersusernameAppDataLocalTemppip-install-d9m6kfyxpypiwin32_e35bdff1e22f442e83e718653c555e3asetup.py", line 121
print "Building pywin32", pywin32_version
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/2b/ca/5c086c18de8f70222787b3e824e755b68d99272531522e77bb381d4f60c8/pypiwin32-219.zip#sha256=06d478295c89dbdd4187e1ac099bb8eab93c29e298bded4e2fbc77009287fa44 (from https://pypi.org/simple/pypiwin32/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement pywin32>=223 (from pypiwin32) (from versions: none)
ERROR: No matching distribution found for pywin32>=223
Есть ли какой-нибудь способ решить эту проблему?
Та же ошибка возникает при попытке установки win10toast
.
Любая помощь будет признательна.
Если вы хотите: я нахожусь в Windows 11, сборка 22000.194 (стабильная) Эта проблема возникала даже тогда, когда я был на Win10.
Спасибо и с уважением, Ишаан
Комментарии:
1. Попробуйте
pip3
, или если это не так, то, может быть, эти модули не поддерживают версию 3.x?2. @FaranAiki, Но это сработало на 3.9. Эта проблема возникла, когда я обновился до 3.10
3. Хмм… но
Ответ №1:
Последняя версия pywin32
имеет только колесо файлы на pypi, но те, подняться на Python 3.9. Вот почему вас не было никаких проблем с версиями питона <=3.9. Теперь, когда вы находитесь в 3.10, pip
нет другого выбора, кроме как вернуться к версии списка и скачайте последнюю версию, которая была источником пакета.
Из вашей ошибки следует, что указанная версия написана на python2. Кое — что, что вы можете попробовать, это установить pywin32
непосредственно из исходного кода github
Однако имейте в виду , что в настоящее время python 3.10 является довольно новым, и вы, вероятно, столкнетесь с аналогичными проблемами с другими пакетами в течение некоторого времени. Если вам отчаянно не нужны функции версии 3.10, возможно, вам будет лучше просто придерживаться более ранней версии python с лучшей поддержкой.
Комментарии:
1. Итак, я решил вернуться к python 3.9. Это решило все проблемы. Я бы подумал об обновлении до 3.10 через несколько недель. Спасибо за вашу поддержку! 😊
Ответ №2:
Комментарии:
1. Спасибо. Но можете ли вы поделиться прямой ссылкой для загрузки файла? Я не могу отправить файл wheel или zip, о котором вы упомянули. Спасибо
2. github.com/mhammond/pywin32/suites/3809264273/artifacts/… Это в нижней части страницы, на которую я ссылался выше. Или просто найдите «колеса» на этой странице.
3. Спасибо. Я могу скачать его прямо сейчас!