Live data from Hacker News

Use pew, not virtualenvwrapper, for Python virtualenvs

planspace.org

11–20 of 57 posts

Re: Use pew, not virtualenvwrapper, for Python virtualenvs

#13
post #10
post #7

Earlier quoted context omitted.

You can use virtualenv without `bin/activate`. Just refer to `bin/python` (and other scripts in `bin/`) explicitly. Don't bring in the magic until you need it. And when you need it, consider what kind of magic you need. If you're typing `bin/` too much, do you need something that adds `bin/` to your path, or do you need to write a script for this task that saves you from having to type both `bin/` and a bunch of othe…

How do you manage dependencies? One of the best parts about virtualenv (to me at least) is that I can do pip install without infecting the rest of the system. I guess I've never looked, does virtualenv provides a bin/pip which already knows the path of the virtualenv? Does the bin/python in there come with a path that uses the project pip install?

Yes, exactly. bin/pip inside the virtualenv installs into that virtualenv.

Re: Use pew, not virtualenvwrapper, for Python virtualenvs

#14
post #10
post #7

Earlier quoted context omitted.

You can use virtualenv without `bin/activate`. Just refer to `bin/python` (and other scripts in `bin/`) explicitly. Don't bring in the magic until you need it. And when you need it, consider what kind of magic you need. If you're typing `bin/` too much, do you need something that adds `bin/` to your path, or do you need to write a script for this task that saves you from having to type both `bin/` and a bunch of othe…

How do you manage dependencies? One of the best parts about virtualenv (to me at least) is that I can do pip install without infecting the rest of the system. I guess I've never looked, does virtualenv provides a bin/pip which already knows the path of the virtualenv? Does the bin/python in there come with a path that uses the project pip install?

There is a bin/pip you could call directly and have it install packages to the correct path. Even commands installed from packages work that way.

I would only use 'bin/python' directly from scripts called from cron, or other similar places.

Re: Use pew, not virtualenvwrapper, for Python virtualenvs

#15
post #4

Why not use conda?

Because conda (and by extension, Anaconda) harms the Python ecosystem with their non-standard package format. If Continuum Analytics cared about making scientific packages like numpy and scipy more accessible, they would make binary wheels for Linux/Windows/OSX with the MKL. There is no technical reason that prevents them from doing this. Instead they lock you in to their package/environment manager and create confusion when you have pip and conda packages installed at the same time.

Re: Use pew, not virtualenvwrapper, for Python virtualenvs

#17

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…

Sounds like Stack for Python
Post reply on HN