Comments (4)
FYI, if I uninstall pyenv-virtualenv then pyenv works again. No other changes were made to my .bash_profile, so something in pyenv-virtualenv seems to cause pyenv to ignore the local version that was set.
test2.7 >> pyenv local
2.7.6
test2.7 >> python
Python 2.7.6 (default, Jan 24 2014, 18:58:50)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
from pyenv-virtualenv.
I couldn't reproduced the behaviour. Because the pyenv-virtualenv
depends on pyenv's shims mechanism, it will never touch the $PATH
setting of user's shell.
It seems that the $PATH
configuration of your shell is confused. Please review your $PATH
setting and inspect the outputs from which python
and pyenv which python
.
from pyenv-virtualenv.
I'm really not sure how to resolve this to get it to work. pyenv is great, especially since I'm used to rbenv, but I'm having a tremendously hard time trying to get it to work with virtualenvs. Having separate environments in Ruby is so easy compared to Python - especially for someone new to how python works with virtual envs. I've spent a solid week on this and my boss is ready to kill me.
I've ultimately had to uninstall pyenv-virtualwrapper to get pyenv to work. Now I'm trying to use pyenv with the standard virtualenvwrapper - but I am still having issues with some of the settings, possibly because pyenv is using a non-standard setup (I guess).
This is the current error:
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenv has been installed for
VIRTUALENVWRAPPER_PYTHON=“/usr/bin/python” and that PATH is
set properly.
How can I determine what the value for VIRTUALENVWRAPPER_PYTHON
should be?
How can I configure virtualenvwrapper to work with pyenv?
I have been looking on tons of sites for hours and days and have been unable to find something that is clear on how to get this to work.
If I check which python is used I get the following results...
bin [master] >> which python
/usr/bin/python
bin [master] >> pyenv which python
/Users/insomniac/.pyenv/versions/2.7.6/bin/python
my .bash_profile has the following settings:
# Set PYTHONPATH
export PYTHONPATH=/Users/insomniac/Repo/legion/tools/python/:Users/insomniac/Repo/pnp/python:/Volumes/legion/tools/python:/Volumes/legion/tools/python/site-packages:$PYTHONPATH
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:sbin:$PATH
# virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Repo
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
# Load virtualenvwrapper after paths are set
if [[ -s /usr/local/bin/virtualenvwrapper.sh ]]; then
source /usr/local/bin/virtualenvwrapper.sh
fi
Please help if you can.
Thanks,
C.
from pyenv-virtualenv.
OK, I think I found the problem, which was pretty simple, but could of been documented more clearly (for beginners).
You have to set the python version for a project with pyenv
first.
pyenv local 3.3.3
Then you can use pyenv virutalenv
to create the virtual environment.
pyenv virutalenv foo
Now things appear in sync:
>> pyenv local
3.3.3
>> pyenv virtualenvs
foo (created from /Users/insomniac/.pyenv/versions/3.3.3)
>> which python
/Users/insomniac/.pyenv/shims/python
>> pyenv which python
/Users/insomniac/.pyenv/versions/3.3.3/bin/python
from pyenv-virtualenv.
Related Issues (20)
- Activate virtualenv: Example
- `pyenv virtualenvs` failure on macOS Big Sur HOT 1
- Something like virtualenv-clone HOT 7
- [FR] Local virtualvenvs + registering them / using them through `.python-version` HOT 14
- Force creating venv with same name doesn't update Python version
- Set CONDA_PROMPT_MODIFIER env var when activating conda environment HOT 5
- Env's name disappears from the prompt when spawning a subshell HOT 6
- python3-config (along with other tools) does not respect the version virtualenv hook on HOT 6
- pyenv deactivate doesn't deactivate env HOT 1
- pyenv virtualenv does not correctly link the c++ libraries associated to the python package
- New release? HOT 3
- Latest version HOT 1
- Incorrect version reported by `pyenv virtualenv --version` HOT 1
- Cannot create new virtualenv with "system" Python if it's 3.11+ HOT 1
- Hooks for virtualenv-delete HOT 1
- Hooks don't work under /usr/share/pyenv/plugins
- Virtualenv not isolated HOT 1
- Don't use `.python-version` for auto-activation HOT 3
- "tox: command not found" despite tox being present in the active environment HOT 1
- Unable to use `venv/bin/activate` when the virtual environment of pyenv-virtualenv is set. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyenv-virtualenv.