0

I have autogenerated code from swagger-codegen. The directory structure looks like this:

swagger1 
├── docs
├── git_push.sh
├── README.md
├── requirements.txt
├── setup.py
├── swagger_client
│   ├── __init__.py
├── test
├── test-requirements.txt
└── tox.ini

I generate an egg file from this as swagger1.egg. Similarly, I generate another directory swagger2 and generate another swagger2.egg. So both the eggs have the modules named swagger_client.
Currently, I import and use the egg as

sys.path.append("~/swagger1.egg")
import swagger_client

Currently, there seems no way to change the name of the module swagger_client while generation as per this issue.
Is there a way to use swagger_client from the other egg as well? I an using python 2.7.

subtleseeker
  • 4,415
  • 5
  • 29
  • 41
  • Maybe this might help https://stackoverflow.com/questions/67631/how-to-import-a-module-given-the-full-path for P2 there's `import imp; imp.load_source()` if you're just looking for a way to hack around your development environment.. btw.. p2 is old. – Todd Apr 22 '20 at 04:37
  • @Todd Doesn't work for egg files – subtleseeker Apr 22 '20 at 06:23

0 Answers0