Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore the dependencies of a specific package when installing it with pipenv?

Tags:

python

pipenv

Is there a possibility to install a python package with pipenv without also installing the dependencies?

I'm looking for an analogue of pip install package_name --no-dependencies for the Pipfile. I already tried to specify with a marker but it raises an exception.

[packages]
"psycopg2-binary" = "*"
"aiopg"={version = "*", markers="--no-dependencies"}
like image 678
Oleksandr Dashkov Avatar asked Nov 17 '25 11:11

Oleksandr Dashkov


1 Answers

Currently, pipenv does not support this. One workaround adds a script like the following to the end of Pipfile:

[scripts]
install  = "sh -c 'pipenv install ; pip install --no-deps aiopg'"

With this script, calling pipenv run install installs all dependencies from the [packages] section, including aiopg but excluding its dependencies.

like image 101
Bryant Avatar answered Nov 20 '25 03:11

Bryant