[GH-ISSUE #8] Import error despite having imported all dependencies #5

Open
opened 2026-10-13 19:43:26 +00:00 by bsakaguchi · 9 comments
Owner

Originally created by @ghost on GitHub (Apr 27, 2021).
Original GitHub issue: https://github.com/rkk-2s/bad-apple/issues/8

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

Originally created by @ghost on GitHub (Apr 27, 2021). Original GitHub issue: https://github.com/rkk-2s/bad-apple/issues/8 Traceback (most recent call last): File "touhou_bad_apple_v4.0.py", line 1, in <module> import cv2 ImportError: No module named cv2
Author
Owner

@rkk-2s commented on GitHub (Apr 28, 2021):

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.

<!-- gh-comment-id:828598331 --> @rkk-2s commented on GitHub (Apr 28, 2021): 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.
Author
Owner

@ghost commented on GitHub (May 1, 2021):

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

<!-- gh-comment-id:830631597 --> @ghost commented on GitHub (May 1, 2021): i did and it said that i had already installed all dependencies also i tried both using python and python3
Author
Owner

@rkk-2s commented on GitHub (May 1, 2021):

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.

<!-- gh-comment-id:830633019 --> @rkk-2s commented on GitHub (May 1, 2021): 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.
Author
Owner

@ghost commented on GitHub (May 1, 2021):

ok, i'll try

<!-- gh-comment-id:830637991 --> @ghost commented on GitHub (May 1, 2021): ok, i'll try
Author
Owner

@ghost commented on GitHub (May 1, 2021):

yooo it worked, thanks man

<!-- gh-comment-id:830638218 --> @ghost commented on GitHub (May 1, 2021): yooo it worked, thanks man
Author
Owner

@ghost commented on GitHub (May 1, 2021):

actually i'm having another problem now

<!-- gh-comment-id:830638508 --> @ghost commented on GitHub (May 1, 2021): actually i'm having another problem now
Author
Owner

@ghost commented on GitHub (May 1, 2021):

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?

<!-- gh-comment-id:830638562 --> @ghost commented on GitHub (May 1, 2021): 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 <module> 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?
Author
Owner

@ghost commented on GitHub (May 1, 2021):

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

<!-- gh-comment-id:830640278 --> @ghost commented on GitHub (May 1, 2021): it looks like it can't recognize the audio format for some reason
Author
Owner

@rkk-2s commented on GitHub (May 25, 2021):

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

<!-- gh-comment-id:847821810 --> @rkk-2s commented on GitHub (May 25, 2021): 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
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rkk-2s/bad-apple#5
No description provided.