synchronizing/mitm

Basic Sample throws error

Closed this issue · 5 comments

Python: 3.8
Fresh install of mitm

Using the basic example on the readme, I get the following error when trying to run it:
"partially initialized module 'mitm' has no attribute 'MITM' (most likely due to a circular import)

Not sure what's going on here, since I just installed the package and tried running the sample.

Similar to #15. Try the following:

pip install --upgrade mitm --force

Closing for the meantime. Let me know if the above does not resolve your issue.

Hi,

Sorry for the late response; I just tried running the command to force upgrade mitm, and while it did install updates for a few libraries, the end result is the same I'm afraid.

That's odd. I'll reopen ticket and when I get the chance will try replicating the problem on a fresh 3.8 install.

What's odd to me is the Github Actions - which installs mitm on a fresh 3.8 install for tests - doesn't seem to be having this issue. Nonetheless, will try to replicate.

Cannot replicate.

FROM python:3.8

RUN pip install mitm

WORKDIR /app
RUN echo "\
from mitm import MITM, protocol, middleware, crypto\n\
mitm = MITM(\n\
    host='0.0.0.0', \n\
    port=8888, \n\
    protocols=[protocol.HTTP], \n\
    middlewares=[middleware.Log], # middleware.HTTPLog used for the example below. \n\
    certificate_authority = crypto.CertificateAuthority() \n\
) \n\
mitm.run()" > /app/main.py

CMD ["python", "/app/main.py"]
docker build -t mitm-test .
docker run -p 8888:8888 -t mitm-test

Runs fine on a brand new 3.8 container & Python instance. Perhaps reinstalling Python might fix your issue. Closing for now.