First program, First problem

29 views
Skip to first unread message

new2Cocos

unread,
Apr 25, 2010, 2:30:05 PM4/25/10
to cocos2d discuss
Hi everybody,

I'm a mac user, I have a mac os x 10.4.11. my mac come with a python
2.3 on it. to use cocos, I installed python 2.5.5 with the source code
(./configure, make, make install) and then I installed pyglet 1.1.4
from the shell using the command
$ python setup.py install

everything went well but troubles began with the cocos hello world. I
copied cocos folder to my project directory where i have my hello
world and the compiled my code with

$ python hello_world.py

but I got the error


Traceback (most recent call last):
File "hello_world.py", line 11, in <module>
import cocos
File "/Users/abdellahchkifa/Desktop/MyFirstCocosApp/cocos/
__init__.py", line 67, in <module>
import actions
File "/Users/abdellahchkifa/Desktop/MyFirstCocosApp/cocos/actions/
__init__.py", line 36, in <module>
from basegrid_actions import *
File "/Users/abdellahchkifa/Desktop/MyFirstCocosApp/cocos/actions/
basegrid_actions.py", line 61, in <module>
from pyglet.gl import *
File "/usr/local/lib/python2.5/site-packages/pyglet/gl/__init__.py",
line 510, in <module>
import pyglet.window
File "/usr/local/lib/python2.5/site-packages/pyglet/window/
__init__.py", line 1684, in <module>
gl._create_shadow_window()
File "/usr/local/lib/python2.5/site-packages/pyglet/gl/__init__.py",
line 494, in _create_shadow_window
_shadow_window = Window(width=1, height=1, visible=False)
File "/usr/local/lib/python2.5/site-packages/pyglet/window/
__init__.py", line 626, in __init__
display = get_platform().get_default_display()
File "/usr/local/lib/python2.5/site-packages/pyglet/window/carbon/
__init__.py", line 108, in get_default_display
self._display = CarbonDisplay()
File "/usr/local/lib/python2.5/site-packages/pyglet/window/carbon/
__init__.py", line 120, in __init__
raise CarbonException('Window manager is not available. ' \
pyglet.window.carbon.CarbonException: Window manager is not
available. Ensure you run "pythonw", not "python"


I guess the problem is that python couldn't launch the display (3 last
lines) then I tried


$ pythonw hello_world.py

as suggested but this time I got


Traceback (most recent call last):
File "hello_world.py", line 11, in ?
import cocos
File "/Users/abdellahchkifa/Desktop/MyFirstCocosApp/cocos/
__init__.py", line 62, in ?
import os, pyglet
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/site-packages/pyglet/__init__.py", line 69, in ?
_require_ctypes_version('1.0.0')
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/site-packages/pyglet/__init__.py", line 64, in
_require_ctypes_version
import ctypes
ImportError: No module named ctypes


notice that this time, pythonw looks for frameworks in the python2.3
version directory, weird.

a detailed help would be appreciated, I'm a total beginner to python,
pyglet and cocos.

best regards.


--
You received this message because you are subscribed to the Google Groups "cocos2d discuss" group.
To post to this group, send email to cocos-...@googlegroups.com.
To unsubscribe from this group, send email to cocos-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cocos-discuss?hl=en.

claudio canepa

unread,
Apr 25, 2010, 2:49:26 PM4/25/10
to cocos-...@googlegroups.com


On Sun, Apr 25, 2010 at 3:30 PM, new2Cocos <bch...@gmail.com> wrote:
Hi everybody,

 
[snip] 
I guess the problem is that python couldn't launch the display (3 last
lines) then I tried


$ pythonw hello_world.py

as suggested but this time I got


Traceback (most recent call last):
 File "hello_world.py", line 11, in ?
   import cocos
 File "/Users/abdellahchkifa/Desktop/MyFirstCocosApp/cocos/
__init__.py", line 62, in ?
   import os, pyglet
 File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/site-packages/pyglet/__init__.py", line 69, in ?
   _require_ctypes_version('1.0.0')
 File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/site-packages/pyglet/__init__.py", line 64, in
_require_ctypes_version
   import ctypes
ImportError: No module named ctypes


notice that this time, pythonw looks for frameworks in the python2.3
version directory, weird.

a detailed help would be appreciated, I'm a total beginner to python,
pyglet and cocos.

best regards.


 

note that in your second try you got python 2.3, which don't have the module ctypes.

--
claudio

 

claudio canepa

unread,
Apr 25, 2010, 2:51:15 PM4/25/10
to cocos-...@googlegroups.com
Oh, sorry, you have noted that.

claudio canepa

unread,
Apr 25, 2010, 3:02:29 PM4/25/10
to cocos-...@googlegroups.com
On Sun, Apr 25, 2010 at 3:30 PM, new2Cocos <bch...@gmail.com> wrote:
Well, the exception comes from  pyglet.
The pyglet samples that comes with the docs runs ok ?
you can get the docs and examples at:
( look in the features downloads, to the right)

And, note that there there are also pyglet binaries for macs.
Should the pyglet demos not run, you can try the binaries ( or post the failure in the pyglet list, which has more readers)
 
--
claudio

new2Cocos

unread,
Apr 25, 2010, 3:30:58 PM4/25/10
to cocos2d discuss
I installed pyglet binaries but still getting the same error messages.
I also run a pyglet sample from the exapmles folder but still I got
exactly the same error message.
the I rebuild pyglet using python, I got a permission denied but I
logged as the root and it seems to work "I did this earlier, just
being more precise". that the proof that everything went well.

running install
running build
running build_py
running install_lib
copying build/lib/.DS_Store -> /usr/local/lib/python2.5/site-packages
copying build/lib/pyglet/.DS_Store -> /usr/local/lib/python2.5/site-
packages/pyglet
running install_egg_info
Removing /usr/local/lib/python2.5/site-packages/pyglet-1.1.4-py2.5.egg-
info
Writing /usr/local/lib/python2.5/site-packages/pyglet-1.1.4-py2.5.egg-
info

I'll try to ask pyglet people. I hope I'll got an answers.

thank you

Richard Jones

unread,
Apr 25, 2010, 6:56:47 PM4/25/10
to cocos-...@googlegroups.com
On Mon, Apr 26, 2010 at 4:30 AM, new2Cocos <bch...@gmail.com> wrote:
> I'm a mac user, I have a mac os x 10.4.11. my mac come with a python
> 2.3 on it. to use cocos, I installed python 2.5.5 with the source code
> (./configure, make, make install) and then I installed pyglet 1.1.4
> from the shell using the command

Check whether your build of python 2.5.5 included a pythonw and if it
did try running it direclty (full path). If it didn't you might want
to try installing ActivePython instead.


Richard

new2Cocos

unread,
Apr 25, 2010, 7:24:59 PM4/25/10
to cocos2d discuss
I installed the activepython 2.5.5.7 (a .dmg) and then I rebuilded the
pyglet with the command "python setup.py install" and now it's
working. it's odd that in the cocos website there is no reference to
activpython.

thank you so much
Reply all
Reply to author
Forward
0 new messages