fogleman / Minecraft

Simple Minecraft-inspired program using Python and Pyglet
MIT License
5.22k stars 1.23k forks source link

Can't lunch main.py #75

Closed oleksii-frolov closed 8 years ago

oleksii-frolov commented 8 years ago

I am trying to run this app on OS X with python 2.7 and got these errors:

Traceback (most recent call last):
  File "main.py", line 7, in <module>
    from pyglet.gl import *
  File "/usr/local/lib/python2.7/site-packages/pyglet/gl/__init__.py", line 97, in <module>
    from pyglet.gl.lib import GLException
  File "/usr/local/lib/python2.7/site-packages/pyglet/gl/lib.py", line 140, in <module>
    from pyglet.gl.lib_agl import link_GL, link_GLU, link_AGL
  File "/usr/local/lib/python2.7/site-packages/pyglet/gl/lib_agl.py", line 43, in <module>
    import pyglet.lib
  File "/usr/local/lib/python2.7/site-packages/pyglet/lib.py", line 57, in <module>
    script_path = pyglet.resource.get_script_home()
  File "/usr/local/lib/python2.7/site-packages/pyglet/__init__.py", line 357, in __getattr__
    __import__(import_name)
  File "/usr/local/lib/python2.7/site-packages/pyglet/resource.py", line 93, in <module>
    import zipfile
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 6, in <module>
    import io
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module>
    import _io
ImportError: dlopen(/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
  Referenced from: /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
  Expected in: flat namespace
 in /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so

When I started it with python3 I got this

2016-06-26 15:56:25.690 Python[22764:645602] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/w1/1bjqb5zs3c9b9dv397qw91qh0000gn/T/org.python.python.savedState
Traceback (most recent call last):
  File "main.py", line 894, in <module>
    main()
  File "main.py", line 886, in main
    window = Window(width=800, height=600, caption='Pyglet', resizable=True)
  File "main.py", line 480, in __init__
    self.model = Model()
  File "main.py", line 150, in __init__
    self._initialize()
  File "main.py", line 159, in _initialize
    for x in xrange(-n, n + 1, s):
NameError: name 'xrange' is not defined

Any ideas what can be wrong?

progval commented 8 years ago

These are two different issues. The first is answered here

The second is because this project is not compatible with Python 3. Try the python3 branch of my fork

oleksii-frolov commented 8 years ago

That helped me, after I executed hash -r python Thanks