pycharm 的包路徑設置export PYTHONPATH=$PYTHONPATH


我們使用pycharm的時候,經常會因為要鏈接(import)其他自己寫的包,因此在pycharm的時候經常會

報錯,就是找不到自己的包,在命令行下常用,export PYTHONPATH=$PYTHONPATH來臨時鏈接。

因此,這里有一個網上的參考,蠻不錯的:

來源於:https://stackoverflow.com/questions/17198319/how-to-configure-custom-pythonpath-with-vm-and-pycharm

 

 

For PyCharm 5 (or 2016.1), you can:

  1. select Preferences > Project Interpreter
  2. to the right of interpreter selector there is a "..." button, click it
  3. select "more..."
  4. pop up a new "Project Interpreters" window
  5. select the rightest button (named "show paths for the selected interpreter")
  6. pop up a "Interpreter Paths" window
  7. click the "+" buttom > select your desired PYTHONPATH directory (the folder which contains python modules) and click OK
  8. Done! Enjoy it!

enter image description here

enter image description here

enter image description here enter image description here


免責聲明!

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



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