Hacker News new | ask | show | jobs
by pronlover723 1250 days ago
Apparently you missed the point. local needs to be the default. Not some magic incantation

In node

    cd projectFoo
    # do stuff, node uses packages local to projectFoo
    cd ../projectBar
    # do stuff, node uses packages local to projectBar
There is no "activation", the default is it just works.

Installing packages local to the project is also the default.

2 comments

Activating virtualenvs isn't necessary. In every python project I work in, I do

    $ cd projectFoo
    $ ./ve/bin/python whatever...
(more realistically, it's `make whatever` which then builds the virtualenv into `./ve` if needed, pip installs required packages into it, and runs the command).

Yes, I agree that it would be nice if the default behaviour of `pip install -r requirements.txt` was to install it in an isolated virtualenv specific to that project, but it's not also not like it's completely impossible magic.

This is the important difference. Scripting languages should default to examining the current directory and then its parent directory etc. to find the resources they need. Python doesn't have this default and probably can't change at this point.