PIPENV_VENV_IN_PROJECT in .env file ignored during initial pipenv shell command
See original GitHub issuePut the following line into the local .env file:
export PIPENV_VENV_IN_PROJECT=1
Running pipenv shell
creates a .venv in ~/.local...
, not the .venv
directory as expected.
Running pipenv sync
then creates the local .venv
file, but the Python interpreter is not there.
I’ve done some debugging and found that when running the initial shell command, the os.environ
commands in environment.py
are run prior to core.load_dot_env
. The Python globals containing the environment variables are not reloaded after the .env
file is loaded.
Is there a reason the .env file is not loaded earlier?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Advanced Usage of Pipenv - Read the Docs
This causes Pipenv to ignore changes to the Pipfile and (more importantly) prevents it from adding the current environment to Pipfile. lock ....
Read more >Manage the path to the venv for pipenv - Stack Overflow
Yes, it is possible by setting environment variables. You can set a path for virtual environments via the WORKON_HOME .
Read more >Pipenv: Practical Guide to the New Python Packaging Tool
Pipenv is a tool that creates and manages a virtual environment for your projects and adds or removes packages from your Pipfile as...
Read more >Pipenv Virtual Environments for Python - Blog Post
Below is a guide on how to activate your first pipenv . ... pipenv --python 3.7. Note: that python3 --V is a command...
Read more >Python Virtual Environment with pipenv - YouTube
With help of Python pipenv it's very easy to create Python virtual environments. Also it helps to manage all dependency packages of your ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Have a look at tools like
direnv
if you want this to operate like this as well.env
is only read forshell
andrun
. This is a design decision made early on, and likely won’t be changed without substential reasoning and convicing arguments (I know because I failed before). Sorry about this.