I have a ns.pkg2
package that depends on ns.pkg1
package. I make a fork of it, publish it to git and want to install my version into my virtualenv. I use pip install -e mygit
and end up with ns.pkg
in <env>/local/lib/python2.7/site-packages/ns/pkg1
and ns.pkg2
in <env>/src/ns.pkg2
with an <env>/lib/python2.7/site-packages/ns.pkg2.egg-link
. Now I can import ns
and ns.pkg1
but not ns.pkg2
. I couldn't find a way to install a package from git without pip install -e
that calls setup.py develop
. Also, I'm not sure it's not a problem with module code.
So, is it possible to co-install two modules from the same namespace from a tarball and directly from git?
In Python, a namespace package allows you to spread Python code among several projects. This is useful when you want to release related libraries as separate downloads.
Namespace packages allow you to split the sub-packages and modules within a single package across multiple, separate distribution packages (referred to as distributions in this document to avoid ambiguity).
Every package, module, class, function and method occupies a Python namespace in which variable names are set. A namespace gets created automatically when a module or package starts execution. Hence, create namespace in python, all you have to do is call a function/ object or import a module/package.
Importing is a way of pulling a name from somewhere else into the desired namespace. To refer to a variable, function, or class in Python one of the following must be true: The name is in the Python built-in namespace. The name is the current module's global namespace.
There is an open issue in pip
related to --editable
and namespace installations: https://github.com/pypa/pip/issues/3
A workaround was merged, and maybe you can solve your problem by doing:
$ pip install -e mygit --egg
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