I just started using virtualenv to develop my Django applications and I really like it so far. One question that came up now is how I install programs, that are non-python, into my virtualenv.
I have for example a fabric script that lints all my code. In there I have a task which uses csslint for linting my css files. But csslint is a npm package. So how do I handle my virtualenv dependencies that are not a python package?
Virtual Environment should be used whenever you work on any Python based project. It is generally good to have one new virtual environment for every Python based project you work on. So the dependencies of every project are isolated from the system and each other.
These are almost completely interchangeable, the difference being that virtualenv supports older python versions and has a few more minor unique features, while venv is in the standard library.
By default, virtualenv will not give access to the global site-packages . Running python after deactivating will use your system installation of Python again.
virtualenv is used to manage Python packages for different projects. Using virtualenv allows you to avoid installing Python packages globally which could break system tools or other projects. You can install virtualenv using pip.
I've done this once (while ago), and it worked quite good. The trick is to install node.js and npm to virtualenv:
workon myenv
cd node-v0.4.8
./configure –prefix=“/path/to/myenv/”
make
make install
and then
workon myenv
git clone git://github.com/isaacs/npm.git
cd npm
make
make install
This exact commands above are outdated, but I think it should be possible to do something similar with modern node.js and npm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With