mhulse / dotfizzles

Fo shizzle … Dotfizzles in the hizzay dirz!
15 stars 4 forks source link

Py 2.x virtual env stuff #145

Open mhulse opened 8 years ago

mhulse commented 8 years ago

I prefer py 3, but 2.x is still so prevalent. Might as well add this back to my dot files:

# Python virtual environments:
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true
if [[ -r /usr/local/bin/virtualenvwrapper.sh ]]; then
    source /usr/local/bin/virtualenvwrapper.sh
else
    echo "WARNING: Can't find virtualenvwrapper.sh"
fi
mhulse commented 8 years ago

Note that:

Note The pyvenv script has been deprecated as of Python 3.6 in favor of using python3 -m venv to help prevent any potential confusion as to which Python interpreter a virtual environment will be based on. --https://docs.python.org/3/library/venv.html

I'll want to update my docs on this.

Also note:

virtualenv --python=python3.5 .venv
source .venv/bin/activate

http://stackoverflow.com/a/34161114/922323

Can venv do this as well? It does not look like it. Maybe virtualenv and virtualenvwrapper are better choices?

mhulse commented 7 years ago

Warning: I was having issues with the virtualenv stuff (above) on my work computer. Need to test it out more when having both py3 and py2 installed via brew.