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

Does not work with Python 3.10 #32

Closed
cryptax opened this issue Nov 14, 2022 · 5 comments
Closed

Does not work with Python 3.10 #32

cryptax opened this issue Nov 14, 2022 · 5 comments

Comments

@cryptax
Copy link

cryptax commented Nov 14, 2022

Using Python 3.10, Mango fails with a Python error (see issue #30) , and worse Medusa creates a core dump (see issue #31 ). On some OS, Python 3.10 is now the default python version, so it would be nice that it is supported.

Meanwhile, I have a workaround: creation of a Dockerfile using Python 3.8.
See below. There are currently a few patches to do on requirements.txt (missing google_trans_new + bad version of readline), but probably those will be fixed soon (see issue #29 ).

FROM alpine/git as clone
WORKDIR /opt
RUN git clone https://github.com/ch0pin/medusa

FROM python:3.8-bullseye
RUN mkdir -p /opt/medusa
COPY --from=clone /opt/medusa /opt/medusa
WORKDIR /opt/medusa
RUN apt-get update && apt-get install -yqq android-tools-adb
RUN pip install --upgrade pip && pip install wheel
RUN cd /opt/medusa && sed -i 's/readline==6.2.4.2/readline/g' requirements.txt && echo "google_trans_new" >> requirements.txt && pip install -r requirements.txt
EXPOSE 5554
EXPOSE 5555
EXPOSE 5900
EXPOSE 5037

CMD [ "python3",  "medusa.py" ]

Then, build the docker image: docker build -t medusa:2022.11 .
Then, run the docker image. docker run --rm -it --name medusa --net=host medusa:2022.11 . Do not forget --net=host to share access to your local Android emulator.

Another solution is probably to create a Python virtual environment using Python 3.8 (virtualenv -p /usr/bin/python3.8 venv). It failed on my OS for obscure reasons, probably a messy config on my side.

@Ch0pin
Copy link
Owner

Ch0pin commented Nov 15, 2022

I have to install python 3.10 and find some workaround, thank you for letting me know.

@Ch0pin
Copy link
Owner

Ch0pin commented Dec 23, 2022

Installed 3.10 today and seems to work fine so far. @cryptax , do you still have issues or should I close this one ?

@cryptax
Copy link
Author

cryptax commented Jan 2, 2023

Installed 3.10 today and seems to work fine so far. @cryptax , do you still have issues or should I close this one ?

That's quite strange. I still have the exact same issues.

1- A Python error with mango.py
2- Need to have readline in requirements.txt to use medusa.py
3- Core dump when using medusa.py

I have Python 3.10.4. To reproduce:

  • Clone the repository
  • Create a virtual environment: python -m venv venv
  • Activate it source ./venv/bin/activate
  • Install requirements: pip3 install -r requirements.txt
  • Then launch python3 mango.py

This is the issue with mango:

    from networkx import utils
  File "/home/axelle/softs/medusa/venv/lib/python3.10/site-packages/networkx/utils/__init__.py", line 2, in <module>
    from networkx.utils.decorators import *
  File "/home/axelle/softs/medusa/venv/lib/python3.10/site-packages/networkx/utils/decorators.py", line 1, in <module>
    import bz2
  File "/usr/local/lib/python3.10/bz2.py", line 17, in <module>
    from _bz2 import BZ2Compressor, BZ2Decompressor
ModuleNotFoundError: No module named '_bz2'

This is the issue with medusa:

0) Device(id="local", name="Local System", type='local')
1) Device(id="socket", name="Local Socket", type='remote')
2) Device(id="emulator-5554", name="Android Emulator 5554", type='usb')

Enter the index of the device to use: 2
double free or corruption (out)
Aborted (core dumped)

This is the issue when no readline (to solve, pip3 install readline or add it to requirements.txt)

Traceback (most recent call last):
  File "/home/axelle/softs/medusa/medusa.py", line 6, in <module>
    import readline
ModuleNotFoundError: No module named 'readline'

@cryptax
Copy link
Author

cryptax commented Jan 13, 2023

Today, I've erased my Python virtual environment and re-created it. And now with Python 3.10.4 I have no issue :)
Thanks!

@cryptax cryptax closed this as completed Jan 13, 2023
@Ch0pin
Copy link
Owner

Ch0pin commented Jan 13, 2023

Thank you for letting me know @cryptax

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

2 participants