I have pygame on xubuntu, on Python 3.5. I am trying to run my first code.
import pygame
pygame.init()
I have:
AttributeError Traceback (most recent call last)
<ipython-input-11-9f5fb6a2d879> in <module>()
1 import pygame
2
----> 3 pygame.init()
4
AttributeError: module 'pygame' has no attribute 'init'
And:
pygame.__path__
I have:
NamespacePath(['/home/agnieszka/Pulpit/Python/pygame'])
You have a print screen here:
I have my script saved in: "/home/agnieszka/Pulpit/Python/", so pygme was installed in the same place.
What is wrong? I believe, you will know...
The name of the file is program.py:
agnieszka@agnieszka-xubuntu:~/Pulpit$ cd /home/agnieszka/Pulpit/Python/
agnieszka@agnieszka-xubuntu:~/Pulpit/Python/home/agnieszka/anaconda3/bin/python program.py
Traceback (most recent call last):
File "program.py", line 3, in <module>
pygame.init()
AttributeError: module 'pygame' has no attribute 'init'
EDIT: the output, you asked for:
agnieszka@agnieszka-xubuntu:~/Pulpit/Python/pygame$ ls -lh /home/agnieszka/Pulpit/Python/
razem 24K
drwxrwxr-x 3 agnieszka agnieszka 4,0K paź 31 10:52 GRA
drwxrwxr-x 4 agnieszka agnieszka 4,0K paź 30 13:04 laborki
drwxrwxr-x 7 agnieszka agnieszka 4,0K paź 18 08:22 padpy1617
drwxrwxr-x 2 agnieszka agnieszka 4,0K paź 30 13:04 prace_domowe
-rw-rw-r-- 1 agnieszka agnieszka 29 paź 31 11:01 program.py
drwxrwxr-x 18 agnieszka agnieszka 4,0K paź 31 11:27 pygame
EDIT: After adding:
print(dir(pygame))
I have:
agnieszka@agnieszka-xubuntu:~/Pulpit/Python$ /home/agnieszka/anaconda3/bin/python program.py
['__doc__', '__loader__', '__name__', '__package__', '__path__', '__spec__']