Hacker News new | past | comments | ask | show | jobs | submit login

> NPM might suck for various reasons but at least all deps are installed local to each project. I'm sure there are secret incantations for doing the same in perl and python but by default most stuff I download requires global libraries to be installed

No magic required in Python at all for this. Just use virtualenv from your project directory (don't bother with vitrualenvwrapper).

    $ virtualenv venv; . ./venv/bin/activate



IMO it *is" magic because it's not the default.

with npm I have to go through special effort to get anything to install globally. With both python and perl I've read countless books and websites over the last 20 years and never once ran into that incantation. They all just say type

    install Chocolate::Belgian
or

    cpan Chocolate::Belgian
or

    python -m pip install SomePackage
etc..


That's just intellectually dishonest, it's part of the official language tutorial...

https://docs.python.org/3/tutorial/venv.html


Chapter 12!


Likewise don't bother with `activate`, just use the tools from the virtualenv directly `venv/bin/pip`, `venv/bin/python` etc.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: