Questions tagged [requirements.txt]

requirements.txt is the standard name for a requirements file for Python package installation program `pip`. It's used in the command like `pip install -r requirements.txt`.

requirements.txt is the standard name for a requirements file for Python package installation program pip. The file is list of items to be installed like so:

pip install -r requirements.txt

The items in the file can be package names (will be installed from Python Package Index or any other index configured in ~/.pypirc), package files or URLs to VCS.

For more information on requirements files see pip user guide.

635 questions
5
votes
2 answers

How to list (freeze) only the Python modules imported/required by my project

I want to generate the requirements.txt file. When using pip freeze on MacOS, I get a long list of…
Gabriel Petrovay
  • 20,476
  • 22
  • 97
  • 168
5
votes
2 answers

Why would you create a requirements.txt file in a virtual environment in Python?

I downloaded a Python project and it contains both a virtual environment and a requirements.txt file. Why would you need both? As far as I know, virtual environments already contain the required modules. Any idea when and why this combination would…
Engo
  • 899
  • 3
  • 19
  • 49
5
votes
1 answer

ImportError: No module named base in html5lib

I suddenly can't start may Django server any more, running check: python manage.py check shows to the following error: apps.populate(settings.INSTALLED_APPS) File…
Aymen Gasmi
  • 474
  • 4
  • 13
5
votes
1 answer

Azure deployment not installing Python packages listed in requirements.txt

This is my first experience deploying a Flask web app to Azure. I followed this tutorial. The default demo app they have works fine for me. Afterwards, I pushed my Flask app via git. The log shows deployment was successful. However, when I browse…
user3522242
  • 85
  • 2
  • 6
5
votes
2 answers

Specify 'pip' version in requirements.txt

I develop a Python/Django application, which runs from a virtual environment (created by virtualenv). When the virtual environment is created, the global version of pip is copied to the newly created environment by default, which might be quite…
tonyo
  • 433
  • 7
  • 14
5
votes
2 answers

Global and local python installations, and accidentally running a requirements file outside of virtualenv

So I was googling an event where pip required sudo privileges,and I came across the following two threads What are the risks of running 'sudo pip'? and Is it acceptable & safe to run pip install under sudo? The first thread talks about the…
Kirbies
  • 777
  • 1
  • 10
  • 17
5
votes
3 answers

Programmatically generate requirements.txt file

I'm trying to generate a requirements.txt file programatically. This way I can diff it against a second .txt file. So far I've tried the following, but they only output the requirements to console (No .txt file is generated). So far I've tried …
K Engle
  • 1,322
  • 2
  • 11
  • 23
4
votes
2 answers

Building wheel for gevent (pyproject.toml) did not run successfully

I got an error when install dependencies for my project! OS : WinDow 11 Python: 3.10.4 (64bit) Pip: 22.1.2 Building wheel for django-admin-sortable2 (setup.py) ... done Created wheel for django-admin-sortable2:…
Kev
  • 315
  • 1
  • 4
  • 11
4
votes
4 answers

How to deal with Python's requirements.txt while using a Docker development environment?

Suppose I wrote a docker-compose.dev.yml file to set the development environment of a Flask project (web application) using Docker. In docker-compose.dev.yml I have set up two services, one for the database and one to run the Flask application in…
Tedpac
  • 862
  • 6
  • 14
4
votes
1 answer

Pip Install Error Could Not Find A Version(although version is availiable)

I am getting a strange error when running pip install -r requirements.txt which is Flask==0.11 flask-mongoengine==0.8.2 Flask-Script==2.0.6 Flask-WTF==0.14.3 jsonschema==2.5.1 mongoengine==0.11 py-bcrypt==0.4 pymongo==3.4.0 python version is 3.8.6,…
Anatoly Bugakov
  • 772
  • 1
  • 7
  • 18
4
votes
2 answers

Meeting a pip requirement using an alternative module

I'm trying to install a python module, 'pyAudioProcessing' (https://github.com/jsingh811/pyAudioProcessing) on my Linux Mint distribution, and one of the items in requirements.txt is causing issues: python-magic-bin==0.4.14. When I run pip3 install…
Simeon
  • 223
  • 1
  • 7
4
votes
3 answers

What does the value after `=` specify in requrements.txt file?

Following is an excerpt from the requirements.txt file. I understand the value after == specifies the version. What does the value after = specify? Can I exclude it? icu==67.1=he1b5a44_0 lz4-c==1.9.2=he6710b0_1 xz==5.2.5=h7b6447c_0 qt==4.8.7=2
Aravind Yarram
  • 78,777
  • 46
  • 231
  • 327
4
votes
1 answer

How to install requirements.txt file from a python module?

I am looking for an alternative to pip install -r requirements.txt which can be used to install packages from a python module. I have used subprocess.check_call([sys.executable, "-m", "pip", "install", package]) for installing a package, however,…
Karen
  • 401
  • 7
  • 15
4
votes
1 answer

Creating a requirements.txt file

When uploading to GitHub one would want to include a requirements.txt file. I have created a virtual environment and so pip3 freeze lists only the packages I installed during the project development. However I had also installed pylint (suggested by…
Eeshaan
  • 1,557
  • 1
  • 10
  • 22
4
votes
2 answers

Cython "ModuleNotFoundError" even though it was just installed via requirements.txt while building docker image

Installing packages when building a docker image via the requirements.txt. In the Dockerfile it reads COPY requirements.txt /app/requirements.txt RUN pip3 install -r /app/requirements.txt In the requirements.txt I put down deploy token for…
cheesus
  • 1,111
  • 1
  • 16
  • 44