[MacPorts] #26186: python25-2.5.5 NameError: name 'ctypes' is not defined
#26186: python25-2.5.5 NameError: name 'ctypes' is not defined ----------------------------------+----------------------------------------- Reporter: joe.paxton@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: python25, ctypes | Port: python25 @2.5.5 ----------------------------------+----------------------------------------- Mac OS X 10.6.4 Xcode 3.2.2 When attempting to get a list of installed modules (help('modules')) in python25, I'm getting the following error message: NameError: name 'ctypes' is not defined The problem does not appear to be an upstream issue, as the version of python 2.5 that comes pre-installed in Snow Leopard doesn't The full traceback follows: {{{ Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site.py", line 346, in __call__ return pydoc.help(*args, **kwds) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1646, in __call__ self.help(request) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1683, in help elif request == 'modules': self.listmodules() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1804, in listmodules ModuleScanner().run(callback) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1855, in run for importer, modname, ispkg in pkgutil.walk_packages(): File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py", line 125, in walk_packages for item in walk_packages(path, name+'.', onerror): File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py", line 110, in walk_packages __import__(name) File "/opt/local/lib/python2.5/site- packages/PsychoPy-1.62.00-py2.5.egg/psychopy/ext/__init__.py", line 18, in <module> from darwin import * File "/opt/local/lib/python2.5/site- packages/PsychoPy-1.62.00-py2.5.egg/psychopy/ext/darwin.py", line 16, in <module> kCGLCPSwapInterval= ctypes.c_int(222) NameError: name 'ctypes' is not defined }}} -- Ticket URL: <http://trac.macports.org/ticket/26186> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26186: python25-2.5.5 NameError: name 'ctypes' is not defined ----------------------------------+----------------------------------------- Reporter: joe.paxton@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: python25, ctypes | Port: python25 @2.5.5 ----------------------------------+----------------------------------------- Comment(by joe.paxton@…): Sorry for the double submission. Please ignore the first one (#26185). -- Ticket URL: <http://trac.macports.org/ticket/26186#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26186: python25-2.5.5 NameError: name 'ctypes' is not defined ----------------------------------+----------------------------------------- Reporter: joe.paxton@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: python25, ctypes | Port: python25 @2.5.5 ----------------------------------+----------------------------------------- Comment(by joe.paxton@…): And please let me know if this is better categorized as a bug with PsychoPy, and I'll submit a ticket to that package's maintainer. -- Ticket URL: <http://trac.macports.org/ticket/26186#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26186: python25 @2.5.5 + PsychoPy: NameError: name 'ctypes' is not defined ----------------------------------+----------------------------------------- Reporter: joe.paxton@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: python25 py25-psychopy ----------------------------------+----------------------------------------- Changes (by jmr@…): * cc: joe.paxton@… (removed) * cc: jwa@…, jameskyle@… (added) * keywords: python25, ctypes => * port: python25 @2.5.5 => python25 py25-psychopy Comment: Please remember to cc the maintainer, and note that you do not need to be in cc when you are the reporter. -- Ticket URL: <http://trac.macports.org/ticket/26186#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26186: python25 @2.5.5 + PsychoPy: NameError: name 'ctypes' is not defined ----------------------------------+----------------------------------------- Reporter: joe.paxton@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: python25 py25-psychopy ----------------------------------+----------------------------------------- Comment(by joe.paxton@…): The traceback I originally submitted was for the wrong version of psychopy. Here is the correct traceback: {{{ Traceback (most recent call last): File "./simpleExp.py", line 4, in <module> from psychopy import visual, core, event File "/opt/local/lib/python2.5/site-packages/psychopy/visual.py", line 8, in <module> from psychopy import core, ext, log, preferences, monitors File "/opt/local/lib/python2.5/site-packages/psychopy/core.py", line 8, in <module> from ext import rush File "/opt/local/lib/python2.5/site-packages/psychopy/ext/__init__.py", line 11, in <module> from darwin import * File "/opt/local/lib/python2.5/site-packages/psychopy/ext/darwin.py", line 5, in <module> import sys, ctypes, ctypes.util, time File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ctypes/__init__.py", line 10, in <module> from _ctypes import Union, Structure, Array ImportError: No module named _ctypes }}} However, given that I'm getting the same error with both versions of psychopy (both the Macports version and the most recent version installed thru easy_install), perhaps this is actually an upstream problem? If so, feel free to close this ticket, and I'll submit the bug to the psychopy devs. -- Ticket URL: <http://trac.macports.org/ticket/26186#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26186: python25: No module named _ctypes ----------------------------------+----------------------------------------- Reporter: joe.paxton@… | Owner: jwa@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: python25 ----------------------------------+----------------------------------------- Changes (by ryandesign@…): * cc: jwa@… (removed) * cc: ryandesign@… (added) * owner: macports-tickets@… => jwa@… * port: python25 py25-psychopy => python25 Comment: Indeed, python25 does not install the ctypes module, though it should, and though other ports rightly expect it to. python25 installs without error, but if you look in the verbose build output, it says: {{{ *** WARNING: renaming "_ctypes" since importing it failed: dlopen(build/lib.macosx-10.6-i386-2.5/_ctypes.so, 2): Symbol not found: _ffi_call Referenced from: /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_python25/work/Python-2.5.5/build/lib.macosx-10.6-i386-2.5/_ctypes.so Expected in: flat namespace in /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_python25/work/Python-2.5.5/build/lib.macosx-10.6-i386-2.5/_ctypes.so }}} -- Ticket URL: <https://trac.macports.org/ticket/26186#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26186: python25: No module named _ctypes ----------------------------------+----------------------------------------- Reporter: joe.paxton@… | Owner: jwa@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: python25 ----------------------------------+----------------------------------------- Comment(by jmr@…): It appears that the bundled libffi, like many other things in python < 2.6, doesn't work right on 64-bit OS X. Fixing this would likely require considerable effort and involve a lot of the changes that went into python 2.6. Unless a patch turns up, I think the maintainer should feel free to resolve this as wontfix. -- Ticket URL: <https://trac.macports.org/ticket/26186#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26186: python25: No module named _ctypes ---------------------------+-------------------- Reporter: joe.paxton@… | Owner: jwa@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Resolution: wontfix | Keywords: Port: python25 | ---------------------------+-------------------- Changes (by jwa@…): * status: new => closed * resolution: => wontfix Comment: I’ll close this, current Python 2.x being 2.7, it should be used, if 2 series Python must be used -- Ticket URL: <https://trac.macports.org/ticket/26186#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts