And I literally mean without replacing the '..'. I have seen this in the PySDL2-0.8.0 library:
from .. import sdlimage
The reason I ask myself this is because I am trying to run one of the examples they provided and reading the traceback leads me to a file that has this:
_HASPIL = True
try:
from PIL import Image
except ImportError:
_HASPIL = False
_HASSDLIMAGE = True
try:
from .. import sdlimage
except ImportError:
_HASSDLIMAGE = False
And of course at some point in the same file:
if not _HASPIL and not _HASSDLIMAGE:
raise UnsupportedError(load_image,
"cannot use PIL or SDL for image loading")
I do not have PIL (python imaging library) installed, but I do have the sdlimage.py file. So the file I am trying to run is:
/Library/Python/2.7/site-packages/sdl2/examples/helloworld.py
The path to sdlimage.py:
/Library/Python/2.7/site-packages/sdl2/sdlimage.py
And the file that raises UnsupportedError(load_image, "cannot use PIL or SDL for image loading"):
/Library/Python/2.7/site-packages/sdl2/ext/image.py
I think there is something fishy with these imports...Any ideas?
It's a relative import. More on this here: http://docs.python.org/3.3/tutorial/modules.html#intra-package-references
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With