I installed cocos2d today on OS X Lion, but whenever I try to import cocos in the Python interpreter, I get a bunch of import errors.
File "", line 1, in File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/site-packages/cocos2d-0.5.0-py2.7.egg/cocos/init.py",
line 105, in
import_all() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/site-packages/cocos2d-0.5.0-py2.7.egg/cocos/init.py",
line 89, in import_all
import actions File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/site-packages/cocos2d-0.5.0-py2.7.egg/cocos/actions/
init.py", line 37, in
from basegrid_actions import * File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/site-packages/cocos2d-0.5.0-py2.7.egg/cocos/actions/
basegrid_actions.py", line 62, in
from pyglet.gl import * File "build/bdist.macosx-10.6-intel/egg/pyglet/gl/init.py", line 510,
in File
"build/bdist.macosx-10.6-intel/egg/pyglet/window/init.py", line
1669, in File
"build/bdist.macosx-10.6-intel/egg/pyglet/window/carbon/
init.py", line 69, in File "build/bdist.macosx-10.6-intel/egg/pyglet/lib.py", line 90, in
load_library File
"build/bdist.macosx-10.6-intel/egg/pyglet/lib.py", line 226, in
load_framework File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/ctypes/init.py", line 431, in LoadLibrary
return self._dlltype(name) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/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
Since I can't fix it, I'd like to remove cocos2d entirely. The problem is that I can't seem to find a guide anywhere that details how to remove it from the Python installation.
Any help regarding either of these problems is greatly appreciated.
You could fix it.
The problem comes from the fact that cocos2D is built on top of Pyglet, and the stable release of pyglet does not yet support Mac OS X 64 bits architecture. You have to use the 1.2 release of pyglet or later, which by now is not released yet.
A workaround is to remove any existing Pyglet install:
pip uninstall piglet
Then install the latest Pyglet from the mercurial repository
pip install hg+https://pyglet.googlecode.com/hg/
Related
all,
I've installed the package:pywinauto successfully with "pip install pywinauto", but it always fails, why?
I did it in this way:
pip install pywinauto
and then under the windows cmd env, I run the python:
and then:
import pywinauto
I got the following errors:
....
>>> import pywinauto
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\pywinauto\__init__.py", line 40, in <module>
from . import findwindows
File "C:\Python27\lib\site-packages\pywinauto\findwindows.py", line 42, in <module>
from . import controls
File "C:\Python27\lib\site-packages\pywinauto\controls\__init__.py", line 36,in <module>
from . import uiawrapper # register "uia" back-end (at the end of uiawrapper module)
File "C:\Python27\lib\site-packages\pywinauto\controls\uiawrapper.py", line 44, in <module>
from ..uia_defines import IUIA
File "C:\Python27\lib\site-packages\pywinauto\uia_defines.py", line 175, in <module>
pattern_ids = _build_pattern_ids_dic()
File "C:\Python27\lib\site-packages\pywinauto\uia_defines.py", line 163, in _build_pattern_ids_dic
if hasattr(IUIA().ui_automation_client, cls_name):
File "C:\Python27\lib\site-packages\pywinauto\uia_defines.py", line 50, in __call__
cls._instances[cls] = super(_Singleton, cls).__call__(*args, **kwargs)
File "C:\Python27\lib\site-packages\pywinauto\uia_defines.py", line 60, in __init__
self.UIA_dll = comtypes.client.GetModule('UIAutomationCore.dll')
File "C:\Python27\lib\site-packages\comtypes\client\_generate.py", line 97, in GetModule
tlib = comtypes.typeinfo.LoadTypeLibEx(tlib)
File "C:\Python27\lib\site-packages\comtypes\typeinfo.py", line 485, in LoadTypeLibEx
_oleaut32.LoadTypeLibEx(c_wchar_p(szFile), regkind, byref(ptl))
File "_ctypes/callproc.c", line 950, in GetResult
WindowsError: [Error -2147312566] Error loading type library/DLL
It looks like you're using old OS Windows version like Windows XP. MS UI Automation is included into Windows Vista and later. But you may install .NET Framework 3.0+ to get UIAutomationCore.dll available even on Windows XP. If you don't need MS UI Automation technology at all, just run pip uninstall comtypes and pywinauto will work with Win32 API only.
If installing .NET Framework 3.0+ doesn't help (or if it's already installed) and you need to use Win XP, install Windows update KB971513. It solved the loading library issue for me.
I need upgrade the Winxp to Win7 or Win8, or Win10.
I have just installed Anaconda3-2.3.0-Windows-x86_64. Previously I was using
Anaconda-2.0.1-Windows-x86 (32-bit). I have both Anaconda and Anaconda3 folders (this is a machine at work, so I need to keep both for backward compatibility).
Then, I set in Spyder's Console Preferences to have it look for python.exe and scientfic_startup.py in the Ananconda3 folder, instead of Anaconda.
Then, when I start Spyder, it gets the following error related to zmq. It seems to keep looking for files in the old Anaconda folder, and not in the new Anaconda3 folder. Will the problem go away if it looks for things in Anaconda3, and, if so, how can I get Spyder to look for it in Anaconda3?
"C:\AppData\Local\Continuum\Anaconda\lib\site‑packages\spyderlib\widgets\externalshell\start_ipython_kernel.py", line 167, in from IPython.kernel.zmq.kernelapp import IPKernelApp
File "C:\AppData\Local\Continuum\Anaconda\lib\site‑packages\IPytho \kernel\__init__.py", line 4, in from . import zmq
File "C:\AppData\Local\Continuum\Anaconda\lib\site‑packages\IPytho \kernel\zmq\__init__.py", line 8, in check_for_zmq('13', 'IPython.kernel.zmq')
File "C:\AppData\Local\Continuum\Anaconda\lib\site‑packages\IPytho\utils\zmqrelated.py", line 10, in check_for_zmq import zmq
File "C:\Users\O629626\AppData\Local\Continuum\Anacond\lib\site‑packages\zmq\__init__.py", line 42, in _libsodium = ctypes.cdll.LoadLibrary(bundled_sodium[0])
File "C:\Users\O629626\AppData\Local\Continuum\Anaconda3\lib\ctypes\__init__.py", line 429, in LoadLibrary
return self._dlltype(name)
File "C:\Users\O629626\AppData\Local\Continuum\Anaconda3\lib\ctype \__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
Opening the default Spyder associated with the specific Anaconda resolved the issue.
I am a bit of a newbie to the command line. I used to have IPython (with all dependencies configured) on my last MacBook, such that I could click on an icon from the dash to launch iPython qtconsole (outside of terminal shell).
Now, on my new MacBook Pro, after installing all of the same files and dependencies, I am getting:
Jacobs-MacBook-Pro:~ Jacob$ ipython qtconsole
Traceback (most recent call last):
File "/usr/local/bin/ipython", line 8, in <module>
load_entry_point('ipython==1.0.dev', 'console_scripts', 'ipython')()
File "/Library/Python/2.7/site-packages/ipython-1.0.dev-py2.7.egg/IPython/frontend/terminal/ipapp.py", line 390, in launch_new_instance
app.initialize()
File "<string>", line 2, in initialize
File "/Library/Python/2.7/site-packages/ipython-1.0.dev-py2.7.egg/IPython/config/application.py", line 84, in catch_config_error
return method(app, *args, **kwargs)
File "/Library/Python/2.7/site-packages/ipython-1.0.dev-py2.7.egg/IPython/frontend/terminal/ipapp.py", line 315, in initialize
super(TerminalIPythonApp, self).initialize(argv)
File "<string>", line 2, in initialize
File "/Library/Python/2.7/site-packages/ipython-1.0.dev-py2.7.egg/IPython/config/application.py", line 84, in catch_config_error
return method(app, *args, **kwargs)
File "/Library/Python/2.7/site-packages/ipython-1.0.dev-py2.7.egg/IPython/core/application.py", line 323, in initialize
self.parse_command_line(argv)
File "/Library/Python/2.7/site-packages/ipython-1.0.dev-py2.7.egg/IPython/frontend/terminal/ipapp.py", line 310, in parse_command_line
return super(TerminalIPythonApp, self).parse_command_line(argv)
File "<string>", line 2, in parse_command_line
File "/Library/Python/2.7/site-packages/ipython-1.0.dev-py2.7.egg/IPython/config/application.py", line 84, in catch_config_error
return method(app, *args, **kwargs)
File "/Library/Python/2.7/site-packages/ipython-1.0.dev-py2.7.egg/IPython/config/application.py", line 429, in parse_command_line
return self.initialize_subcommand(subc, subargv)
File "<string>", line 2, in initialize_subcommand
File "/Library/Python/2.7/site-packages/ipython-1.0.dev-py2.7.egg/IPython/config/application.py", line 84, in catch_config_error
return method(app, *args, **kwargs)
File "/Library/Python/2.7/site-packages/ipython-1.0.dev-py2.7.egg/IPython/config/application.py", line 361, in initialize_subcommand
subapp = import_item(subapp)
File "/Library/Python/2.7/site-packages/ipython-1.0.dev-py2.7.egg/IPython/utils/importstring.py", line 40, in import_item
module = __import__(package,fromlist=[obj])
File "/Library/Python/2.7/site-packages/ipython-1.0.dev-py2.7.egg/IPython/frontend/qt/console/qtconsoleapp.py", line 56, in <module>
from IPython.external.qt import QtCore, QtGui
File "/Library/Python/2.7/site-packages/ipython-1.0.dev-py2.7.egg/IPython/external/qt.py", line 23, in <module>
QtCore, QtGui, QtSvg, QT_API = load_qt(api_opts)
File "/Library/Python/2.7/site-packages/ipython-1.0.dev-py2.7.egg/IPython/external/qt_loaders.py", line 241, in load_qt
result = loaders[api]()
File "/Library/Python/2.7/site-packages/ipython-1.0.dev-py2.7.egg/IPython/external/qt_loaders.py", line 171, in import_pyqt4
from PyQt4 import QtGui, QtCore, QtSvg
ImportError: dlopen(/Library/Python/2.7/site-packages/PyQt4/QtGui.so, 2): Library not loaded: /usr/local/lib/QtGui.framework/Versions/4/QtGui
Referenced from: /Library/Python/2.7/site-packages/PyQt4/QtGui.so
Reason: image not found
and, again being a newbie, I think part of the problem may rely on the output, here:
Jacobs-MacBook-Pro:~ Jacob$ brew install qt
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
Warning: qt-4.8.4 already installed, it's just not linked
Thanks in an advance for any tips. And if you need me to run any command (to view more outputs) just let me know!
So, you have multiple Python installations, and aren't sure which one you have.
You have both Homebrew and MacPorts.
Your MacPorts is broken and you don't know how to fix it.
Fixing each of these may not be that hard, but I think it's time to wipe the slate clean and start over.
The "easy" way to do this is to reinstall the OS, using the standard backup-and-migrate stuff to preserve your Aqua-level apps, user preferences, documents, etc. But that's pretty drastic, and shouldn't be necessary.
To clean things up manually, first:
Uninstall MacPorts.
brew uninstall $(brew list). This removes all Homebrew packages. You could just unlink instead of uninstall, but you really want to rebuild them once your machine is cleaned up.
sudo rm -rf /Library/Python /Library/Frameworks/Python.framework /usr/local/share/python*. This wipes out most third-party Python installations. And if you don't know where yours came from, it's really the best you can do.
Take a look at whatever's left in /usr/local/bin. All kinds of stuff can end up here, from scripts installed with Apple's Python to the command-line tools for GUI apps like TextMate, Aquamacs, or GitHub to the tools that come with binary installs of SDL or Qt, so you may not want to just wipe out the whole thing—but you do want to look it all over. Also look at /usr/local/lib and /Library/Frameworks.
You also may need to edit your ~/.profile, etc. files to undo changes you or those installers may have made, like adding /opt/local/bin or /Library/Frameworks/Python.framework/Versions/2.7/bin to your PATH. There could also be changes in /etc, but that's less likely (and less likely to cause problems).
Now run brew doctor to make sure Homebrew is happy, reinstall any non-Python-related Homebrew packages and binary installers you want, and now you're ready to install/configure your python, PyQt4-or-PySide, iPython, etc. properly and live happily every after (until you buy a new computer next year).
This is probably a simple problem. But I downloaded the pywiiuse library from here and I also downloaded the examples. However when I try to run one of the examples I end up with import issues. I'm not certain I have everything configured properly to run. One error I receive when trying to run example.py:
Press 1&2
Traceback (most recent call last):
File "example.py", line 73, in <module>
wiimotes = wiiuse.init(nmotes)
File "/home/thed0ctor/Descargas/wiiuse-0.12/wiiuse/__init__.py", line 309, in init
dll = ctypes.cdll.LoadLibrary('libwiiuse.so')
File "/usr/lib/python2.7/ctypes/__init__.py", line 431, in LoadLibrary
return self._dlltype(name)
File "/usr/lib/python2.7/ctypes/__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
OSError: libwiiuse.so: cannot open shared object file: No such file or directory
I'm really just starting out with this library and don't really see any documentation on how to configure pywiiuse so any help is much appreciated.
The pywiiuse library is a Python wrapper for the wiiuse C library.
Before you can use the wrapper you will first need to install the library it wraps, choose the newest version from this download page and download the appropriate installation package for you system (probably the .tar.gz since you appear to be on Linux).
add the link of libwiiuse.so to /usr/local/lib.
I also ran into this situation, I konw why it happies, but I don't konw the deep reason.
I have Mercurial 1.8.1, Python 2.6.6 installed on Win 2k8 R2 running on a vm. I have tried installing from msi, source and using tortisehg. Command-line Hg works fine but I get the same error when running the hgweb.cgi:
Traceback (most recent call last):
File ".\hgweb.cgi", line 17, in
application = hgweb(config)
File "mercurial\hgweb\__init__.pyc", line 26, in hgweb
File "mercurial\hgweb\hgwebdir_mod.pyc", line 61, in __init__
File "mercurial\hgweb\hgwebdir_mod.pyc", line 70, in refresh
File "mercurial\ui.pyc", line 35, in __init__
File "mercurial\demandimport.pyc", line 75, in __getattribute__
File "mercurial\demandimport.pyc", line 47, in _load
File "mercurial\util.pyc", line 576, in
File "mercurial\demandimport.pyc", line 85, in _demandimport
File "mercurial\windows.pyc", line 21, in
File "mercurial\demandimport.pyc", line 75, in __getattribute__
File "mercurial\demandimport.pyc", line 47, in _load
File "mercurial\osutil.pyc", line 12, in
File "mercurial\osutil.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.
The other answers I have found on SO and elsewhere pointed me to try installing from source, dropping the pure osutil into the install, or installing an older version. I have tried them all.
This is especially frustrating because I have other, similar non-vm machines running fine but have been unable to find the disconnect.
Ideas?
I had the same error using following system configuration
Python-2.6.6 installed as msi
mercurial-1.8.2-x86 installed as msi
IIS7
I solved this problem simply:
Python has been installed early
Uninstall Mercurial msi package
Download and install "Mercurial-1.8.2 (32-bit py2.6)" installer from mercurial website which is marked as "This is recommended for hgweb setups".
copyed content of C:\Python26\Lib\site-packages\mercurial\ to the directory used in IIS7 website setup.
Till now all is working. Hope this will help.
Whenever I have less than descriptive error messages that tell me something is going on at the system level but not what, I use Sysinternals' Procmon to tell me what's going with the registry and filesystem. It's verbose, and getting the filter to show just the process of interest takes some learning, but you can export the results to Excel and skim them for suspicious-looking results. Pay particular attention to failures, of course.
Give it a try and see what DLL is being searched for.