
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Install Two Python Modules with Same Name
This is not possible with the pip. All of the packages on PyPI have unique names. Packages often require and depend on each other, and assume the name will not change. Even if you manage to put the code on Python path, when importing a module, python searches the paths in sys.path by order and stops at first match. So whatever module it finds first, it'll stop at that.
You best bet is to copy all the code from the libraries to you codebase, change the module name of either and then import it.
If you're importing modules with same name from different packages, you can do it as follows:
>>> from foo import bar as first_bar >>> from baz import bar as second_bar
Advertisements