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
7
votes
2 answers

How do I create a pip requirements file for a tarball on my local filesystem?

Tell me if what I'm trying to do doesn't make sense. I want to create a virtual environment that, among other things, includes MySQLDb 1.2.3. This library is distributed as a gzipped tarball (.tgz) file. I want to install everything—including…
Nate Reed
  • 6,761
  • 12
  • 53
  • 67
7
votes
1 answer

`requirements.txt` dependencies, getting only high level dependencies

I have a three python projects A, B and C. Each depending on each other. How can I now "clean up" my requirements.txt that only the high level dependencies that are required at this "level" are there. Example A requirements: boto3==1.2.4 B…
lony
  • 6,733
  • 11
  • 60
  • 92
7
votes
2 answers

Replacing dependency with custom forks using pip

I am building an app that uses photologue and a few other packages that have photologue as a dependency (e.g., cmsplugin-photologue). However, I need to use a modified version of photologue hosted on github. All this will then be deployed on Heroku,…
Michael Mauderer
  • 3,777
  • 1
  • 22
  • 49
7
votes
2 answers

Pip requirements outputting global packages

I have a Virtual env for my django project, but when I hit pip freeze, I get what must be a global site package list, includes too many packages, like ubuntu packages and so much irrelevant stuff. This happens whether virtualenv is active or not. My…
KindOfGuy
  • 3,081
  • 5
  • 31
  • 47
6
votes
1 answer

Generic requirements.txt for TensorFlow on both Apple M1 and other devices

I have a new MacBook with the Apple M1 chipset. To install tensorflow, I follow the instructions here, i.e., installing tensorflow-metal and tensorflow-macos instead of the normal tensorflow package. While this works fine, it means that I can't run…
stefanbschneider
  • 5,460
  • 8
  • 50
  • 88
6
votes
2 answers

How to check if all packages listed in requirements.txt file are used in Python project

I have a requirements file which contains all installed packages. After big refactoring process of the project some of the listed packages are not needed anymore. The problem is I'm not sure which. Is there a way to determine which packages listed…
Marcin
  • 302
  • 3
  • 11
6
votes
1 answer

Invalid requirement

I converted the requirements of my project into a txt file with the method below. pip freeze > requirements.txt And I tried to load the generated txt file with the code below to test it, but I got the following error. How can I solve this. python…
Serkan Gün
  • 332
  • 1
  • 2
  • 12
6
votes
0 answers

Method to determine lowest required versions of python packages for a project/package?

This question concerns any package, not just Python version itself. To give some context: we are planning to build an internal package at work, which naturally will have many dependencies. To give freedom for our developers and avoid messy version…
6
votes
1 answer

Pipreqs requirements.txt is not correct

Hello I am having troubles with the pipreqs librairy in Python. It doesn't generate the correct requirements.txt file. I am using a Python Virtual Environment and the only packages I have installed are pipreqs and selenium with pip install…
Valentin Vignal
  • 6,151
  • 2
  • 33
  • 73
6
votes
3 answers

How can I download NLTK corpora via `requirements.txt` using `pip install -r requirements.txt`?

One can download NLTK corpora punkt and wordnet via the command line: python3 -m nltk.downloader punkt wordnet How can I download NLTK corpora via requirements.txt using pip install -r requirements.txt? For example one can download spacy models…
Franck Dernoncourt
  • 77,520
  • 72
  • 342
  • 501
6
votes
1 answer

How to include git branch in installing from requirements in Python?

Hi I need to install from a branch of a git repo. I want to include it on the requirements.txt so that it would install using the command pip install -r requirements.txt What I know is how to install from master branch (See git ssh entry…
Nikko
  • 1,410
  • 1
  • 22
  • 49
6
votes
2 answers

Serverless wsgi unable to import werkzeug

I'm having issues deploying my serverless application to AWS. In AWS the logs show: Unable to import module 'wsgi_handler': No module named 'werkzeug' I have explicitly specified werkzeug in my requirements.txt but it seems that when I run sls…
6
votes
1 answer

Package import named differently than in requirements.txt causes PyCharm warning

This issue does not cause an actual problem when running the code, but rather is an issue of a PyCharm warning that I would like resolved so other programmers working on the project do not have to waste time investigating. The issue is that I have…
Rocket Man
  • 61
  • 3
6
votes
1 answer

Does flake8 require any installation of my Python project's dependencies?

Is Flake8 a pure static code analyser or should I run pip install -r requirements.txt first? Or, is there any use case where Flake8 can use the installed dependencies?
Gabriel Petrovay
  • 20,476
  • 22
  • 97
  • 168
6
votes
3 answers

List only outdated pip packages mentioned in requirements file

I can use pip list -o to get a list of outdated packages but I would like to only get a list of outdated packages which are listed in a particular requirements file. Basically the equivalent of pip freeze -r requirements.txt for outdated packages. I…
phk
  • 2,002
  • 1
  • 29
  • 54