Add directory to Python path in PyCharm?

可紊 提交于 2019-12-09 14:21:50

问题


I want to be able to use the paraview.simple library in PyCharm. I already have paraview installed in my computer. This package cannot be installed with pip and there are no .whl files as far as I can tell. The website docs recommend that the directory containing all the python files be added to PYTHONPATH.

How do I add the relevant folder in PYTHONPATH on my PyCharm session, and keep it there by default, such that when I close out and reopen the paraview.simple library is still available?


回答1:


You can add custom paths this way.

  • Go to File->Settings->project Interpreter
  • In the Project-Interpreter field, click the down facing arrow and select "show All"
  • In that Menu, highlight your interpreter and then in the right menu, select the button "Show paths for the selected interpreter" (this is the last button)
  • click the plus symbol to add your path



回答2:


Adding interpreter paths in PyCharm:

  1. Project Settings/Project Interpreter: select "settings" icon
  2. Project Interpreters: select "tree" icon
  3. Interpreter Paths: select "plus" icon




回答3:


  • Use anaconda with Pycharm
  • To install paraview with anaconda run the following command: conda install -c conda-forge paraview
  • If conda command is not recognized then register the Anaconda path to environment variable
  • Now open pycharm and give the configuration path as the Anaconda path
  • File -> Settings -> Project Interpreter
  • In Project Interpreter give similar path : "C:\Users\username\Anaconda3\python.exe"


来源:https://stackoverflow.com/questions/48947494/add-directory-to-python-path-in-pycharm

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