适用于Naoqi的Python(动态模块未正确初始化) [英] Python for Naoqi (dynamic module not initialized properly)
本文介绍了适用于Naoqi的Python(动态模块未正确初始化)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我在使用Pepper和Robot的Python和Naoqi时遇到问题.我为NaoqiSDK设置了正确的路径,当我运行"import naoqi"时,出现此错误:
Hi guys I am having a problem with Python and Naoqi for Pepper robot. I've set the right path to NaoqiSDK and when I run "import naoqi" I get this error:
>>> import naoqi
Traceback (most recent call last):
File"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 548, in <module>
main()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 530, in main
known_paths = addusersitepackages(known_paths)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 266, in addusersitepackages
user_site = getusersitepackages()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 241, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 231, in getuserbase
USER_BASE = get_config_var('userbase')
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 520, in get_config_var
return get_config_vars().get(name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 453, in get_config_vars
import re
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 108, in <module>
import _locale
SystemError: dynamic module not initialized properly
是否有人对此有任何了解,如何解决?
Is there anyone who knows anything about this, how to fix it?
对此我将不胜感激.谢谢
I would appreciate any help about this. Thank you
P.s.我正在OSX上运行它
P.s. I'm running this on OSX
推荐答案
类似于运行任何NAOqi二进制文件,您可能需要运行DYLD_LIBRARY_PATH和DYLD_FRAMEWORK_PATH正确设置的Python解释器:
Similarly to running any NAOqi binary, you may need to run your Python interpreter with DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH set properly:
DYLD_LIBRARY_PATH=<installation_directory>/lib DYLD_FRAMEWORK_PATH=<installation_directory> PYTHONPATH=<installation_directory>/lib/python2.7/site-packages python
这篇关于适用于Naoqi的Python(动态模块未正确初始化)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文