envdir not working with pyenv + virtualenvs properly? daemontools behaves correctly
See original GitHub issuehi @jezdez, it seems envdir is modifying the PATH in some unexpected way when using virtualenv. daemontools seems to be working as expected.
I have a pretty vanilla set up using pyenv and virtualenvwrapper. Nothing fancy.
setup:
$ deactivate
$ mkvirtualenv test
$ deactivate
with jezdez/envdir:
$ workon test
$ which python
/Users/johria/.virtualenvs/test/bin/python
$ envdir envs/prod which python
/Users/johria/.pyenv/versions/3.6.1/bin/python
^^^^ error is here ^^^^
uninstall jezdez/envdir, install daemontools:
$ deactivate
$ pip uninstall envdir
$ brew install daemontools
with daemontools:
$ workon test
$ which python
/Users/johria/.virtualenvs/test/bin/python
$ /usr/local/bin/envdir envs/prod which python
/Users/johria/.virtualenvs/test/bin/python
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Issues with pyenv-virtualenv: Python and PIP not changed ...
It turns out that in order to automatically activate / deactivate a venv when entering / leaving a directory the .python-version file in ......
Read more >Venv Envy (A Guide to Python Virtual Environments) - Medium
pyenv documentation; installation problems; virtual environment problems; uninstall pyenv, pyenv-virtualenv, and Homebrew; what's next ...
Read more >How to Manage your Python Projects with Pipenv and Pyenv
Many combinations of compatibility issues can be found but by having those isolated environments ... You have installed Pyenv successfully.
Read more >envdir - bytemeta
envdir not working with pyenv + virtualenvs properly? daemontools behaves correctly. jezdez. jezdez OPEN · Updated 5 years ago ...
Read more >Using pyenv and pyenv-virtualenv to install Python and create ...
To manage my Python versions I'm using using pyenv and pyenv-virtualenv and once they are correctly configured, it's very easy to install a...
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
This only occurs with pyenv. With homebrew python:
No changes to the PATH. The pyenv wrapper shim is doing the addition to the PATH!
SO. In conclusion, when envdir is installed globally via pyenv, the pyenv shim is injecting variables on to the PATH. When inside a virtualenv, the shimmed envdir ends up changing the PATH so its no longer using the virtualenv but instead its using the global python.
Workaround: Install envdir using homebrew python or inside of your virtualenv. Do not install envdir via pyenv because it will change the PATH.
@hangtwenty Just a quick side offtopic note, I am using the following shell function to export envdirs (zsh):
I call this for example via autoenv (https://github.com/Tarrasch/zsh-autoenv) for projects, or manually on certain dirs to get extra parts of some config.