Adding external libraries in PyCharm Professional 4

坚强是说给别人听的谎言 提交于 2019-12-22 04:47:17

问题


I'm trying to add external libraries to my project, but there seems no way to do so in PyCharm 4 (Professional). I found several similar questions with accepted answers, however those seem only work on older PyCharm versions.

This is one example: PyCharm and external libraries

Does anyone know how to add paths for external Python packages and modules in PyCharm 4 Professional?


回答1:


With the latest PyCharm version (2018.1) under File -> Default Settings -> Project Interpreter you can select which interpreter to use (OS default or any other distribution you may have manually installed).

The box in the middle lists all the packages currently installed, while the + button at the bottom allow to install packages from public repositories.

If you want to add custom packages you have to manually specify the path:

Select the interpreter and click on "Show paths for the selected interpreter"

Add the path of the new module




回答2:


If you want to install a pip package, the install button is still there, on the right hand side of the Project Interpreter configuration pane.

If you want to change the list of paths for an interpreter, press the "gear" button in the Project Interpreter configuration pane, then click on "More...", and then press "Show paths for the selected interpreter". In the dialog that appears, you can add or remove paths as needed.



来源:https://stackoverflow.com/questions/28273256/adding-external-libraries-in-pycharm-professional-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!