CalvinLoke / bad-apple

Bad Apple printed out on the console with Python!
233 stars 43 forks source link

Import error despite having imported all dependencies #8

Open ghost opened 3 years ago

ghost commented 3 years ago

Traceback (most recent call last): File "touhou_bad_apple_v4.0.py", line 1, in import cv2 ImportError: No module named cv2

CalvinLoke commented 3 years ago

Hmm that is weird, did you do pip install -r requirements.txt?

Also would help if you could include what Python version you are running.

ghost commented 3 years ago

i did and it said that i had already installed all dependencies also i tried both using python and python3

CalvinLoke commented 3 years ago

Could you provide the specific version of python? If you are running Python 3.9.X, you might want to get 3.8.X, as cv2 does not currently support 3.9.X.

Also if you have both python and python3, install the requirements for Python 3 by using pip3 install -r requirements.txt instead.

ghost commented 3 years ago

ok, i'll try

ghost commented 3 years ago

yooo it worked, thanks man

ghost commented 3 years ago

actually i'm having another problem now

ghost commented 3 years ago

Your option: 1 Original mp3 (0), Midi (1) Enter 0 or 1: 1 Beginning ASCII generation... Progress: [####################### ] 99% Frame 6571 of 6572 frames ASCII generation completed! ASCII generation time: 33.6171236038208Traceback (most recent call last): File "/home/kali/bad-apple/touhou_bad_apple_v4.0.py", line 204, in main() File "/home/kali/bad-apple/touhou_bad_apple_v4.0.py", line 190, in main play_audio(path_to_file) File "/home/kali/bad-apple/touhou_bad_apple_v4.0.py", line 24, in play_audio pygame.mixer.music.load(path) pygame.error: Couldn't open /etc/timidity/freepats.cfg

do i have to edit something in the file?

ghost commented 3 years ago

it looks like it can't recognize the audio format for some reason

CalvinLoke commented 3 years ago

Hi there, really sorry for replying back so late. As option 1 plays back the midi file, it requires the use of a midi player. Judging by your directory, your host system seems to be Linux-based, which I presume does not have a built-in midi player. You might want to search up on that.

Cheers