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.

Changed behavior with --extra-index-url with pip 9

See original GitHub issue
  • Pip version: 9.0.1
  • Python version: 3.5.2+
  • Operating System: Debian Stretch (testing)

Description:

We have a private internal package we use for our projects that is hosted on our own internal server. That packaging server only has our private packages and is not a full PyPI mirror, because it’s not what we need. In the past, I have been able to run:

pip install -r requirements.txt --extra-index-url http://pip.croscon.com:8088/simple/ --trusted-host pip.croscon.com

and it works fine. However, now when I run this command, I get an error from pip saying it can’t find a specific package on pip.croscon.com. This package is not our internal package and is one we normally pull from PyPI. This critically errors and fails. Going back to pip 8 fixed this.

What I’ve run:

(.env) hayden@beard-machine ~/g/zvm-demo> pip --version
pip 9.0.1 from /home/hayden/gits/zvm-demo/.env/lib/python3.5/site-packages (python 3.5)
(.env) hayden@beard-machine ~/g/zvm-demo> pip install -r requirements.txt  \
                                            --extra-index-url http://pip.croscon.com:8088/simple/  \
                                            --trusted-host pip.croscon.com
Collecting Flask-Celery-Helper==1.1.0 (from -r requirements.txt (line 1))
Exception:
Traceback (most recent call last):
  File "/home/hayden/gits/zvm-demo/.env/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/hayden/gits/zvm-demo/.env/lib/python3.5/site-packages/pip/commands/install.py", line 353, in run
    wb.build(autobuilding=True)
  File "/home/hayden/gits/zvm-demo/.env/lib/python3.5/site-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/home/hayden/gits/zvm-demo/.env/lib/python3.5/site-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/home/hayden/gits/zvm-demo/.env/lib/python3.5/site-packages/pip/req/req_set.py", line 554, in _prepare_file
    require_hashes
  File "/home/hayden/gits/zvm-demo/.env/lib/python3.5/site-packages/pip/req/req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/home/hayden/gits/zvm-demo/.env/lib/python3.5/site-packages/pip/index.py", line 465, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
  File "/home/hayden/gits/zvm-demo/.env/lib/python3.5/site-packages/pip/index.py", line 423, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "/home/hayden/gits/zvm-demo/.env/lib/python3.5/site-packages/pip/index.py", line 568, in _get_pages
    page = self._get_page(location)
  File "/home/hayden/gits/zvm-demo/.env/lib/python3.5/site-packages/pip/index.py", line 683, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "/home/hayden/gits/zvm-demo/.env/lib/python3.5/site-packages/pip/index.py", line 795, in get_page
    resp.raise_for_status()
  File "/home/hayden/gits/zvm-demo/.env/share/python-wheels/requests-2.11.1-py2.py3-none-any.whl/requests/models.py", line 862, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
pip._vendor.requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://pip.croscon.com:8088/simple/flask-celery-helper/
# now swap to pip 8
(.env) hayden@beard-machine ~/g/zvm-demo> pip install -U "pip>=8.0.0,<9.0.0"
Collecting pip<9.0.0,>=8.0.0
  Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB)
    100% |████████████████████████████████| 1.2MB 895kB/s 
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-8.1.2
(.env) hayden@beard-machine ~/g/zvm-demo> pip install -r requirements.txt  \
                                            --extra-index-url http://pip.croscon.com:8088/simple/  \
                                            --trusted-host pip.croscon.com
  ... omitted for brevity; but it was pip working as expected ...
Successfully installed Flask-0.12 Flask-Celery-Helper-1.1.0 Flask-Classful-0.13.1 Flask-Login-0.4.0 Flask-Marshmallow-0.7.0 Jinja2-2.8 MarkupSafe-0.23 Werkzeug-0.11.11 amqp-1.4.9 anyjson-0.3.3 arrow-0.10.0 billiard-3.3.0.23 blinker-1.4 celery-3.1.25 click-6.6 eventlet-0.19.0 fleaker-0.1.4 google-auth-0.5.0 google-auth-httplib2-0.0.2 google-cloud-core-0.22.1 google-cloud-storage-0.22.0 googleapis-common-protos-1.5.0 greenlet-0.4.11 gunicorn-19.6.0 httplib2-0.9.2 invoke-0.12.1 itsdangerous-0.24 kombu-3.0.37 marshmallow-2.10.5 marshmallow-jsonschema-0.3.0 oauth2client-4.0.0 pendulum-0.7.0 protobuf-3.1.0.post1 pyasn1-0.1.9 pyasn1-modules-0.0.8 python-dateutil-2.6.0 pytz-2016.10 pytzdata-2016.10 redis-2.10.5 rsa-3.4.2 six-1.10.0 tzlocal-1.3
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
hjccommented, Jan 26, 2017

Interestingly enough, this is an issue with virtualenv. The pip it installs is just broken by default. Downgrading to pip 8 and then upgrading back to pip 9 fixes it.

Virtualenv version is: 15.1.0.

2reactions
hjccommented, Jan 26, 2017

Hello?

Any response? Hit this again today which reminded me of the problem at hand.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python pip priority order with index-url and extra-index-url
The short answer is: there is no prioritization and you probably should avoid using --extra-index-url entirely. This is asked and answered ...
Read more >
Bug #1833229 “`--extra-index-url` not working for PIP”
* The --extra-index-url feature is not working when an index doesn't contain all the packages in the dependency set.
Read more >
Installing Python requirements with an extra index url hangs ...
This used to work, but now hangs when installing dependencies. I tried updating pip, and using pip3. I have modified the requirements.txt to...
Read more >
User Guide - pip documentation v21.1.dev0
Support for percent-encoded authentication in index URLs was added in pip 10.0.0 (in #3236). Users that must use authentication for their Python repository ......
Read more >
extra-index-url option is used and package ... - Red Hat Bugzilla
I don't think we can do anything on the pip side. The --extra-index-url means an *extra* source of packages; it's right there in...
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