Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken Imports #160

Open
TheBagarius opened this issue Mar 28, 2024 · 2 comments
Open

Broken Imports #160

TheBagarius opened this issue Mar 28, 2024 · 2 comments

Comments

@TheBagarius
Copy link

TheBagarius commented Mar 28, 2024

I don't understand what is going on in the error message below.
Also I cannot call mitmproxy2swagger from the command line after installing it with pip3 install mitmproxy2swagger
I have to forcefully call it from the full filepath with python3

bumping #153

$ python3 ~/Library/Python/3.9/lib/python/site-packages/mitmproxy2swagger/mitmproxy2swagger.py -i ~/Documents/TMS-login\ flows -o ~/Documents/tms_trials
Traceback (most recent call last):
  File "/Users/USER/Library/Python/3.9/lib/python/site-packages/mitmproxy2swagger/mitmproxy2swagger.py", line 16, in <module>
    from mitmproxy2swagger import console_util, swagger_util
  File "/Users/USER/Library/Python/3.9/lib/python/site-packages/mitmproxy2swagger/mitmproxy2swagger.py", line 16, in <module>
    from mitmproxy2swagger import console_util, swagger_util
ImportError: cannot import name 'console_util' from partially initialized module 'mitmproxy2swagger' (most likely due to a circular import) (/Users/USER/Library/Python/3.9/lib/python/site-packages/mitmproxy2swagger/mitmproxy2swagger.py)
@josephwandery
Copy link

Hello,try installing it in a virtual environment.

@rithvikvibhu
Copy link

rithvikvibhu commented Aug 15, 2024

Looks like it's because the directory (mitmproxy2swagger) and the main file (mitmproxy2swagger.py) are of the same name. To confirm, renaming it to mitmproxy2swagger_main.py will make the script work.

But yeah, if installed globally properly, this should not be requried and works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants