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

NameError: name 'colorsys' is not defined #9

Closed
shokifrend007 opened this issue Mar 11, 2021 · 5 comments · May be fixed by #10
Closed

NameError: name 'colorsys' is not defined #9

shokifrend007 opened this issue Mar 11, 2021 · 5 comments · May be fixed by #10

Comments

@shokifrend007
Copy link

I removed the "." before the imports and now this happens:

$ python3 main.py
pygame 2.0.0 (SDL 2.0.12, python 3.8.5)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "main.py", line 277, in <module>
main()
File "main.py", line 161, in main
o.setSprite(((player.position.y/50) % 100) / 100)
File "/home/shokifrend77/Downloads/flappuchino/Flappuccino-main/background.py", line 9, in setSprite
color = colorsys.hsv_to_rgb(tint,1,1)
NameError: name 'colorsys' is not defined

Thanks in advance!

@ghost
Copy link

ghost commented Mar 12, 2021

I removed the "." before the imports and now this happens:

$ python3 main.py
pygame 2.0.0 (SDL 2.0.12, python 3.8.5)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "main.py", line 277, in <module>
main()
File "main.py", line 161, in main
o.setSprite(((player.position.y/50) % 100) / 100)
File "/home/shokifrend77/Downloads/flappuchino/Flappuccino-main/background.py", line 9, in setSprite
color = colorsys.hsv_to_rgb(tint,1,1)
NameError: name 'colorsys' is not defined

Thanks in advance!

So inside main.py add 1 line called:

import colorsys

In my pull request I may have not seen this

@shokifrend007
Copy link
Author

I FIxed It!

It's not the main.py that is missing the "import colorsys", it's missing in the "background.py" file.

Thank you!

@shokifrend007
Copy link
Author

@NightZan999 Can you make a pull request with the changes?
I can't figure out how to do it...

@ghost
Copy link

ghost commented Mar 13, 2021

@NightZan999 Can you make a pull request with the changes?
I can't figure out how to do it...

Yep on that right now lol.

@ghost ghost mentioned this issue Mar 13, 2021
@ghost
Copy link

ghost commented Mar 13, 2021

Okay I made a pull request which hopefully gets taken as it fixes this game... #10

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

Successfully merging a pull request may close this issue.

1 participant