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.

`--ignore-requires-python` has no effect

See original GitHub issue

Environment

  • pip version:
$ ./venv/bin/pip --version
pip 19.0.3 from /tmp/t/venv/site-packages/pip (python 3.5)
  • Python version:
$ ./venv/bin/python --version
Python 3.5.3 (fdd60ed87e94, Apr 24 2018, 06:10:04)
[PyPy 6.0.0 with GCC 6.2.0 20160901]
  • OS:
$ uname -a
Linux asottile-VirtualBox 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.2 LTS
Release:	18.04
Codename:	bionic

Description / Expected behaviour / How to Reproduce

I expect this to succeed:

$ ./venv/bin/pip install --ignore-requires-python black -v

black requires python>=3.6, though I am running pypy3.5 and explicitly asking pip to --ignore-requires-python

Output

$ ./venv/bin/pip install --ignore-requires-python black -v
Created temporary directory: /tmp/pip-ephem-wheel-cache-7_gvlskb
Created temporary directory: /tmp/pip-req-tracker-t4ef_ow9
Created requirements tracker '/tmp/pip-req-tracker-t4ef_ow9'
Created temporary directory: /tmp/pip-install-3x0i9w7v
Collecting black
  1 location(s) to search for versions of black:
  * https://pypi.org/simple/black/
  Getting page https://pypi.org/simple/black/
  Looking up "https://pypi.org/simple/black/" in the cache
  Request header has "max_age" as 0, cache bypassed
  Starting new HTTPS connection (1): pypi.org:443
  https://pypi.org:443 "GET /simple/black/ HTTP/1.1" 304 0
  Analyzing links from page https://pypi.org/simple/black/
    The package https://files.pythonhosted.org/packages/22/5a/ebe5881cbf07435ea1ad76119ee142f42fb7a333d562c202db015b959ae7/black-18.3a0-py3-none-any.whl#sha256=7183263650ba3071034e90b40a1ea74abccbd32cf525cef6d7914479dbe7f2fb (from https://pypi.org/simple/black/) (requires-python:>=3.6) is incompatible with the python version in use. Acceptable python versions are: >=3.6
    The package https://files.pythonhosted.org/packages/83/a2/fae3ddb516a52a0f37e6e2ef3bd789b6d093d2c7015a41a41bff30f39897/black-18.3a0.tar.gz#sha256=0461c7a52b5beb378936bf642753dec7a45305c96c6129d540b9c53227121a5a (from https://pypi.org/simple/black/) (requires-python:>=3.6) is incompatible with the python version in use. Acceptable python versions are: >=3.6
    The package https://files.pythonhosted.org/packages/61/b4/3a39dcf59342f53680c59a5e44c0b172ea5d6470a5aaba8ae3cdbfccc1e7/black-18.3a1-py3-none-any.whl#sha256=04edc87b51b34a7aa093f39bf207e2ebc3612b26f2c79fdf8ff13b2d60622c9a (from https://pypi.org/simple/black/) (requires-python:>=3.6) is incompatible with the python version in use. Acceptable python versions are: >=3.6

[ many repeated lines removed ]


    The package https://files.pythonhosted.org/packages/e8/5f/0f79fcd943ba465cbd4bf303c9794970c13a95e5456630de9f72e7f37ad4/black-18.9b0.tar.gz#sha256=e030a9a28f542debc08acceb273f228ac422798e5215ba2a791a6ddeaaca22a5 (from https://pypi.org/simple/black/) (requires-python:>=3.6) is incompatible with the python version in use. Acceptable python versions are: >=3.6
    Skipping link https://files.pythonhosted.org/packages/30/62/cf549544a5fe990bbaeca21e9c419501b2de7a701ab0afb377bc81676600/black-19.3b0-py36-none-any.whl#sha256=09a9dcb7c46ed496a9850b76e4e825d6049ecd38b611f1224857a79bd985a8cf (from https://pypi.org/simple/black/) (requires-python:>=3.6); it is not compatible with this Python
    The package https://files.pythonhosted.org/packages/89/07/aebb10fb8f2ffbac672dfbebffa724643bc84cf012a57737a622d1dabddb/black-19.3b0.tar.gz#sha256=68950ffd4d9169716bcb8719a56c07a2f4485354fec061cdd5910aa07369731c (from https://pypi.org/simple/black/) (requires-python:>=3.6) is incompatible with the python version in use. Acceptable python versions are: >=3.6
  Could not find a version that satisfies the requirement black (from versions: )
Cleaning up...
Removed build tracker '/tmp/pip-req-tracker-t4ef_ow9'
No matching distribution found for black
Exception information:
Traceback (most recent call last):
  File "/tmp/t/venv/site-packages/pip/_internal/cli/base_command.py", line 179, in main
    status = self.run(options, args)
  File "/tmp/t/venv/site-packages/pip/_internal/commands/install.py", line 315, in run
    resolver.resolve(requirement_set)
  File "/tmp/t/venv/site-packages/pip/_internal/resolve.py", line 131, in resolve
    self._resolve_one(requirement_set, req)
  File "/tmp/t/venv/site-packages/pip/_internal/resolve.py", line 294, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/tmp/t/venv/site-packages/pip/_internal/resolve.py", line 242, in _get_abstract_dist_for
    self.require_hashes
  File "/tmp/t/venv/site-packages/pip/_internal/operations/prepare.py", line 269, in prepare_linked_requirement
    req.populate_link(finder, upgrade_allowed, require_hashes)
  File "/tmp/t/venv/site-packages/pip/_internal/req/req_install.py", line 196, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/tmp/t/venv/site-packages/pip/_internal/index.py", line 688, in find_requirement
    'No matching distribution found for %s' % req
pip._internal.exceptions.DistributionNotFound: No matching distribution found for black

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:22 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
asottilecommented, Apr 1, 2019

😆 I’m glad you finally took the time to look instead of assuming I’m wrong

I’ve been following closely the --python-version / platform / abi / etc. options, they are a non-solution until the --target requirement is lifted: https://github.com/pypa/pip/issues/5453#issuecomment-416012640

0reactions
cjerdonekcommented, Jun 6, 2019

I would expect these two to be mutually exclusive: if --python-version is passed, the value is used to check against Requires-Python (both in metadata and on index),

FYI, I just filed PR #6577, which does the above,

Read more comments on GitHub >

github_iconTop Results From Across the Web

pip: force install ignoring dependencies - Stack Overflow
pip has a --no-dependencies switch. You should use that. For more information, run pip install -h , where you'll see this line:
Read more >
Requires-Python upper limits - Packaging
Requires -Python upper limits Requires-Python was added to allow older versions of Python to be dropped by packages without breaking installation on older ......
Read more >
pip install - pip documentation v22.3.1
Ignore the Requires-Python information. --no-build-isolation#. Disable isolation when building a modern source distribution.
Read more >
pip install — pip 10.0.0.dev0 documentation
(TODO: Investigate in more detail when this command is required). No other build system commands are invoked by the pip install command. Installing...
Read more >
TorchScript — PyTorch 1.13 documentation
This is useful when a small part of a model requires some control-flow even ... has no effect @torch.jit.ignore def some_fn2(): return 2...
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