[PyGame] Apparently module has no attribute display? - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Game Development (https://python-forum.io/forum-11.html) +--- Thread: [PyGame] Apparently module has no attribute display? (/thread-7000.html) |
RE: Apparently module has no attribute display? - metulburr - Dec-17-2017 (Dec-17-2017, 08:06 PM)Klar Wrote: All I've found with the search (not the ones you suggested since I use windows, not linux) have lead me to a folder named pygame, followed by a folder name __pycache__, followed by the .pyc for the .init Folders cannot be named pygame either. Uninstall pygame and remove all related. Make sure you get an import error after this with no module named pygame before installing again RE: Apparently module has no attribute display? - Klar - Dec-18-2017 Just great. I did that and now it keeps saying that there is no module named pygame. It's very clearly installed in the site-packages folder! RE: Apparently module has no attribute display? - metulburr - Dec-18-2017 now just do pip3 install pygameand it should do everything for you How did you install before? Quote:/usr/lib/python3.6/site-packages/pygame-1.9.3-py3.6-linux-x86_64.egg/pygame/__init__.pyMy pip always installs to local >>> import pygame >>> pygame.__file__ '/usr/local/lib/python3.6/site-packages/pygame/__init__.py' metulburr@ubuntu:~$ ls /usr/local/lib/python3.6/site-packages | grep pygame pygame pygame-1.9.3.dist-info RE: Apparently module has no attribute display? - Klar - Dec-18-2017 I already installed it, it's very clearly installed in site-packages, and it STILL says that there's no module named pygame RE: Apparently module has no attribute display? - metulburr - Dec-18-2017 Didnt realize you were on windows.... After you did install and are getting no method named init()....what was/is the output of the following in the python interpreter (assuming you re-install it and get the same issue again) >>> import pygame >>> pygame.__file__what is the output of this in the python interpreter >>> import sys >>> sys.path RE: Apparently module has no attribute display? - Windspar - Dec-18-2017 @metulburr Quote:How did you install before?I compile my from source because of high cpu usage. @Klar Might be environment variable. try this import sys sys.path.append('path to pygame') import pygame RE: Apparently module has no attribute display? - Klar - Dec-18-2017 I tried that. It didn't work. As always. RE: Apparently module has no attribute display? - metulburr - Dec-18-2017 @Windspar Yeah i got confused between your posts and the OP's posts, thought the OP was on linux. RE: Apparently module has no attribute display? - Windspar - Dec-18-2017 How many pythons do you have installed on your computer ? your path to pygame. It didn't include pygame in path ? Show path to pygame might help. RE: Apparently module has no attribute display? - metulburr - Dec-18-2017 (Dec-17-2017, 01:32 AM)Klar Wrote: Doing that makes it say that module has no attribute init()This means
If you didnt name anything "pygame" then there is something wrong with the installation (of pygame). If you uninstalled pygame and now you get a no module named pygame error, we can rule out the file/directory named pygame, as that would still load the wrongly named module you created even after uninstalling pygame. Unless for some reason you added a directory named "pygame" yourself in the python library? How did you install pygame? State explicitly what you did, where you got it from (inlcude link here), any output or error you had while installing it, etc. Did you compile it yourself or did you install a wheel? Did you install it with pip? Either way show the command prompt output from either of them. How many python versions do you have on your computer? For all we know you are getting it from an odd source that has a directory named pygame in it loading it incorrectly. We can only tell what is wrong by how much information you give...and the less you give, the more likely we are not going to diagnose it. When we tell you to run something and give us the info that is a way for us to help diagnose the problem. Like you never responded with the output of this. So basically at this point i cant help you as you are not running the code i am giving you to help diagnose your problem. |