pylint PyQt4 error - python

I write a program :
from PyQt4.QtCore import *
from PyQt4.QtGui import *
def main():
app = QApplication([])
button = QPushButton("hello?")
button.show()
app.exec_()
if __name__=="__main__":
main()
the file name is t.py,
when I run:
pylint t.py
in ubuntu9.10, pyqt4,
I got this:
pylint t.py
No config file found, using default configuration
error while building astng for /home/halida/data/workspace/test/t.py
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/logilab/astng/manager.py", line 126, in astng_from_file
astng = ASTNGBuilder(self).file_build(filepath, modname)
File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 118, in file_build
node = self.string_build(data, modname, path)
File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 128, in string_build
return self.ast_build(parse(data + '\n'), modname, path)
File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 147, in ast_build
self.rebuilder.walk(node)
File "/usr/lib/pymodules/python2.6/logilab/astng/rebuilder.py", line 89, in walk
self._walk(node)
File "/usr/lib/pymodules/python2.6/logilab/astng/rebuilder.py", line 109, in _walk
self._walk(child, node)
File "/usr/lib/pymodules/python2.6/logilab/astng/rebuilder.py", line 103, in _walk
handle_leave = node.accept(self)
File "/usr/lib/pymodules/python2.6/logilab/astng/nodes.py", line 159, in accept
return func(self)
File "/usr/lib/pymodules/python2.6/logilab/astng/rebuilder.py", line 188, in visit_from
imported = node.root().import_module(node.modname)
File "/usr/lib/pymodules/python2.6/logilab/astng/scoped_nodes.py", line 282, in import_module
return MANAGER.astng_from_module_name(self.relative_name(modname, level))
File "/usr/lib/pymodules/python2.6/logilab/astng/manager.py", line 172, in astng_from_module_name
return self.astng_from_module(module, modname)
File "/usr/lib/pymodules/python2.6/logilab/astng/manager.py", line 207, in astng_from_module
astng = ASTNGBuilder(self).module_build(module, modname)
File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 80, in module_build
node = self.inspect_build(module, modname=modname, path=path)
File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 95, in inspect_build
self.object_build(node, module)
File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 195, in object_build
self.object_build(class_node, member)
File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 198, in object_build
object_build_methoddescriptor(node, member)
File "/usr/lib/pymodules/python2.6/logilab/astng/raw_building.py", line 150, in object_build_methoddescriptor
func = build_function(member.__name__, doc=member.__doc__)
AttributeError: 'PyQt4.QtCore.pyqtSignal' object has no attribute '__name__'
************* Module t
F: 1: <class 'logilab.astng._exceptions.ASTNGBuildingException'>: Unable to load module t ('PyQt4.QtCore.pyqtSignal' object has no attribute '__name__')
Compilation exited abnormally with code 1 at Sat Dec 26 10:43:54
in windows XP, with pythonxy,
I only got a error message, why?

Looks like a bug in astng. They try to read the name of a function which does not publish it (native extension func). I'd report a bug to both astng and pyqt projects. The first one would be that they should handle a no-name situation better. The second one would be that every sane extension should publish at least the function names.

I would check if you're using the very latest astng, pylint, etc.

Related

escpos erro 'usb_detach_kernel_driver_np' not found

I try to print a ticket in a thermal printer. I use module escpos
but when I run the script in Windows it sends me the following error
Traceback (most recent call last):
File "C:\Users\Angel\Desktop\Escritorio\impreimer.py", line 5, in <module>
Epson = printer.Usb(0x1a86,0x7584,1)
File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\site-packages\escpos\printer.py", line 51, in __init__
self.open()
File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\site-packages\escpos\printer.py", line 68, in open
self.device.detach_kernel_driver(0)
File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\site-packages\usb\core.py", line 1077, in detach_kernel_driver
interface)
File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\site-packages\usb\backend\libusb0.py", line 606, in detach_kernel_driver
_check(_lib.usb_detach_kernel_driver_np(dev_handle, intf))
File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 361, in __getattr__
func = self.__getitem__(name)
File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 366, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'usb_detach_kernel_driver_np' not found
[Finished in 0.5s with exit code 1]
and this is my code:
import sys
from escpos import *
pr = printer.Usb(0x1a86,0x7584)
How can i fix this?
try this.
pr = printer.Usb(0x1a86,0x7584, interface=0, in_ep=0x82, out_ep=0x02)
if you are using Windows you need use programs like zadig or LibusbK and install filters.
https://zadig.akeo.ie/
http://libusbk.sourceforge.net/UsbK3/index.html

