Note that there are some explanatory texts on larger screens.

plurals
  1. PORun python as a 32-bit process in Eclipse PyDev on Mac OS X Lion
    text
    copied!<p>I have installed pyglet onto Mac OS X 10.7.4 using MacPorts.</p> <p>pyglet only works when built for 32-bit archs so in order to use it I must run python from the command line like this,</p> <pre><code>arch -i386 /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python </code></pre> <p>And then I can successfully run the <a href="http://pyglet.org/doc/programming_guide/hello_world.html" rel="nofollow">pyglet "hello world" program</a>. </p> <p>However, I like to use PyDev in Eclipse but I cannot work out how to configure PyDev to run python as a 32-bit process. </p> <p>I have added the MacPorts python, </p> <pre><code>/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python </code></pre> <p>as a Python interpreter (Preferences > Pydev > Interpreter - Python). I have created a new project and set the MacPorts python as the project's interpreter. But when I run the <a href="http://pyglet.org/doc/programming_guide/hello_world.html" rel="nofollow">pyglet "hello world" program</a> from within this project, I get the following error</p> <pre><code>pydev debugger: starting Traceback (most recent call last): File "/Applications/eclipse/plugins/org.python.pydev.debug_1.6.2.2010090812/pysrc/pydevd.py", line 1145, in &lt;module&gt; debugger.run(setup['file'], None, None) File "/Applications/eclipse/plugins/org.python.pydev.debug_1.6.2.2010090812/pysrc/pydevd.py", line 916, in run execfile(file, globals, locals) #execute the script File "/Users/andrewfogg/Dropbox/EnvironmentalArt/src/art.py", line 2, in &lt;module&gt; window = pyglet.window.Window() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pyglet/__init__.py", line 306, in __getattr__ __import__(import_name) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pyglet/window/__init__.py", line 1669, in &lt;module&gt; from pyglet.window.carbon import CarbonPlatform, CarbonWindow File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pyglet/window/carbon/__init__.py", line 69, in &lt;module&gt; framework='/System/Library/Frameworks/QuickTime.framework') File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pyglet/lib.py", line 90, in load_library return self.load_framework(kwargs['framework']) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pyglet/lib.py", line 226, in load_framework lib = ctypes.cdll.LoadLibrary(realpath) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/__init__.py", line 431, in LoadLibrary return self._dlltype(name) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/__init__.py", line 353, in __init__ self._handle = _dlopen(self._name, mode) OSError: dlopen(/System/Library/Frameworks/QuickTime.framework/QuickTime, 6): no suitable image found. Did find: /System/Library/Frameworks/QuickTime.framework/QuickTime: mach-o, but wrong architecture /System/Library/Frameworks/QuickTime.framework/QuickTime: mach-o, but wrong architecture </code></pre> <p>Which would indicate that PyDev is running python as a 64-bit process. </p> <p>I can see that I can have my python interpreter set environment variables (Preferences > Pydev > Interpreter - Python > Environment) but I am not sure how to correctly configure this (I have tried). </p> <p>The question is: how do I run python as a 32-bit process in PyDev?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload