AdriaGual / marvel-snap-bot

A computer vision bot made with OpenCV and ADB.
93 stars 25 forks source link

No module named 'cv2' #93

Closed Krwawyy closed 1 year ago

Krwawyy commented 1 year ago

Him im getting error as in title + "ERROR: Cannot install numpy==1.21.0 and opencv-python-headless==4.6.0.66 because these package versions have conflicting dependencies." when doing "pip install -r requirements.txt". What I did:

paperc07 commented 1 year ago

Go do a pip freeze and see what all you have first and then post back

Krwawyy commented 1 year ago

Thats what i have installed: aiohttp==3.8.4 aiosignal==1.3.1 anyio==3.6.2 appdirs==1.4.4 async-timeout==4.0.2 asyncer==0.0.2 attrs==22.2.0 certifi==2022.12.7 charset-normalizer==3.0.1 click==8.1.3 colorama==0.4.6 coloredlogs==15.0.1 docker==6.0.1 fastapi==0.87.0 filetype==1.2.0 flatbuffers==23.1.21 frozenlist==1.3.3 h11==0.14.0 humanfriendly==10.0 idna==3.4 ImageHash==4.3.1 imageio==2.25.1 llvmlite==0.39.1 MouseInfo==0.1.3 mpmath==1.2.1 multidict==6.0.4 networkx==3.0 numba==0.56.4 numpy==1.23.5 onnxruntime==1.13.1 opencv-contrib-python==4.7.0.68 opencv-python==4.7.0.68 opencv-python-headless==4.6.0.66 packaging==23.0 Pillow==9.3.0 pooch==1.6.0 protobuf==4.22.0 PyAutoGUI==0.9.53 pydantic==1.10.5 PyGetWindow==0.0.9 PyMatting==1.1.8 PyMsgBox==1.0.9 pyperclip==1.8.2 pyreadline3==3.4.1 PyRect==0.2.0 PyScreeze==0.1.28 pytesseract==0.3.10 python-multipart==0.0.5 pytweening==1.0.4 PyWavelets==1.4.1 pywin32==305 rembg==2.0.30 requests==2.28.2 scikit-image==0.19.3 scipy==1.9.3 six==1.16.0 sniffio==1.3.0 starlette==0.21.0 sympy==1.11.1 tifffile==2023.2.3 tqdm==4.64.1 typing_extensions==4.5.0 urllib3==1.26.14 uvicorn==0.20.0 watchdog==2.1.9 websocket-client==1.5.0 yarl==1.8.2

And getting "ERROR: Failed building wheel for numpy Failed to build numpy ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects" when trying to install numpy==1.21.0

paperc07 commented 1 year ago

So you don't need it then you already have everything so skip that and let me know what your next error is

Krwawyy commented 1 year ago

$ python start.py Traceback (most recent call last): File "C:\Users\xxx\marvel-snap-bot\start.py", line 1, in from utils import android_connection, global_utils File "C:\Users\xxx\marvel-snap-bot\utils\global_utils.py", line 3, in import cv2 ModuleNotFoundError: No module named 'cv2'

paperc07 commented 1 year ago

That's crazy cause you definitely have it you actually have 3. Umm what about if you get it from the website opencv

Krwawyy commented 1 year ago

I did install it from website aswell

paperc07 commented 1 year ago

ok and I guess just go ahead and do a pip uninstall and do them all manually again so

pip uninstall opencv-contrib-python==4.7.0.68 pip uninstall opencv-python==4.7.0.68 pip uninstall opencv-python-headless==4.6.0.66

then do a reinstall pip install opencv-contrib-python==4.7.0.68 pip install opencv-python==4.7.0.68

skip headless

Krwawyy commented 1 year ago

python start.py still not working but! python3 start.py printing "$ python3 start.py

adb.exe: device '127.0.0.1:5555' not found error: device '127.0.0.1:5555' not found Traceback (most recent call last): File "C:\Users\xxx\marvel-snap-bot\start.py", line 23, in screenshot_dimensions = screenshot.shape AttributeError: 'NoneType' object has no attribute 'shape'"

paperc07 commented 1 year ago

ok did you go get the platform tools and put it in the main folder also check this out real quick and maybe this will help I made a thread about how to install #74

Krwawyy commented 1 year ago

image image

paperc07 commented 1 year ago

ok these are all related issues while I go look you can too #32 #6 #12 #14 #20

paperc07 commented 1 year ago

ok it's not connecting to adb hold please

adb.exe: device '127.0.0.1:5555' not found error: device '127.0.0.1:5555' not found

Krwawyy commented 1 year ago

