So I am running Windows 8 with python 3.3 installed. I have livewires and pygame installed.
But when I run the code:
from livewires import games
games.init(screen_width = 640, screen_height = 480, fps = 50)
games.screen.mainloop()
I get an error saying... ImportError: No module name 'pygame.image'.
Does anyone know how to fix this?
Did you install pygame in the file directory of the python interpreter? But anyway pygame is not available for python 3.3 at the moment. If you want to use python 3 for coding, I would recommend 3.1.1 or 3.2, and use python 2.7.12 to compile them into an .exe file with pyinstaller, because pip is not compatible with 3.1.1 and 3.2. You can also write the code in python 2. I would recommend 2.7.12
If you read the README.md file in the distro's module directory, you'll see that it was committed on September 25, 2013 and specifically states:
You will need Python to use the package. Python can be obtained from: http://www.python.org/download/. If you're installing for the first time, we recommend you use Python 2.2.3
I think it's quite likely that livewires will not work with Python 3.
Related
I couldn't resize my windows on the applications i made with Kivy, so I found out using sdl2, instead of Pygame, with Kivy can fix this. I uninstalled Kivy and Pygame, then installed sdl2, then reinstalled Kivy. Kivy still is trying to use pygame though. Please Help.
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/kivy/core/window/window_pygame.py", line 8, in <module>
import pygame
The easiest way to fix this is to purge your current kivy install and re-install it fresh using the following links as a reference point (these are the official installation instructions)
https://kivy.org/docs/installation/installation-windows.html
With that being said please note the following, do to an issue with a few compilers 1.9.2 doesn't work on windows with python 3.5 this is an ongoing issue the kivy team is aware of and working on.
So this means you're left with using python 3.4 for the newest version(s) of kivy on windows. Kivy no longers uses pygame and should by default prompt you to install sdl2.
The only issue you may have with the official instructions in the link I provided is setting up GStreamer if it gives you a problem you can skip that and just grab a ported version which suffices.
If you're on Linux then just re-install :)
I had the same issue on my new Mac (Sierra). I followed the suggestion at https://github.com/kivy/kivy/issues/4688
and installed the latest version of Kivy using the command
USE_OSX_FRAMEWORKS=0 pip install https://github.com/kivy/kivy/zipball/master
This worked for me, and Kivy is now using SDL2 and not looking for pygame.
(I also answered this at: Kivy support for SDL2 in Virtualenv)
My current version of Python is the newest 3.5 and the only available PyGame was for 3.2 (both PyGame and Python are 32-bit). I've scoured stackoverflow for a resolution and can't find any way to make this work. I've installed the PyGame easy installer and placed it in the directory where my Python install is, and in Visual Studio (I've also tried this in PyCharm as well as the standard Python IDE in command prompt), upon typing
import pygame or import sys, pygame
I'm presented with the error Import Error was
unhandled by user code - DLL load failed: The specified module could not be found.
My final solution is to uninstall Python 3.5 and install the version which matches PyGame.
This shouldn't have anything to do with Python version. You are missing a dynamic library (the DLL). This means that either the DLL is not on your system or Python can't find it. You should probably try the msi/exe installer for PyGame mentioned here, as it should install any dependencies. This would fix the issue if it is caused by the DLL being absent from your system.
It could also be caused by the libraries not being on PYTHONPATH. Search the error you received and you should see quite a few answers on fixing this.
If you're just getting started, you may want to look at a different library. There are likely quite a few game libraries for Python that can be installed with a simple pip install. You could then return to PyGame when you are more comfortable if you wanted.
get it from here: https://www.dropbox.com/s/hnmcaq1rf6zn7m3/pygame-1.9.2a0-cp34-none-win32.whl?dl=0
download it and install it by putting it in C:\python3.5\Scripts
then run pip3 install pygame-1.9.2a0-cp34-none-win32.whl
(this is for 3.4, but 3.5 works too)
it should work, and your error has nothing to do with the package, it's just that you do not have a DLL file, install it again from the website above
I couldn't resize my windows on the applications i made with Kivy, so I found out using sdl2, instead of Pygame, with Kivy can fix this. I uninstalled Kivy and Pygame, then installed sdl2, then reinstalled Kivy. Kivy still is trying to use pygame though. Please Help.
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/kivy/core/window/window_pygame.py", line 8, in <module>
import pygame
The easiest way to fix this is to purge your current kivy install and re-install it fresh using the following links as a reference point (these are the official installation instructions)
https://kivy.org/docs/installation/installation-windows.html
With that being said please note the following, do to an issue with a few compilers 1.9.2 doesn't work on windows with python 3.5 this is an ongoing issue the kivy team is aware of and working on.
So this means you're left with using python 3.4 for the newest version(s) of kivy on windows. Kivy no longers uses pygame and should by default prompt you to install sdl2.
The only issue you may have with the official instructions in the link I provided is setting up GStreamer if it gives you a problem you can skip that and just grab a ported version which suffices.
If you're on Linux then just re-install :)
I had the same issue on my new Mac (Sierra). I followed the suggestion at https://github.com/kivy/kivy/issues/4688
and installed the latest version of Kivy using the command
USE_OSX_FRAMEWORKS=0 pip install https://github.com/kivy/kivy/zipball/master
This worked for me, and Kivy is now using SDL2 and not looking for pygame.
(I also answered this at: Kivy support for SDL2 in Virtualenv)
Hi guys this is the problem
I have installed python 2.7 and pygame 1.9 in a windows 7 32 bin
When I use pygame with the python interpeter there is no problem it works fine
Then for the line
import pygame
no problem with console or calling python and the filename
But I want to embed this in a c++ project compiled with mingw32. When I import other packages like cv2 or numpy no problem but in the case of pygame I have this error
ImportError: DLL load failed: The specified module could not be found.
Does anybody knows where is the problem?
A lot of thanks
I have solved after a lot of googling. The problem was with the pygame packages in msi format.
I uninstalled it and I have installed wheel and the package
pygame‑1.9.2a0‑cp27‑none‑win_amd64.whl
from the page http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
And that works for me. There was a problem with some dll missing in the case of msi packages and minggw32 compiling
A lot of thanks to all of us
:)
The error is on the line import pygame:
ImportError: DLL load failed: The specified module could not be found.
from this line in pygame _ init_ :
from pygame.base import *
I am using Python 3.4 and Pygame-1.9.2a0.win32-py3.2.msi
It seems no official Pygame release is compatible with Python 3.4 at the moment. You could downgrade your Python (to 3.2 or 2.7) or use an unofficial Pygame release, like the ones hosted here.
Either way, the issue is not related to Pycharm.
Update: Recently (December 2016), PyGame has come back to life. There are now official PyGame downloads for all current Python versions on Pypi.