"ImportError: Cannot import name" for a module on the path using Sphinx 1.2b3

I am using Sphinx to automatically build docs for a project I am working on. The docs were building fine, until I added another class to one of the modules. Now whenever I try to run the build, the new class is not imported.
The error from the Sphinx error log:
# Sphinx version: 1.2b3
# Python version: 2.7.3
# Docutils version: 0.9 release
# Jinja2 version: 2.6
# Loaded extensions:
# sphinxcontrib.httpdomain from C:\Python27\lib\site-packages\sphinxcontrib_httpdomain-1.2.1-py2.7.egg\sphinxcontrib\httpdomain.pyc
# sphinxcontrib.autohttp.flask from C:\Python27\lib\site-packages\sphinxcontrib_httpdomain-1.2.1-py2.7.egg\sphinxcontrib\autohttp\flask.pyc
# sphinx.ext.autodoc from C:\Python27\lib\site-packages\sphinx\ext\autodoc.pyc
# sphinx.ext.viewcode from C:\Python27\lib\site-packages\sphinx\ext\viewcode.pyc
# sphinx.ext.oldcmarkup from C:\Python27\lib\site-packages\sphinx\ext\oldcmarkup.pyc
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\sphinx\cmdline.py", line 246, in main
app.build(force_all, filenames)
File "C:\Python27\lib\site-packages\sphinx\application.py", line 212, in build
self.builder.build_update()
File "C:\Python27\lib\site-packages\sphinx\builders\__init__.py", line 214, in build_update
'out of date' % len(to_build))
File "C:\Python27\lib\site-packages\sphinx\builders\__init__.py", line 234, in build
purple, length):
File "C:\Python27\lib\site-packages\sphinx\builders\__init__.py", line 134, in status_iterator
for item in iterable:
File "C:\Python27\lib\site-packages\sphinx\environment.py", line 470, in update_generator
self.read_doc(docname, app=app)
File "C:\Python27\lib\site-packages\sphinx\environment.py", line 618, in read_doc
pub.publish()
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\core.py", line 221, in publish
self.settings)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\readers\__init__.py", line 69, in read
self.parse()
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\readers\__init__.py", line 75, in parse
self.parser.parse(self.input, document)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\parsers\rst\__init__.py", line 162, in parse
self.statemachine.run(inputlines, document, inliner=self.inliner)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\parsers\rst\states.py", line 174, in run
input_source=document['source'])
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\statemachine.py", line 239, in run
context, state, transitions)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\parsers\rst\states.py", line 2706, in underline
self.section(title, source, style, lineno - 1, messages)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\parsers\rst\states.py", line 331, in section
self.new_subsection(title, lineno, messages)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\parsers\rst\states.py", line 399, in new_subsection
node=section_node, match_titles=True)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\parsers\rst\states.py", line 286, in nested_parse
node=node, match_titles=match_titles)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\parsers\rst\states.py", line 199, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\statemachine.py", line 239, in run
context, state, transitions)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\parsers\rst\states.py", line 2706, in underline
self.section(title, source, style, lineno - 1, messages)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\parsers\rst\states.py", line 331, in section
self.new_subsection(title, lineno, messages)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\parsers\rst\states.py", line 399, in new_subsection
node=section_node, match_titles=True)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\parsers\rst\states.py", line 286, in nested_parse
node=node, match_titles=match_titles)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\parsers\rst\states.py", line 199, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\statemachine.py", line 239, in run
context, state, transitions)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\parsers\rst\states.py", line 2279, in explicit_markup
nodelist, blank_finish = self.explicit_construct(match)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\parsers\rst\states.py", line 2291, in explicit_construct
return method(self, expmatch)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\parsers\rst\states.py", line 2034, in directive
directive_class, match, type_name, option_presets)
File "C:\Python27\lib\site-packages\docutils-0.9-py2.7.egg\docutils\parsers\rst\states.py", line 2083, in run_directive
result = directive_instance.run()
File "C:\Python27\lib\site-packages\sphinxcontrib_httpdomain-1.2.1-py2.7.egg\sphinxcontrib\autohttp\flask.py", line 138, in run
for line in self.make_rst():
File "C:\Python27\lib\site-packages\sphinxcontrib_httpdomain-1.2.1-py2.7.egg\sphinxcontrib\autohttp\flask.py", line 97, in make_rst
app = import_object(self.arguments[0])
File "C:\Python27\lib\site-packages\sphinxcontrib_httpdomain-1.2.1-py2.7.egg\sphinxcontrib\autohttp\common.py", line 17, in import_object
mod = __import__(module_name)
File "E:\workspace_zach\API\api_serve.py", line 6, in <module>
from BOBI import BOBI
File "E:\workspace_zach\API\BOBI\__init__.py", line 13, in <module>
from Lib.DBVersionTools import DBVersionNormalizer, DBVersionPolisher
ImportError: cannot import name DBVersionPolisher
The module is on the path, and is within a folder with an __init__.py file. Sphinx is clearly able to import the first class, but not the second. Tests involving both classes work fine. I have deleted all of the old .pyc files, but that failed to resolve the issue. If I remove the second class from the import statement and comment out references to it, then the docs work without a problem.
Any ideas on how to fix this issue, or failing that hide the import statements from sphinx (but not other scripts, like my tests)?
Additional code:
All import statements:
import Error
import logging
import re
import Lib.globals as Globals
from flask import Blueprint, jsonify, request, current_app, make_response
from functools import update_wrapper
from datetime import timedelta
from Lib.VerifyCookie import verify, req_to_dict
from Lib.MSSQLTools import MSSQLTools
from Lib.DBVersionTools import DBVersionNormalizer, DBVersionPolisher
Sphinx extensions and path modifications:
sys.path.append('E:\\workspace_zach\\API') # Root directory for the project
extensions = [
'sphinx.ext.autodoc',
'sphinxcontrib.httpdomain',
'sphinxcontrib.autohttp.flask',
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
]
A previous version of the file, without the modifications being imported, existed on another path of the computer I was developing on, and had been added to the pythonpath.
sys.path.remove('E:\\workspace\\API') was sufficient to remove the other path and fix the problem.

