Live data from Hacker News

Use pew, not virtualenvwrapper, for Python virtualenvs

planspace.org

21–30 of 57 posts

Re: Use pew, not virtualenvwrapper, for Python virtualenvs

#21
post #6

As someone who is finally getting into Python development (via Django) after following tons of tutorials over several years: should I be using pew, virtualenvwrapper, or something else? This article is from 2015, how relevant is it today?

i just use activate and tmux, i'm allergic to tools having an opinion about where my venvs should live.

Re: Use pew, not virtualenvwrapper, for Python virtualenvs

#22
post #6

As someone who is finally getting into Python development (via Django) after following tons of tutorials over several years: should I be using pew, virtualenvwrapper, or something else? This article is from 2015, how relevant is it today?

Most people I've met use virtualenvwrapper. It doesn't work on other shells like fish though. However, I'd simply focus on learning how virtualenv works, and use whatever tool to manage it as you feel like.

Re: Use pew, not virtualenvwrapper, for Python virtualenvs

#23
Wow, all these comments seem to be about all the different environments to use -- new suggestions, and talking about what makes others not the best.

For those just starting Python, I'd say just go with virtualenv. It works, it's common, and there are tons of tutorials about it. Don't feel bad about using the old mediocre libraries. And in general, learning basics isn't embarrassing.

Re: Use pew, not virtualenvwrapper, for Python virtualenvs

#24
post #6

As someone who is finally getting into Python development (via Django) after following tons of tutorials over several years: should I be using pew, virtualenvwrapper, or something else? This article is from 2015, how relevant is it today?

I use Autoenv. It has one ultimate advantage - you don't need to learn any new tools/commands or execute anything manually. Also it's totally up to your decision where do you want to have the virtualenv. Just put a file `.env` with anything you want to execute automatically (eg. `source venv/bin/activate`) into your project directory, and that's it - it will run any time you'll `cd` or open a new shell there.

Re: Use pew, not virtualenvwrapper, for Python virtualenvs

#26

What I really want is to be able to type " foo.py", where creates a list of all necessary dependencies to run foo.py. Then " run foo.py" would automatically do whatever voodoo needs to be done to run foo.py regardless of where you run that command. The idea is that we all have global pip installations, which is great for hacking. I have a ton of Python scripts that depend on my pip installs. All my scripts run succes…

To do it correctly/completely is probably as hard as the halting problem. Unless foo.py is stipulated to be a leaf node.

You could come up with a half baked decent try by using the ast module to find foo.py deps and indexing pypi for provided package names. Complexity lies in where package names might intersect, but this is a half baked try after all.

Re: Use pew, not virtualenvwrapper, for Python virtualenvs

#27
post #6

As someone who is finally getting into Python development (via Django) after following tons of tutorials over several years: should I be using pew, virtualenvwrapper, or something else? This article is from 2015, how relevant is it today?

Just use virtualenv

Re: Use pew, not virtualenvwrapper, for Python virtualenvs

#29
post #20

Why not use pyenv + pyenv-virtualenv ? https://github.com/pyenv/pyenv https://github.com/pyenv/pyenv-virtualenv

pyenv with the virtualenv plugin provides the most sane default setup. what's missing is the buzz and the tutorials that utilize pyenv. pyenv is the best python interpreter management solution for me.
Post reply on HN