Install two python modules with the same name

What is the best way to install two python modules with the same name? I am currently dependent on two different facebook libraries: pyfacebook and Facebook of the new python-sdk. Both of these libraries install themselves as a facebook module. I can come up with a bunch of hacked solutions, but before I left, I was curious if there was a Python way to handle this situation.

I am using virtualenv and pip.

(Yes, I end up condemning one of them, but I had two different engineers working on two different problems, and they did not realize that they were using a different module before integration)

+6
python setuptools virtualenv distutils
source share
2 answers

Firstly, I suggest you guys list all the other libraries that you use so that you can get a consensus on how you create your application.

To support this type of thing, put each module in its own folder, put it in the __init__.py file, then you can do this:

 import Folder1.facebook as pyfacebook import Folder2.facebook as facebooksdk 
+3
source share

The simplest solution is to include one (or both) modules in the project instead of installing it. Then you can get more control over the module name and import.

0
source share

All Articles