6

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?

wRAR
  • 25,009
  • 4
  • 84
  • 97
  • what does the `__init__.py` of you `pkg2` look like? should be similar to what's described [here](http://stackoverflow.com/questions/1675734/how-do-i-create-a-namespace-package-in-python) – mata Nov 15 '12 at 18:25
  • 1
    @mata `pkg_resources.declare_namespace(__name__)` – wRAR Nov 16 '12 at 12:52

1 Answers1

5

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
Hugo Lopes Tavares
  • 28,528
  • 5
  • 47
  • 45
  • you help me to solve really long term problem (I hope it is solved). Using `pip` I installed my namespaced package from pypi. And using buildout I worked on develop packages, sharing the same namespace. Sometime I got into problem with importing my develop based package, it was reported as missing. Solution for now? I **Install namespaced package from pypi using easy_install and not pip**. After this change, I am able to import my develop based one. Thank you for your link. – Jan Vlcinsky May 15 '13 at 09:30