-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip 1.3.1: pip no longer walks dirs in file:// indexes #846
Comments
I'm seeing this work for 1.3.1, and we have tests that work against local file:// indexes in our test suite.
can you run the examples again with |
I assume the "Cannot fetch index base URL ..." message comes from the fact that no "index.html" file exists (but I haven't followed the call-chain in the debugger). But that was no problem in the past because the packages were still discovered. MY RESUMEE from the debug dumps below: OK, here are the dumps. $ pip install --index-url=file:///Users/xxx/.pip/downloads/simple -v -v -U argparse
Getting page file:///Users/xxx/.pip/downloads/simple/argparse/
file: URL is directory, getting file:///Users/xxx/.pip/downloads/simple/argparse/index.html
Could not fetch URL file:///Users/xxx/.pip/downloads/simple/argparse/: <urlopen error [Errno 2] No such file or directory: '/Users/xxx/.pip/downloads/simple/argparse/index.html'>
Will skip URL file:///Users/xxx/.pip/downloads/simple/argparse/ when looking for download links for argparse in ./lib/python2.6/site-packages
Getting page file:///Users/xxx/.pip/downloads/simple/
file: URL is directory, getting file:///Users/xxx/.pip/downloads/simple/index.html
Could not fetch URL file:///Users/xxx/.pip/downloads/simple/: <urlopen error [Errno 2] No such file or directory: '/Users/xxx/.pip/downloads/simple/index.html'>
Will skip URL file:///Users/xxx/.pip/downloads/simple/ when looking for download links for argparse in ./lib/python2.6/site-packages
Cannot fetch index base URL file:///Users/xxx/.pip/downloads/simple/
URLs to search for versions for argparse in ./lib/python2.6/site-packages:
* file:///Users/xxx/.pip/downloads/simple/argparse/
Getting page file:///Users/xxx/.pip/downloads/simple/argparse/
file: URL is directory, getting file:///Users/xxx/.pip/downloads/simple/argparse/index.html
Could not fetch URL file:///Users/xxx/.pip/downloads/simple/argparse/: <urlopen error [Errno 2] No such file or directory: '/Users/xxx/.pip/downloads/simple/argparse/index.html'>
Will skip URL file:///Users/xxx/.pip/downloads/simple/argparse/ when looking for download links for argparse in ./lib/python2.6/site-packages
Could not find any downloads that satisfy the requirement argparse in ./lib/python2.6/site-packages
Downloading/unpacking argparse
No distributions at all found for argparse in ./lib/python2.6/site-packages
Exception information:
Traceback (most recent call last):
File "/Users/xxx/zzz/.tox/py26/lib/python2.6/site-packages/pip-1.3.1-py2.6.egg/pip/basecommand.py", line 139, in main
status = self.run(options, args)
File "/Users/xxx/zzz/.tox/py26/lib/python2.6/site-packages/pip-1.3.1-py2.6.egg/pip/commands/install.py", line 266, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Users/xxx/zzz/.tox/py26/lib/python2.6/site-packages/pip-1.3.1-py2.6.egg/pip/req.py", line 1025, in prepare_files
raise not_found
DistributionNotFound: No distributions at all found for argparse in ./lib/python2.6/site-packages
Storing complete log in /Users/xxx/.pip/pip.log Now the dump for pip-1.2.1: $ pip install --index-url=file:///Users/xxx/.pip/downloads/simple -v -v -U argparse
Getting page file:///Users/xxx/.pip/downloads/simple/argparse
file: URL is directory, getting file:///Users/xxx/.pip/downloads/simple/argparse/index.html
Could not fetch URL file:///Users/xxx/.pip/downloads/simple/argparse: <urlopen error [Errno 2] No such file or directory: '/Users/xxx/.pip/downloads/simple/argparse/index.html'>
Will skip URL file:///Users/xxx/.pip/downloads/simple/argparse when looking for download links for argparse in ./lib/python2.6/site-packages
Getting page file:///Users/xxx/.pip/downloads/simple/
file: URL is directory, getting file:///Users/xxx/.pip/downloads/simple/index.html
Could not fetch URL file:///Users/xxx/.pip/downloads/simple/: <urlopen error [Errno 2] No such file or directory: '/Users/xxx/.pip/downloads/simple/index.html'>
Will skip URL file:///Users/xxx/.pip/downloads/simple/ when looking for download links for argparse in ./lib/python2.6/site-packages
Cannot fetch index base URL file:///Users/xxx/.pip/downloads/simple/
URLs to search for versions for argparse in ./lib/python2.6/site-packages:
Found link file:///Users/xxx/.pip/downloads/simple/argparse/argparse-1.2.1.tar.gz, version: 1.2.1
Local files found: /Users/xxx/.pip/downloads/simple/argparse/argparse-1.2.1.tar.gz
Using version 1.2.1 (newest of versions: 1.2.1, 1.2.1)
Unpacking /Users/xxx/.pip/downloads/simple/argparse/argparse-1.2.1.tar.gz
Running setup.py egg_info for package argparse
running egg_info
creating pip-egg-info/argparse.egg-info
writing pip-egg-info/argparse.egg-info/PKG-INFO
...
Source in ./build/argparse has version 1.2.1, which satisfies requirement argparse from file:///Users/xxx/.pip/downloads/simple/argparse/argparse-1.2.1.tar.gz
Installing collected packages: argparse
Found existing installation: argparse 1.2.1
Uninstalling argparse:
Removing file or directory /Users/xxx/zzz/.tox/py26/lib/python2.6/site-packages/argparse-1.2.1-py2.6.egg-info
Removing file or directory /Users/xxx/zzz/.tox/py26/lib/python2.6/site-packages/argparse.py
Removing file or directory /Users/xxx/zzz/.tox/py26/lib/python2.6/site-packages/argparse.pyc
Successfully uninstalled argparse
Running setup.py install for argparse
Running command /Users/xxx/zzz/.tox/py26/bin/python2.6 -c "import setuptools;__file__='/Users/xxx/zzz/.tox/py26/build/argparse/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/76/91sp8l1d1xq42s1h9vgmtzq00000gn/T/pip-GcNifK-record/install-record.txt --single-version-externally-managed --install-headers /Users/xxx/zzz/.tox/py26/bin/../include/site/python2.6
running install
running build
...
Copying argparse.egg-info to /Users/xxx/zzz/.tox/py26/lib/python2.6/site-packages/argparse-1.2.1-py2.6.egg-info
running install_scripts
writing list of installed files to '/var/folders/76/91sp8l1d1xq42s1h9vgmtzq00000gn/T/pip-GcNifK-record/install-record.txt'
Successfully installed argparse
Cleaning up...
Removing temporary dir /Users/xxx/zzz/.tox/py26/build... |
that section of the code did get refactored. @pfmoore , your opinion here? note that you can use |
Without having looked at the details, I agree that 1.3.1 is showing correct behaviour - --index-url should point to something with the structure of a PyPI simple index (i.e., with an index.html) and --find-links should be used for a simple directory structure. Having said that, it is a regression, and I guess I could be persuaded that making up an index.html from the directory structure if one isn't present should be added for backward compatibility. But only for that reason - correct use would still be as I described above. |
I think it depends on the URL schema. With the file:// URL schema, you have the possibility to use the directory listing as "virtual index.html" and fallback solution if no "index.html" is available. Some web servers even do just that (if this feature is not disabled) as file-browser like/FTP-like overview mode. For other URL schema, you need the "index.html" file to point you the way. Note that I am not insisting on this solution because I have a work-around (which is not nice but I can live with it). |
I'm -1 on it being based on the URL scheme, in general. That's the point of Maybe better (if anything at all is needed) would be to add a warning - if |
I'm closing as an open issue for now. |
It is very sad. You break my workflow. I want to have some kind of caching local pypi, so... after that i rename your ugly http...%2Fpackagename-version.tar.gz files to packagename-version.tar.gz and call dir2pi on ../packages So if i'll want to install requrements for project2 with partially different requirements pip may use previously downloaded packages. --find-links works only with --no-index what is unacceptable. |
@truetug if you can, try the latest pip from git and the http://www.pip-installer.org/en/latest/usage.html#pip-wheel command. It is a little different than caching sdists but it is designed to do more or less what you want. |
@truetug can't this cookbook solution work for you? |
Installing from a local, simulated index-server directory seems to be broken in pip-1.3.1 (but was working with pip-1.2.1). I am normally using this feature for tox-based testing after preparing this functionality with
pip install --download=$HOME/.pip/downloads -r requirements.txt
and creating the simple directory structure w/ symlinks to the archives in the base directory.I prepare the problem with the following steps:
When I run pip-1.3.1, it fails to find the package:
When I run pip-1.2.1 on the same directory everything works fine:
The text was updated successfully, but these errors were encountered: