requirements.txt

Installing requirements.txt in a venv inside VSCode

Installing requirements.txt in a venv inside VSCode Question: Apart from typing out commands – is there a good way to install requirements.txt inside VSCode. I have a workspace with 2 folders containing different Python projects added – each has it’s own virtual environment. I would like to run a task to execute and install the …

Total answers: 1

Is requirements.txt still needed when using pyproject.toml?

Is requirements.txt still needed when using pyproject.toml? Question: Since mid 2022 it is now possible to get rid of setup.py, setup.cfg in favor of pyproject.toml. Editable installs work with recent versions of setuptools and pip and even the official packaging tutorial switched away from setup.py to pyproject.toml. However, documentation regarding requirements.txt seems to be have …

Total answers: 3

pip install with extra index url to requirements.txt

pip install with extra index url to requirements.txt Question: I have following install comand for a package: pip3 install torch torchvision torchaudio –extra-index-url https://download.pytorch.org/whl/cu116 and would need to add this to my requirements.txt file. I have done it by adding this to the end of the file: -i https://download.pytorch.org/whl/cu116 torch torchvision torchaudio after all the …

Total answers: 1

pip installing environment.yml as if it's a requirements.txt

pip installing environment.yml as if it's a requirements.txt Question: I have an environment.yml file, but don’t want to use Conda: name: foo channels: – defaults dependencies: – matplotlib=2.2.2 Is it possible to have pip install the dependencies inside an environment.yml file as if it’s a requirements.txt file? I tried pip install -r environment.yml and it …

Total answers: 4

pip-compile for setup.py's install_requires instead of requirements.txt

pip-compile for setup.py's install_requires instead of requirements.txt Question: pip-compile enables traceability in pinning requirements inside a requirements.txt with an external requirements.in. I really like this My question is, can we somehow do the same, but for an install_requires list inside setup.py? In other words, if I don’t have a requirements.txt but instead just a setup.py, …

Total answers: 1

How to create a requirements.txt file in Django project?

How to create a requirements.txt file in Django project? Question: I have been trying to create a requirements.txt file from the Pycharm terminal but it is adding all unnecessary packages as well. What should I do to show only used packages? Thanks, requirements.txt: aiohttp==3.7.3 aioredis==1.3.1 alabaster==0.7.12 anaconda-client==1.7.2 anaconda-navigator==1.9.12 anaconda-project==0.8.3 appdirs==1.4.4 appnope==0.1.0 argh==0.26.2 asgiref==3.3.1 asn1crypto==1.3.0 astroid==2.4.2 …

Total answers: 4

No module named pipreqs.__main__; 'pipreqs' is a package and cannot be directly executed

No module named pipreqs.__main__; 'pipreqs' is a package and cannot be directly executed Question: I am trying to use pipreqs module to generate requirements text. But pipreqs is generating following error. No module named pipreqs.__main__; ‘pipreqs’ is a package and cannot be directly executed I’m using Visual Studio Code, and trying to use pipreqs by …

Total answers: 1

Creating requirements.txt in pip compatible format in a conda virtual environment

Creating requirements.txt in pip compatible format in a conda virtual environment Question: I have created a conda virtual environment on a Windows 10 PC to work on a project. To install the required packages and dependencies, I am using conda install <package> instead of pip install <package> as per the best practices mentioned in https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#using-pip-in-an-environment …

Total answers: 3

Install local wheel file with requirements.txt

Install local wheel file with requirements.txt Question: Have a local package ABC-0.0.2-py3-none-any.whl. I want to install it in the different project through requrements.txt. e.g. requirements.txt ABC==0.0.2 Flask==1.1.2 flask-restplus==0.13.0 gunicorn==20.0.4 Is it possible to install the ABC package this way. ABC-0.0.2-py3-none-any.whl is included in source code. I had to pip install ABC-0.0.2-py3-none-any.whl separately. Asked By: Rajan …

Total answers: 3