Sign Up

Sign In

Forget Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask question.

How to use requirements.txt to install all dependencies in a python project

  • 0

I am new to python. Recently I got a project written by python and it requires some installation. I run below command to install but got an error.

# pip install requirements.txt 
Collecting requirements.txt
  Could not find a version that satisfies the requirement requirements.txt (from versions: )
No matching distribution found for requirements.txt

I searched on google and found this link http://stackoverflow.com/questions/28167987/python-pip-trouble-installing-from-requirements-txt but I don’t quite understand what the solution in that post.

Below is my requirements.txt file:

# cat requirements.txt 
ordereddict==1.1
argparse==1.2.1
python-dateutil==2.2
matplotlib==1.3.1
nose==1.3.0
numpy==1.8.0
pymongo==3.3.0
psutil>=2.0

Is there a easy way to install all required dependencies in this python project?

Click to rate this post!
[Total: 0 Average: 0]
Share This Post
Share
  1. If you are using Linux OS:

    1. Remove matplotlib==1.3.1 from requirements.txt
    2. Try to install with sudo apt-get install python-matplotlib
    3. Run pip install -r requirements.txt (Python 2), or pip3 install -r requirements.txt (Python 3)
    4. pip freeze > requirements.txt

    If you are using Windows OS:

    1. python -m pip install -U pip setuptools
    2. python -m pip install matplotlib
    • 0
Leave an answer

Leave an answer

Browse

close