Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
22 views
in Python by (47.6k points)

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

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 an easy way to install all the required dependencies in this python project?

3 Answers

0 votes
by (106k points)
edited by

If you are using Linux as your OS then you can follow the below-mentioned steps:-

  1. Firstly, remove matplotlib==1.3.1 from requirements.txt

  2. After that try to install it 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 as your OS then use the following steps:-

  1. python -m pip install -U pip setuptools

  2. python -m pip install matplotlib

To know more about this you can have a look at the following video tutorial:-

To Learn what is python then visit this Data Science with Python Course.

Wanna become an Expert in python? Come & join our Python Certification course

0 votes
by (37.3k points)

The below code will help you to install all dependencies in a Python project:

$ pip install -r requirements.txt --no-index --find-links file:///tmp/packages

0 votes
by (1.9k points)

This should look like you are attempting to install packages in requirements.txt but you write down the command. What you instead do is pip install -r requirements.txt 

Explanation:

-r Option: The -r flag instructs pip that you're providing a requirements file. So it will figure out that it needs to step into a directory and check for contents of requirements.txt. 

Path: Run that command in the same directory of where the requirements.txt has been dropped, or fully qualified Open terminal or command prompt. Navigate to the directory which you have your file, either open the directory where that is located OR use its path Paste this, 

pip install -r requirements.txt

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...