In Node.js, I'm used to using npm link
to get a project to use a custom version of a dependency. From the Node documentation:
First,
npm link
in a package folder will create a globally-installed symbolic link fromprefix/package-name
to the current folder.Next, in some other location,
npm link package-name
will create a symlink from the localnode_modules
folder to the global symlink.
Is it kosher to do something similar by symlinking into site-packages?
Perhaps, but what you probably want to do is use virtualenv. Virtualenv allows you to create a python environment isolated from any others:
You can then install specific versions of python packages as you please, say version
0.1.0
of a randomtoolz
package I just found, when the lastest version is0.2.1
:As you can see it also installs dependencies. You can also generate a requirements file:
Which you can then use to duplicate those same dependencies in another virtualenv
The exact analogue is
pip install -e .
orpython setup.py develop
.https://pip.pypa.io/en/latest/reference/pip_install.html#editable-installs