4 ms·
Installs in a local folder to the project (node_modules) instead of pip which installs packages to the global python installation unless ran in a virtual env. S
by matsemann 5y ago
Installs in a local folder to the project (node_modules) instead of pip which installs packages to the global python installation unless ran in a virtual env. So getting anything up and running is trivial, compared to the amount of installations and steps needed with pip, unless you wanna bork your global python installation.
With npm it's also really easy (almost too easy) to take your current folder and push it to npm, making the ecosystem bloom with packages.
- goodoldneon 5y agoThe virtual env thing is extra friction but isn’t terrible: $ python -m venv .venv $ source .venv/bin/activate $ pip install -r requirements.txt Most IDEs will automatically pick up the .venv folder
- bin_bash 5y agoI don't know what you're talking about—every time I have to do this I have no idea what I'm doing and I'm a senior engineer at FAANG. I admit that I'm not a Python engineer, but I have been in the past—twice!
- _dain_ 5y agoIt's just a little switcheroo so that your shell environmental variables point to a project-local Python install rather than a global one.
- neurostimulant 5y agoVirtualenv used to be a third party package, which was a very high friction because you'll need to install it system-wide first (e.g. from distro's package manager) before you can use it to create virtual environments.
- mmcnl 5y agoNot terrible, but still not as good and easy as npm. For example, you can't make a distinction between runtime and development dependencies, and it doesn't solve circular dependencies. Luckily there is Poetry which exactly does this.