Currently Pipenv can be used in a directory to check whether we have a corresponding pipenv environment or not (e.g. pipenv --py).
Is there a similar API to determine whether a given interpreter is a pipenv?
From within a Pipenv shell, you can run 'pip -V' which will show you the path to the pip version you're using -- which will include the virtual environment path, and the Python interpreter.
For example:
pipenv shell
Produces:
Spawning environment shell (/bin/bash). Use 'exit' to leave.
~/$ . /home/<username>/.local/share/virtualenvs/projects-6W-pCI0A/bin/activate
Then, from within the Pipenv shell, running
pip -V
Gives:
pip 10.0.1 from /home/<username>/.local/share/virtualenvs/projects-6W-pCI0A/local/lib/python2.7/site-packages/pip (python 2.7)
Of course, your username would replace <username>, and your current working directory would replace mine (projects)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With