Open a new instance of AutoCAD via Python

Does anyone have any experience using Python with AutoCAD? I'm just trying, as a test to see if I can open a new instance of AutoCAD via Python and though that PyAutocad worked well (feel free to offer other suggestions, if you have any).
Anyway based on the doc (https://pypi.python.org/pypi/pyautocad/#downloads) - it says these lines of code should do it, but nothing's happened as of yet.
from pyautocad import Autocad, APoint
acad = Autocad()
acad.prompt("Hello, Autocad from Python\n")
Just these lines of code should generate info on the commandline but instead results in about 50 lines worth of traceback (which I can post as well if anyone's interested) - any ideas?
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
acad.prompt("Hello, Autocad")
File "C:\Python27\lib\site-packages\pyautocad\api.py", line 153, in prompt
self.doc.Utility.Prompt(u"%s\n" % text)
File "C:\Python27\lib\site-packages\pyautocad\api.py", line 65, in doc
return self.app.ActiveDocument
File "C:\Python27\lib\site-packages\pyautocad\api.py", line 54, in app
self._app = comtypes.client.GetActiveObject('AutoCAD.Application')
File "C:\Python27\lib\site-packages\comtypes\client\__init__.py", line 180, in GetActiveObject
obj = comtypes.GetActiveObject(clsid, interface=interface)
File "C:\Python27\lib\site-packages\comtypes\__init__.py", line 1165, in GetActiveObject
oledll.oleaut32.GetActiveObject(byref(clsid), None, byref(p))
File "_ctypes/callproc.c", line 941, in GetResult
WindowsError: [Error -2147221021] Operation unavailable
After adding the VBA Module, the traceback now reads:
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
acad.prompt("Hello")
File "C:\Python27\lib\site-packages\pyautocad\api.py", line 153, in prompt
self.doc.Utility.Prompt(u"%s\n" % text)
File "C:\Python27\lib\site-packages\pyautocad\api.py", line 65, in doc
return self.app.ActiveDocument
File "C:\Python27\lib\site-packages\pyautocad\api.py", line 54, in app
self._app = comtypes.client.GetActiveObject('AutoCAD.Application')
File "C:\Python27\lib\site-packages\comtypes\client\__init__.py", line 183, in GetActiveObject
return _manage(obj, clsid, interface=interface)
File "C:\Python27\lib\site-packages\comtypes\client\__init__.py", line 188, in _manage
obj = GetBestInterface(obj)
File "C:\Python27\lib\site-packages\comtypes\client\__init__.py", line 112, in GetBestInterface
interface = getattr(mod, itf_name)
AttributeError: 'module' object has no attribute 'IAcadApplication'
Now after deleting comtypes' "gen" folder per #reclosedev, Autocad now opens but the string of text still will not appear on the command line - the traceback reads:
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
acad.prompt("Hello")
File "C:\Python27\lib\site-packages\pyautocad\api.py", line 153, in prompt
self.doc.Utility.Prompt(u"%s\n" % text)
File "C:\Python27\lib\site-packages\pyautocad\api.py", line 65, in doc
return self.app.ActiveDocument
File "C:\Python27\lib\site-packages\pyautocad\api.py", line 59, in app
self._app.Visible = self._visible
File "C:\Python27\lib\site-packages\comtypes\client\dynamic.py", line 116, in __setattr__
dispid = self._comobj.GetIDsOfNames(name)[0]
File "C:\Python27\lib\site-packages\comtypes\automation.py", line 643, in GetIDsOfNames
self.__com_GetIDsOfNames(riid_null, arr, len(names), lcid, ids)
COMError: (-2147418111, 'Call was rejected by callee.', (None, None, None, 0, None))
Have you considered IronPython?
http://through-the-interface.typepad.com/through_the_interface/2009/03/using-ironpython-with-autocad.html
Here's a quick example of how it could be leveraged:
import clr
import System
from System import Type, Activator
acApp = Activator.CreateInstance(Type.GetTypeFromProgID("AutoCAD.Application"))
acApp.Visible = 1
acApp.ActiveDocument.SendCommand("(Princ \"Hello World from Python!\")(Princ)\n")
Obviously the ProgId will correspond to whichever version of AutoCAD was opened last.

pyramid + jinja2 and new GAE runtime

I am trying to run Pyramid with Jinja2 using new Python 2.7 runtime in threadsafe mode and GAE 1.6.0 pre-release SDK. I've made modifications to my app as outlined here, i.e. I've set runtime: python27, threadsafe: true in app.yaml and got rid of main() function. When I generate response by myself it works fine, but when I try to bring jinja2 into the equation, I get the following exception:
ERROR 2011-11-07 00:10:34,356 wsgi.py:170]
Traceback (most recent call last):
File "/gae/google/appengine/runtime/wsgi.py", line 168, in Handle
[...]
File "/myapp/source/myapp-tip/main.py", line 29, in <module>
config.include('pyramid_jinja2')
File "/myapp/source/myapp-tip/lib/dist/pyramid/config/__init__.py", line 616, in include
c(configurator)
File "lib/dist/pyramid_jinja2/__init__.py", line 390, in includeme
_get_or_build_default_environment(config.registry)
File "/lib/dist/pyramid_jinja2/__init__.py", line 217, in _get_or_build_default_environment
_setup_environment(registry)
File "/lib/dist/pyramid_jinja2/__init__.py", line 253, in _setup_environment
package = _caller_package(('pyramid_jinja2', 'jinja2', 'pyramid.config'))
File "/lib/dist/pyramid_jinja2/__init__.py", line 136, in caller_package
for t in self.inspect.stack():
File "/usr/lib/python2.7/inspect.py", line 1056, in stack
return getouterframes(sys._getframe(1), context)
File "/usr/lib/python2.7/inspect.py", line 1034, in getouterframes
framelist.append((frame,) + getframeinfo(frame, context))
File "/usr/lib/python2.7/inspect.py", line 1009, in getframeinfo
lines, lnum = findsource(frame)
File "/usr/lib/python2.7/inspect.py", line 534, in findsource
module = getmodule(object, file)
File "/usr/lib/python2.7/inspect.py", line 506, in getmodule
main = sys.modules['__main__']
KeyError: '__main__'
I tried to mess around a bit with pyramid_jinja2 code to work around this issue, only to be left with another exception:
ERROR 2011-11-04 12:06:38,720 wsgi.py:170]
Traceback (most recent call last):
File "/gae/google/appengine/runtime/wsgi.py", line 168, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
[...]
File "/myapp/source/myapp-tip/main.py", line 29, in <module>
config.add_jinja2_search_path("templates")
File "/myapp/source/myapp-tip/lib/dist/pyramid/config/util.py", line 28, in wrapper
result = wrapped(self, *arg, **kw)
File "/lib/dist/pyramid_jinja2/__init__.py", line 311, in add_jinja2_search_path
env.loader.searchpath.append(abspath_from_resource_spec(d))
File "/myapp/source/myapp-tip/lib/dist/pyramid/asset.py", line 38, in abspath_from_asset_spec
return pkg_resources.resource_filename(pname, filename)
File "/myapp/source/myapp-tip/pkg_resources.py", line 840, in resource_filename
return get_provider(package_or_requirement).get_resource_filename(
File "/myapp/source/myapp-tip/pkg_resources.py", line 160, in get_provider
__import__(moduleOrReq)
File "/gae/google/appengine/tools/dev_appserver_import_hook.py", line 640, in Decorate
return func(self, *args, **kwargs)
File "/gae/google/appengine/tools/dev_appserver_import_hook.py", line 1756, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "/gae/google/appengine/tools/dev_appserver_import_hook.py", line 640, in Decorate
return func(self, *args, **kwargs)
File "/gae/google/appengine/tools/dev_appserver_import_hook.py", line 1628, in FindAndLoadModule
description)
File "/gae/google/appengine/tools/dev_appserver_import_hook.py", line 640, in Decorate
return func(self, *args, **kwargs)
File "/gae/google/appengine/tools/dev_appserver_import_hook.py", line 1571, in LoadModuleRestricted
description)
ImportError: Cannot re-init internal module __main__
I'd be happy if anybody could shed some light on what pyramid is trying to do under the hood. Judging by the latter stack trace it seems it's trying to resolve an asset, but why is it trying to reload __main__? I'm not even sure my problem is caused by pyramid or GAE.
Thanks for any insight on this issue.
I'm not familiar with pyramid, but the problem really does seem to be with this line:
config.include('pyramid_jinja2')
Whatever that config thing is, it seems to be doing some dynamic import magic.
Don't do that.
The app engine environment doesn't handle imports the way you would in normal python. Step through that line with a debugger and you'll wind up in the replacement version of the import system, which you'll soon see, only implements a small part of what real python does.
If possible, just use a normal import statement... Otherwise, you're going to have to dig into config.include and get it to play nice with the restricted importing features on GAE.
I managed to make it work using Pyramid 1.3's AssetResolver. First attempt is here. Just not sure what the lifetime/scope of the resolver should be in this case, I will figure it out later.
In pyramid_jinja2/__init__.py add the following code before _get_or_build_default_environment()
class VirtualModule(object):
def __init__(self,name):
import sys
sys.modules[name]=self
def __getattr__(self,name):
return globals()[name]
VirtualModule("__main__")
def _get_or_build_default_environment(registry):
(http://www.inductiveautomation.com/forum/viewtopic.php?f=70&p=36917)

help('modules') crashing? Not sure how to fix

I was trying to install a module for opencv and added an opencv.pth file to the folder beyond my sites.py file. I have since deleted it and no change.
When I try to run help('modules'), I get the following error:
Please wait a moment while I gather a
list of all available modules...
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/twisted/words/im/init.py:8:
UserWarning: twisted.im will be
undergoing a rewrite at some point in
the future.
warnings.warn("twisted.im will be
undergoing a rewrite at some point in
the future.")
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py:110:
DeprecationWarning: The wxPython
compatibility package is no longer
automatically generated or actively
maintained. Please switch to the wx
package as soon as possible.
import(name) Traceback (most recent call last): File "",
line 1, in File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site.py",
line 348, in call
return pydoc.help(*args, **kwds) File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py",
line 1644, in call
self.help(request) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py",
line 1681, in help
elif request == 'modules': self.listmodules() File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py",
line 1802, in listmodules
ModuleScanner().run(callback) File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py",
line 1853, in run
for importer, modname, ispkg in pkgutil.walk_packages(): File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py",
line 110, in walk_packages
import(name) File "/BinaryCache/wxWidgets/wxWidgets-11~262/Root/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/wxaddons/init.py",
line 180, in import_hook File
"/Library/Python/2.5/site-packages/ctypes_opencv/init.py",
line 19, in
from ctypes_opencv.cv import * File
"/BinaryCache/wxWidgets/wxWidgets-11~262/Root/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/wxaddons/init.py",
line 180, in import_hook File
"/Library/Python/2.5/site-packages/ctypes_opencv/cv.py",
line 2567, in ('desc', CvMat_r, 1), # CvMat* desc File
"/Library/Python/2.5/site-packages/ctypes_opencv/cxcore.py",
line 114, in cfunc
return CFUNCTYPE(result, *atypes)((name, dll), tuple(aflags)) AttributeError: dlsym(0x2674d10, cvCreateFeatureTree): symbol not found
What gives?!
This happens because help('modules') imports all modules, which can result in a lot of unsentineled code being executed. There's nothing you can do short of reporting bugs in every single package that causes this (opencv in this case) and wait for them to fix it.

Categories

Resources