(原+轉)pycharm中使用caffe


轉載請注明出處:

http://www.cnblogs.com/darkknightzh/p/5896446.html

參考網址:

http://www.th7.cn/Program/Python/201510/641841.shtml

http://stackoverflow.com/questions/33371954/pycharm-import-caffe-error/33397590

http://askubuntu.com/questions/684550/importing-a-python-module-works-from-command-line-but-not-from-pycharm

 

http://www.th7.cn/Program/Python/201510/641841.shtml中說使用sys.path.append實際上可用:

import sys
sys.path.append("/home/xxx/project/caffe-master/python")

 

http://stackoverflow.com/questions/33371954/pycharm-import-caffe-error/33397590說修改/etc/ld.so.conf。修改了之后,不管用。但是該網址中圖片內已經貼出使用sys.path.insert來增加路徑。實際上也是可以的:

import sys
sys.path.insert(0, "/home/xxx/project/caffe-master/python")

 

http://askubuntu.com/questions/684550/importing-a-python-module-works-from-command-line-but-not-from-pycharm中Mihai Capotă指出,由於pycharm並不讀取.bashrc中的內容,因而在命令行中能使用import python,但是pycharm中依舊不能使用python。解決方法是:As an alternative to setting the paths in PyCharm, you can simply start PyCharm from a Bash shell to give it access to the environment variables you set in .bashrc.(從bash shell中啟動pycharm,使pycharm能讀取.bashrc中的環境變量)——這個沒試過


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM