How can I install packages using pip according to a requirements.txt file?
Here’s the issue:
I have a requirements.txt
file with the following contents:
BeautifulSoup==3.2.0
Django==1.3
Fabric==1.2.0
Jinja2==2.5.5
PyYAML==3.09
Pygments==1.4
SQLAlchemy==0.7.1
South==0.7.3
amqplib==0.6.1
anyjson==0.3
...
I also have a local archive directory that contains all these packages plus additional ones.
I created a new virtual environment using:
bin/virtualenv testing
After activating the virtual environment, I attempted to install the packages from requirements.txt
using my local archive directory:
source bin/activate
pip install -r /path/to/requirements.txt -f file:///path/to/archive/
The output seemed to indicate that the installation was successful:
Downloading/unpacking Fabric==1.2.0 (from -r ../testing/requirements.txt (line 3))
Running setup.py egg_info for package Fabric
warning: no previously-included files matching '*' found under directory 'docs/_build'
warning: no files found matching 'fabfile.py'
Downloading/unpacking South==0.7.3 (from -r ../testing/requirements.txt (line 8))
Running setup.py egg_info for package South
....
However, upon checking later, I found that none of the packages were installed properly. I cannot import the packages, and they are not present in the site-packages
directory of my virtual environment. What went wrong?