HBNetwork / python-decouple

Strict separation of config from code.
MIT License
2.79k stars 192 forks source link

Issues with installation using pipenv #169

Closed Sarumyan closed 9 months ago

Sarumyan commented 10 months ago

There is a problem with installing python-decouple using pipenv.

When I run pipenv install python-decouple and then try from decouple import config, I get an error: ImportError: cannot import name 'config' from 'decouple' (/home/dmor/.local/share/virtualenvs/decouple_tests-fWNCkI-j/lib/python3.10/site-packages/decouple/__init__.py) And pip freeze shows me:

decouple==0.0.7
python-decouple==3.8

And if I run instead pip install python-decouple everything works fine. And pip freeze shows:

python-decouple==3.8

So basically pipenv also installs decouple itself which breaks the python-decouple. As pipenv is a quite popular tool, I think this is the issue worth addressing.

henriquebastos commented 9 months ago

decouple and python-decouple are 2 different libraries. I don't have much experience with pipenv, but python-decouple works well with pip and poetry. I am not sure how to workaround this without changing the package name, which does not seem a good option right now.

denis-boost commented 9 months ago

decouple and python-decouple are 2 different libraries.

That is the problem: when python-decouple is installed with pipenv on a clean environment, decouple is installed automatically, not just python-decouple.