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.

Option `index-url = ` for specific commands doesn't set index-url to PyPI

See original GitHub issue
  • Pip version: 18.1 (and others, see below)
  • Python version: 3.7.2 (and others, see below)
  • Operating system: Windows 7 (and others, see below)

In the [global] section of my pip.ini I set index-url to a non-standard value. In the sections for some commands ([download], [list], [search]) I use index-url = to reset the index-url for these commands to the standard value (PyPI). Since the last update of my python environment that doesn’t work anymore:

  • pip download tries to access the non-standard index-url given in the [global] section, not PyPI. The same is true for the version check of pip at the end of the command execution.
  • pip list tries to access the non-standard index-url given in the [global] section, not PyPI, for the version check of pip at the end of the command execution.
  • Strangely, pip search works as expected.

I can reproduce this new and unexpected behaviour with

  • pip 18.1 - Python 3.7.2 - Windows 7
  • pip 10.0.1 - Python 3.7.1 - Windows 10
  • pip 18.1 - Python 3.6.4 - Windows 7

Everything used to work and still works as expected for

  • pip 9.0.1 - Python 3.6.4 - Windows 7
  • pip 9.0.3 - Python 2.7.15 - Windows 7

All five configurations mentioned use the same pip.ini.

I had a look at the release notes of pip 10 and a few of the issues mentioned there. I couldn’t find anything that indicates that the change of behaviour is intended.
I also searched the issues for “index-url =”, but none of the search results seems to be about the problem I encounter.

Here are some details / examples (pip 18.1, Python 3.7.2, Windows 7):

C:\>py -m pip config list
download.dest='E:\\zuInst.pip\\download'
download.index-url=''
download.no-index='false'
global.index-url='-'
global.log='E:\\zuInst.pip\\pip.log'
global.no-cache-dir='false'
global.no-index='true'
install.find-links='\nE:\\zuInst-erl\\PyPIP\nE:\\zuInst.pip\\wheel'
install.only-binary=':all:'
install.upgrade-strategy='only-if-needed'
list.find-links='\nE:\\zuInst-erl\\PyPIP'
list.format='columns'
list.index-url=''
list.no-index='false'
search.find-links='\nE:\\zuInst-erl\\PyPIP'
search.index-url=''
search.no-index='false'
wheel.find-links='\nE:\\zuInst.pip\\download'
wheel.wheel-dir='E:\\zuInst.pip\\wheel'

C:\>py -m pip download wheel
Looking in indexes: -
Collecting wheel
  Url '-/wheel/' is ignored. It is either a non-existing path or lacks a specific scheme.
  Could not find a version that satisfies the requirement wheel (from versions:)
No matching distribution found for wheel
Url '-/pip/' is ignored. It is either a non-existing path or lacks a specific scheme.

C:\>py -m pip list
Package    Version
---------- ----------
numpy      1.15.4+mkl
Pillow     5.4.1
pip        18.1
pywin32    224
scipy      1.2.0
setuptools 40.6.2
Url '-/pip/' is ignored. It is either a non-existing path or lacks a specific scheme.

Here in contrast a version that works (pip 9.0.3, Python 2.7.15, Windows 7, same pip.ini as above):

C:\>py -2 -m pip download wheel
Collecting wheel
  Downloading https://files.pythonhosted.org/packages/ff/47/1dfa4795e24fd6f93d5d58602dd716c3f101cfd5a77cd9acbe519b44a0a9/wheel-0.32.3-py2.py3-none-any.whl
  Saved e:\zuinst.pip\download\wheel-0.32.3-py2.py3-none-any.whl
Successfully downloaded wheel
You are using pip version 9.0.3, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\>py -2 -m pip list
Package    Version
---------- -------
ipython    0.13
numpy      1.9.2
oletools   0.50
PIL        1.1.7
pip        9.0.3
py2exe     0.6.9
pyreadline 2.1
pywin32    224
setuptools 39.0.1
wheel      0.29.0
You are using pip version 9.0.3, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
xavfernandezcommented, Apr 1, 2020

IMO it’d be worthwhile to rename pip search --index to match other commands. @rseuchter would you mind opening a separate issue to discuss this?

cf #589 & #395 for context.

1reaction
rseuchtercommented, Apr 1, 2020

Yeah, later when I find the time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Use an Alternate PyPI (Package Index) - mothergeo
Use the extra-index-url option to tell pip where your alternate package index lives. If your package index doesn't support SSL, you can supress...
Read more >
Using an extra python package index url with setup.py
Is there a way to use an extra Python package index (ala pip --extra-index-url pypi.example.org mypackage ) with setup.py so that running python...
Read more >
pypiserver · PyPI
Always specifying the the pypi url on the command line is a bit cumbersome. Since pypiserver redirects pip/easy_install to the pypi.org index if...
Read more >
PyPI Repositories - JFrog - JFrog Documentation
For a PyPI repository hosted on another Artifactory instance: Set the ... The index URL can be specified in the first line of...
Read more >
Changelog - pip documentation v22.3.1
Fix --no-index when --index-url or --extra-index-url is specified inside a requirements ... Add option to install and uninstall commands to opt-out from ...
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