question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

More verbose explanation why "Could not find a version that satisfies the requirement"

See original GitHub issue

Environment

(venv-test) ~/pySAML2/example # pip --version
pip 10.0.1 from /root/pySAML2/example/venv-test/lib/python3.6/site-packages/pip (python 3.6)
(venv-test) ~/pySAML2/example # python --version
Python 3.6.8
(venv-test) ~/pySAML2/example # cat /etc/alpine-release 
3.9.0
(venv-test) ~/pySAML2/example # 

Description

I have spent hours trying to debug, what does this mean:

(venv-test) ~/pySAML2/example # pip install -r requirements.txt  --index-url https://pypi.python.org/simple/
Looking in indexes: https://pypi.python.org/simple/
Looking in links: https://pypi.python.org/simple/
Collecting mako (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/f9/93/63f78c552e4397549499169198698de23b559b52e57f27d967690811d16d/Mako-1.0.10.tar.gz (460kB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 460kB 11.8MB/s 
Collecting cherrypy (from -r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/aa/0e/4e353c47789ccb50130a44e765dae55b3e85abca01ff21930533ab36afc9/CherryPy-18.1.1-py2.py3-none-any.whl
Collecting pysaml2<5.0.0,>=4.7.0 (from -r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/7b/20/df88d00a563fe437e9e03cf1b02927b47cea2fb5ed9d696c2820c53d7657/pysaml2-4.7.0-py2.py3-none-any.whl (335kB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 337kB 18.3MB/s 
Collecting MarkupSafe>=0.9.2 (from mako->-r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/b9/2e/64db92e53b86efccfaea71321f597fa2e1b2bd3853d8ce658568f7a13094/MarkupSafe-1.1.1.tar.gz
Collecting cheroot>=6.2.4 (from cherrypy->-r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/3e/50/840039a5350b54fb8efbc3b26c6e4244c9ca24c49ad84fe1f57b1f79ff7d/cheroot-6.5.5-py2.py3-none-any.whl
Collecting portend>=2.1.1 (from cherrypy->-r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/54/18/d288ef3cfcaac40c9c3674d92ef8313bf137deeced810d60d9722c0a327a/portend-2.4-py2.py3-none-any.whl
Collecting more-itertools (from cherrypy->-r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/b3/73/64fb5922b745fc1daee8a2880d907d2a70d9c7bb71eea86fcb9445daab5e/more_itertools-7.0.0-py3-none-any.whl
Collecting zc.lockfile (from cherrypy->-r requirements.txt (line 2))
Collecting pytz (from pysaml2<5.0.0,>=4.7.0->-r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/3d/73/fe30c2daaaa0713420d0382b16fbb761409f532c56bdcc514bf7b6262bb6/pytz-2019.1-py2.py3-none-any.whl
Collecting defusedxml (from pysaml2<5.0.0,>=4.7.0->-r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/06/74/9b387472866358ebc08732de3da6dc48e44b0aacd2ddaa5cb85ab7e986a2/defusedxml-0.6.0-py2.py3-none-any.whl
Collecting cryptography>=1.4 (from pysaml2<5.0.0,>=4.7.0->-r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/07/ca/bc827c5e55918ad223d59d299fff92f3563476c3b00d0a9157d9c0217449/cryptography-2.6.1.tar.gz
  Could not find a version that satisfies the requirement cffi!=1.11.3,>=1.8 (from versions: )
No matching distribution found for cffi!=1.11.3,>=1.8
(venv-test) ~/pySAML2/example # 

While I was able to:

(venv-example) ~/pySAML2/example # pip install -r /root/pySAML2/example/requirements.txt --extra-index-url https://pypi.python.org/simple/
Looking in indexes: https://pypi.python.org/simple/
Looking in links: https://pypi.python.org/simple/
Collecting mako (from -r /root/pySAML2/example/requirements.txt (line 1))
  Downloading https://pypi.python.org/simple//mako/Mako-1.0.10.tar.gz (460kB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 460kB 143kB/s 
Collecting cherrypy (from -r /root/pySAML2/example/requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/aa/0e/4e353c47789ccb50130a44e765dae55b3e85abca01ff21930533ab36afc9/CherryPy-18.1.1-py2.py3-none-any.whl
Collecting pysaml2<5.0.0,>=4.7.0 (from -r /root/pySAML2/example/requirements.txt (line 3))
  Downloading https://pypi.python.org/simple//pysaml2/pysaml2-4.7.0-py2.py3-none-any.whl (335kB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 337kB 166kB/s 
Collecting MarkupSafe>=0.9.2 (from mako->-r /root/pySAML2/example/requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/b9/2e/64db92e53b86efccfaea71321f597fa2e1b2bd3853d8ce658568f7a13094/MarkupSafe-1.1.1.tar.gz
Collecting cheroot>=6.2.4 (from cherrypy->-r /root/pySAML2/example/requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/3e/50/840039a5350b54fb8efbc3b26c6e4244c9ca24c49ad84fe1f57b1f79ff7d/cheroot-6.5.5-py2.py3-none-any.whl
Collecting more-itertools (from cherrypy->-r /root/pySAML2/example/requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/b3/73/64fb5922b745fc1daee8a2880d907d2a70d9c7bb71eea86fcb9445daab5e/more_itertools-7.0.0-py3-none-any.whl
Collecting portend>=2.1.1 (from cherrypy->-r /root/pySAML2/example/requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/54/18/d288ef3cfcaac40c9c3674d92ef8313bf137deeced810d60d9722c0a327a/portend-2.4-py2.py3-none-any.whl
Collecting zc.lockfile (from cherrypy->-r /root/pySAML2/example/requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/58/c2/d7c89bdad237b4b7837609172be3e8bf5630796c0020494a15b97ece8eb1/zc.lockfile-1.4.tar.gz
Collecting pyOpenSSL (from pysaml2<5.0.0,>=4.7.0->-r /root/pySAML2/example/requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/01/c8/ceb170d81bd3941cbeb9940fc6cc2ef2ca4288d0ca8929ea4db5905d904d/pyOpenSSL-19.0.0-py2.py3-none-any.whl
Collecting requests>=1.0.0 (from pysaml2<5.0.0,>=4.7.0->-r /root/pySAML2/example/requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl
Collecting six (from pysaml2<5.0.0,>=4.7.0->-r /root/pySAML2/example/requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting cryptography>=1.4 (from pysaml2<5.0.0,>=4.7.0->-r /root/pySAML2/example/requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/07/ca/bc827c5e55918ad223d59d299fff92f3563476c3b00d0a9157d9c0217449/cryptography-2.6.1.tar.gz
  Could not find a version that satisfies the requirement cffi!=1.11.3,>=1.8 (from versions: )
No matching distribution found for cffi!=1.11.3,>=1.8
(venv-example) ~/pySAML2/example # pip list | grep cffi
cffi       1.12.3 

Something started stricking me, when I saw a whole lot of .tar.gz instead of -?py2.?py3-?????-????.whl files getting pulled

After searching the internet without avail, I found #3969 this, and then things started falling in place as to β€œwhy” my python so forcefully resisted installing https://files.pythonhosted.org/packages/5f/bf/6aa1925384c23ffeb579e97a5569eb9abce41b6310b329352b8252cee1c3/cffi-1.12.3-cp36-cp36m-manylinux1_x86_64.whl

Expected behavior

I would like to have a very precise indication as to β€œwhy” something β€œis not found”.

pip clearly found the version and arch it wanted, it was just not happy with the manylinux1 β€œtag”.

e.g. pip could’ve said:

  Could not find a version that satisfies the requirement cffi!=1.11.3,>=1.8 
Versions matching requirement "!=1.11.3,>=1.8": [x,y,z, ....] # Descending, truncating if output is too large? Some basic filtering first, THEN the version requirement?
Architectures matching (x86_64): x86_64
"Python Version" matching (p36): [cp36, cp36m]
Distributions matching (linux_x86_64, any): None

How to Reproduce

  1. Get package from β€˜β€¦β€™
  2. Then run β€˜β€¦β€™
  3. An error occurs.

Output

# python3 -c "import wheel.pep425tags as w; print(w.get_supported())" | tr '\n' '\0' | sed -E 's/\),/),\n/g'
[('cp36', 'cp36m', 'linux_x86_64'),
 ('cp36', 'abi3', 'linux_x86_64'),
 ('cp36', 'none', 'linux_x86_64'),
 ('cp35', 'abi3', 'linux_x86_64'),
 ('cp34', 'abi3', 'linux_x86_64'),
 ('cp33', 'abi3', 'linux_x86_64'),
 ('cp32', 'abi3', 'linux_x86_64'),
 ('cp36', 'none', 'any'),
 ('cp3', 'none', 'any'),
 ('cp35', 'none', 'any'),
 ('cp34', 'none', 'any'),
 ('cp33', 'none', 'any'),
 ('cp32', 'none', 'any'),
 ('cp31', 'none', 'any'),
 ('cp30', 'none', 'any'),
 ('py3', 'none', 'linux_x86_64'),
 ('py36', 'none', 'any'),
 ('py3', 'none', 'any'),
 ('py35', 'none', 'any'),
 ('py34', 'none', 'any'),
 ('py33', 'none', 'any'),
 ('py32', 'none', 'any'),
 ('py31', 'none', 'any'),
 ('py30', 'none', 'any')]

[1]: I am considering if that would be a bug. What’s pips deal, β€œnot” accepting a self-compiled, pre-installed depenedency? Why would it β€œmandatorily” need to pull it as cffi-1.12.3-cp36-cp36m-manylinux1_x86_64.whl, and not be satisfied by β€œjust” compiling it (or having β€œme” jump through hoops to make it appear in pip list)?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:15
  • Comments:36 (17 by maintainers)

github_iconTop GitHub Comments

9reactions
samcdavidcommented, May 16, 2020

+1 on this. I’ve been fighting this issue for the past several hours.

Installing protobuf==3.12.0 works in my back, but when I try to do it in docker using the python:3.8.3-alpine3.11 image I get Could not find a version that satisfies the requirement.

Being new to Python the current error message is not helpful at all.

3reactions
stdedoscommented, May 23, 2019

I later found the -vvv output (https://github.com/pypa/pip/issues/3642#issuecomment-407081008). However, it is awfully verbose (as suggested by the -vvv) for tracking down β€œone” package refusing to install.

The β€œonly two” reasons given were the:

it is not compatible with this Python
No sources permitted for cffi
Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Could not find a version that satisfies the requirement ...
I ran into the same problem, it occurred only when I ran commands from my Docker image (or Dockerfile). Finally many hours later...
Read more >
Could not find a version that satisfies the requirement X
The error "Could not find a version that satisfies the requirement" is often caused due to not having the necessary permissions to install...
Read more >
Fix the pip error: Couldn't find a version that satisfies the ...
The package is not present on PyPI server. In this case pip will not work. So you'll have to download and install the...
Read more >
error: could not find a version that satisfies the requirement ...
Solution 1. Upgrade pip. On Windows, just download the latest MSI file from the official site. Solution 2. Use proxy settings with pip....
Read more >
Intro to Python Environments - The Materials Project Workshop
Python is simple to learn and use, is platform independent, and most importantly ... --disable-pip-version-check Don't periodically check PyPI to determine ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found