boskee / Minecraft

Simple Minecraft-inspired program using Python and Pyglet
MIT License
207 stars 33 forks source link

No Module named PIL #81

Closed kellyfj closed 5 years ago

kellyfj commented 10 years ago

Running OS/X 10.8.5

Franks-MacBook-Pro:Minecraft frankkelly$ python --version Python 2.7.2

The fogleman original branch works fine on my Mac so not sure what I am missing

Franks-MacBook-Pro:Minecraft frankkelly$ arch -i386 python main.py
Traceback (most recent call last):
  File "main.py", line 22, in <module>
    from controllers import MainMenuController
  File "/usr/local/coderdojo/python/pycraftr/Minecraft/controllers.py", line 21, in <module>
    from blocks import *
  File "/usr/local/coderdojo/python/pycraftr/Minecraft/blocks.py", line 24, in <module>
    from textures import TexturePackList
  File "/usr/local/coderdojo/python/pycraftr/Minecraft/textures.py", line 6, in <module>
    from PIL import Image
ImportError: No module named PIL

Also not sure what PIL is but I think I successfully installed it too (just in case)

Franks-MacBook-Pro:Minecraft frankkelly$ sudo easy_install PIL
Password:
Searching for PIL
Best match: PIL 1.1.7
Processing PIL-1.1.7-py2.7-macosx-10.8-intel.egg
PIL 1.1.7 is already the active version in easy-install.pth
Installing pilconvert.py script to /usr/local/bin
Installing pildriver.py script to /usr/local/bin
Installing pilfile.py script to /usr/local/bin
Installing pilfont.py script to /usr/local/bin
Installing pilprint.py script to /usr/local/bin

Using /Library/Python/2.7/site-packages/PIL-1.1.7-py2.7-macosx-10.8-intel.egg
Processing dependencies for PIL
Finished processing dependencies for PIL
Michaelangel007 commented 10 years ago

On OSX 10.9.2 I was getting the exact same missing PIL

xcode-select --install
sudo su
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
pip install PIL --allow-external PIL --allow-unverified PIL

And then I was able to successfully run the game

 arch -i386 python main.py
kellyfj commented 10 years ago

Thanks.

THe xcode-select command failed but the other ones worked fine after I uninstalled PIL first

-Frank

On Mon, Jun 30, 2014 at 5:10 PM, Michael notifications@github.com wrote:

On OSX 10.9.2 I was getting the exact same missing PIL

xcode-select --install sudo su export CFLAGS=-Qunused-arguments export CPPFLAGS=-Qunused-arguments pip install PIL --allow-external PIL --allow-unverified PIL

And then I was able to successfully run the game

arch -i386 python main.py

— Reply to this email directly or view it on GitHub https://github.com/boskee/Minecraft/issues/81#issuecomment-47587549.

r1chardj0n3s commented 9 years ago

"pip install pillow" is a better solution to the PIL installation.

AlexCerome commented 9 years ago

map code!

ocarneiro commented 8 years ago

pillow has some issues on recent versions. A better solution is to provide a "safe" version, like: pip install pillow==2.6.1

r58Playz commented 5 years ago

just run pip install pillow

Nebual commented 5 years ago

Amusingly, we don't actually use PIL, it was a stray import all along.

r58Playz commented 5 years ago

I thought we used it in main.py. I got a ImportError since I had forgotten to install pillow.