I have a project for which I'd now like to use pipenv.
I want to symlink this from my main bin directory, so I can run it from another directory (where it interacts with local files) but nevertheless run it in the pipenv with the appropriately installed files.
Can I do something like
pipenv run python /PATH/TO/MY/CODE/foo.py localfile.conf
Or is that not going to pick up the pipenv defined in /PATH/TO/MY/CODE/Pipenv ?
You generally don't need to know the path to the virtual environment Pipenv creates. To activate the environment, just navigate to your project directory and use pipenv shell to launch a new shell session or use pipenv run <command> to run a command directly.
In the Settings/Preferences dialog ( Ctrl+Alt+S ), navigate to Tools | Python Integrated Tools, and type the target path in the Path ot Pipenv executable field. After the preparation steps are done, you can use pipenv to create a virtual environment for new or existing projects.
How do I install Pipenv on Windows 10? Install pipenv by running the following command: $ pip install –user pipenv. For your convenience, you might add the user base's binary directory to your PATH environmental variable.
Discover the proper executable path as described in the pipenv installation procedure and enter the target string in the Pipenv executable field, for example: C:\Users\jetbrains\AppData\Roaming\Python\Python37\Scripts\pipenv.exe (Windows) or /Users/jetbrains/. local/bin/pipenv (macOS).
Not sure if this was relevant with the version of pipenv you used in 2018, but as of current versions you can use the PIPENV_PIPFILE environment variable. You will end up with a wrapper shell script that looks something like:
export PIPENV_PIPFILE=/my/project/dir/Pipfile
exec pipenv run command ...
(Answering even though I'm half a year late because this was the first relevant search result, so I can find it again next time.)
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