我對PyCharm CE和naoqi有個惱人的問題。按照Aldebaran指南中的安裝說明,我已經配置了我的環境以使用該環境。 我已經安裝了由艾爾帕蘭建議蟒(蟒蛇2.7.13)的版本,我已經寫了使用的.bash_profile:naoqi 2.5.5.5和PyCharm CE 2017.1
# Setting PATH for Python 2.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
#NaoQI 2.5.5
export PYTHONPATH=${PYTHONPATH}:/Users/francesco/Documents/PyLibs/pynaoqi-python2.7-2.5.5.5-mac64/lib/python2.7/site-packages
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/Users/francesco/Documents/PyLibs/pynaoqi-python2.7-2.5.5.5-mac64/lib
在那之後,我啓動我的代碼從終端蟒蛇(確保正確的當我輸入
$ python my_code.py
Python版本被調用,所有的工作(我也試過用的virtualenv ,如果我從終端發動所有一切工作正常)。 到目前爲止好,但隨後而來的毒箭。我使用像IDE一樣的PyCharm CE,我創建了一個新項目使用該工作正常,在相同的環境中終端,奇蹟發生了.. 第一個問題是:
/Users/francesco/Documents/PyEnv/pynaoqi255_python2713/bin/python /Users/francesco/PycharmProjects/PepperRobot/PepperRobot.py Traceback (most recent call last): File "/Users/francesco/PycharmProjects/PepperRobot/PepperRobot.py", line 5, in import qi ImportError: No module named qi
(OK seriuosly這是同樣的環境下,在終端作品) 我試圖繞過這個問題,在virtualenv的站點包中添加naoqi sdk的內容。好吧,這個問題被忽略。但有一個問題:
/Users/francesco/Documents/PyEnv/pynaoqi255_python2713/bin/python /Users/francesco/PycharmProjects/PepperRobot/PepperRobot.py Traceback (most recent call last): File "/Users/francesco/PycharmProjects/PepperRobot/PepperRobot.py", line 5, in import qi File "/Users/francesco/Documents/PyEnv/pynaoqi255_python2713/lib/python2.7/site-packages/qi/init.py", line 88, in from _qi import Application as _Application ImportError: dlopen(/Users/francesco/Documents/PyEnv/pynaoqi255_python2713/lib/python2.7/site-packages/_qi.so, 2): Library not loaded: @loader_path/libqipython.dylib Referenced from: /Users/francesco/Documents/PyEnv/pynaoqi255_python2713/lib/python2.7/site-packages/_qi.so Reason: image not found
過程與退出代碼完成1
我不明白爲什麼...... 我還包括
Preferences -> console -> Python Console -> Environment Variables
包含在.bash_profile中的相同變量但無濟於事。 我該如何解決這個乏味的問題?
我補充說,當我嘗試在pycharm中打印環境變量時(即使我在python控制檯菜單中添加了變量),系統將使用項目目錄進行打印。 –