gpt4 book ai didi

Python for Naoqi(动态模块未正确初始化)

转载 作者:行者123 更新时间:2023-11-28 21:08:23 24 4
gpt4 key购买 nike

大家好,我在使用 Pepper 机器人的 Python 和 Naoqi 时遇到了问题。我已经设置了 NaoqiSDK 的正确路径,当我运行“import 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

有没有人对此一无所知,如何解决?

如果对此有任何帮助,我将不胜感激。谢谢

附言我在 OSX 上运行这个

最佳答案

与运行任何 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

关于Python for Naoqi(动态模块未正确初始化),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39974637/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com