Reputation: 684
I executed this:
$ pip download virtualenv
Collecting virtualenv
Using cached virtualenv-20.0.31-py2.py3-none-any.whl (4.9 MB)
Saved d:\test\gits\virtualenv-20.0.31-py2.py3-none-any.whl
Collecting appdirs<2,>=1.4.3
Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Saved d:\test\gits\appdirs-1.4.4-py2.py3-none-any.whl
Collecting six<2,>=1.9.0
Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
Saved d:\test\gits\six-1.15.0-py2.py3-none-any.whl
Collecting distlib<1,>=0.3.1
Using cached distlib-0.3.1-py2.py3-none-any.whl (335 kB)
Saved d:\test\gits\distlib-0.3.1-py2.py3-none-any.whl
Collecting filelock<4,>=3.0.0
Using cached filelock-3.0.12-py3-none-any.whl (7.6 kB)
Saved d:\test\gits\filelock-3.0.12-py3-none-any.whl
Successfully downloaded virtualenv appdirs six distlib filelock
Although I attempted to download one package, I got these wheel files:
appdirs-1.4.4-py2.py3-none-any.whl
six-1.15.0-py2.py3-none-any.whl
distlib-0.3.1-py2.py3-none-any.whl
virtualenv-20.0.31-py2.py3-none-any.whl
filelock-3.0.12-py3-none-any.whl
Now my questions are:
Upvotes: 1
Views: 1305
Reputation: 94445
Those additional wheels are dependencies, including recursive (transitive) dependencies, i.e. dependencies of dependencies.
pip install --find-links /path/to/download/dir/ virtualenv-20.0.31-py2.py3-none-any.whl
pip
tries to download dependencies from the configured index server, default is PyPI. Failed to download any dependency pip
fails to install anything. It exits with an error message and an error code.Upvotes: 1
Reputation: 362617
1 . Using pip download
also downloads the dependencies, and those extra files that you saw are precisely the deps of the virtualenv distribution:
$ johnnydep virtualenv
name summary
---------------------- -------------------------------------------------------------------------------------------------
virtualenv Virtual Python Environment builder
├── appdirs<2,>=1.4.3 A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".
├── distlib<1,>=0.3.1 Distribution utilities
├── filelock<4,>=3.0.0 A platform independent file lock.
└── six<2,>=1.9.0 Python 2 and 3 compatibility utilities
If you only want the package itself without dependencies, use:
pip download --no-deps virtualenv
2 . You can install a wheel file directly with pip
pip install ./virtualenv-20.0.31-py2.py3-none-any.whl
3 . If you install with --no-deps
the app won't work properly, probably it will crash with some ImportError
due to missing dependencies.
$ pip install -q --no-deps virtualenv
$ virtualenv .venv
Traceback (most recent call last):
...
ModuleNotFoundError: No module named 'appdirs'
Otherwise it will just collect and install the dependencies from PyPI, or whatever index your pip is configured at - see pip config list
.
Upvotes: 1