adb devices returns nothing

paperc07 commented 1 year ago

is adb turned on inside of bluestacks?

Krwawyy commented 1 year ago

Yup image

paperc07 commented 1 year ago

ok try in CMD adb devices and see what you get

you should see emulator-5554 device

Krwawyy commented 1 year ago

adb server is out of date. killing...

paperc07 commented 1 year ago

and there's no devices? try adb start-server

Krwawyy commented 1 year ago

PS C:\Users\xxx\marvel-snap-bot> adb start-server PS C:\Users\xxx\marvel-snap-bot> adb devices List of devices attached

PS C:\Users\xxx\marvel-snap-bot> adb version Android Debug Bridge version 1.0.31

paperc07 commented 1 year ago

ummmm

adb kill-server adb start-server

paperc07 commented 1 year ago

mine says this

$ adb version Android Debug Bridge version 1.0.32 Revision eac51f2bb6a8-android

maybe go get new verion and extract

https://developer.android.com/studio/releases/platform-tools

Krwawyy commented 1 year ago

PS C:\Users\xxx\marvel-snap-bot> adb start-server

and

$ python3 start.py adb server version (31) doesn't match this client (41); killing...

Connection result: cannot connect to 127.0.0.1:5555: No connection could be made because the target machine actively refused it. (10061)

adb.exe: device '127.0.0.1:5555' not found error: device '127.0.0.1:5555' not found Traceback (most recent call last): File "C:\Users\xxx\marvel-snap-bot\start.py", line 23, in screenshot_dimensions = screenshot.shape AttributeError: 'NoneType' object has no attribute 'shape'

Krwawyy commented 1 year ago

How can i uninstall old adb? I've probably have installed adb somewhen

paperc07 commented 1 year ago

turn off antivirus and windows defender and firewall and try it

paperc07 commented 1 year ago

well just go to that website and get the new version and then just extract that platform tools to the base of your marvel snap bot folder

paperc07 commented 1 year ago

also what about this

1- adb kill-server

3- adb tcpip 5555

4- adb connect (your device ip):5555

Krwawyy commented 1 year ago

But even with platform-tools folder deleted i can adb version, so thats probably not the same adb right?

paperc07 commented 1 year ago

probably let me see the proper way to uninstall

https://xiaomidriver.com/remove-uninstall-adb-driver

Krwawyy commented 1 year ago

image there was not android device

paperc07 commented 1 year ago

one guy said this

I got this error when I had Bluestacks emulator started together with my phone attached. When I typed in command prompt adb devices I could see two devices:

adb devices List of devices attached dfdcdc9c device emulator-5554 device Before typing adb connect I had to type -s and device ID:

adb -s dfdcdc9c tcpip 5555 adb -s dfdcdc9c connect

Krwawyy commented 1 year ago

Ye but i have none in adb devices

paperc07 commented 1 year ago

what about

adb disconnect

paperc07 commented 1 year ago
image
paperc07 commented 1 year ago

did you get the new version from website yet?

Krwawyy commented 1 year ago

well i've deleted platform-tools folder on other hard drive now adb not working at all and it was new version but windows was running old version installed on other drive

paperc07 commented 1 year ago

ok thats fine now go get the new one from link above ok just go reget it or go to your downloads folder and reput it in marvel snap bot folder

then re open bluestacks and let's see what happens

Krwawyy commented 1 year ago

I did, still same error, adb devices returns list of 0 but version changed

paperc07 commented 1 year ago

ok sometimes it gets struck try

adb kill-server adb start-server

Krwawyy commented 1 year ago
paperc07 commented 1 year ago

I wonder why its running on port 5037 also ok for the hell of it restart your pc and try again

Krwawyy commented 1 year ago

sure brb

paperc07 commented 1 year ago
image
Krwawyy commented 1 year ago

PS C:\Users\xxxx\marvel-snap-bot> adb tcpip 5555

no clue why

paperc07 commented 1 year ago

yeah its not even picking up bluestacks

image
paperc07 commented 1 year ago

umm you have the latest bluestacks 5?

Krwawyy commented 1 year ago

image no clue yup, installed today

Krwawyy commented 1 year ago

i've tried connecting my phone to computer and its listing

paperc07 commented 1 year ago

so the phone works and you see it but not bluestacks?

Krwawyy commented 1 year ago

image yes

paperc07 commented 1 year ago

https://stackoverflow.com/questions/23104394/daemon-not-running-starting-it-now-on-port-5037

this looks even better https://stackoverflow.com/questions/28743916/on-windows-adb-connects-to-wrong-port-5037-instead-of-5555