2016-10-11 103 views
0

嗨,大家好我有一個Python和Naoqi Pepper機器人的問題。我已經設定爲NaoqiSDK正確的道路,當我運行「進口鬧起」我得到這個錯誤:Python爲Naoqi(動態模塊沒有正確初始化)

>>> 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 

有沒有誰知道這事,如何解決呢?

我希望對此有所幫助。謝謝

P.s.我在OSX

+0

你解決了這個問題? – magicleon

回答

3

同樣運行該運行任何NAOqi的二進制文件,你可能需要用DYLD_LIBRARY_PATH和DYLD_FRAMEWORK_PATH運行Python解釋器設置正確:

DYLD_LIBRARY_PATH=<installation_directory>/lib DYLD_FRAMEWORK_PATH=<installation_directory> PYTHONPATH=<installation_directory>/lib/python2.7/site-packages python