sinewalker / dotfiles

OS X / Linux dotfiles.
MIT License
0 stars 1 forks source link

Python virtualenv wrapper fns - virtualenv vs venv #49

Open sinewalker opened 6 years ago

sinewalker commented 6 years ago

I'm discovering as I play with Jupyter & matplotlib on a macOS machine, that virtualenv is suboptimal, because it copies Python binaries, which then are no longer macOS Frameworks, and so matplotlib doesn't work when called from inside another application such as a jupyter-enabled virtualenv.

Also tools like MS-VS Code seem to advocate the Python standard virtual environment system (since 3.6) of venv.

Also, I've been using "venv" in my bash fns as a short-hand for "virtualenv" (much like pipenv does, apparently) and so that'll be a bit confusing.

I need to rethink how / if my mkvenv, lsvenv, rmvenv fns work with virtualenv and venv; maybe switch them to venv and refactor the virtualenv-aware fns to mkpyv or something?

See:

sinewalker commented 6 years ago

More points to note:

sinewalker commented 5 years ago

More notes:

This answer to the SO question above recommends venv over everything.

A work colleague recommends pyenv (yet another "only one obvious way to do it"). pyenv manages multiple Pythons much like rbenv/Node.js (forked from rbenv) and it has a plugin for virtualenv, called pyenv-virtualenv, which automatically will use python -m venv when available, and virtualenv is unavailable.

It also supports Anaconda/Miniconda.

Perhaps I should abandon my wrapperns or switch them to this?

sinewalker commented 5 years ago

more to read: