How do I use installed packages in PyCharm?

后端 未结 13 1433
暗喜
暗喜 2020-11-22 16:20

In PyCharm, I\'ve added the Python environment /usr/bin/python. However,

from gnuradio import gr

fails as an unde

相关标签:
13条回答
  • 2020-11-22 16:25

    Download anaconda https://anaconda.org/

    once done installing anaconda...

    Go into Settings -> Project Settings -> Project Interpreter.

    Then navigate to the "Paths" tab and search for /anaconda/bin/python

    click apply

    enter image description here

    0 讨论(0)
  • 2020-11-22 16:26

    In PyCharm 2020.1 CE and Professional, you can add a path to your project's Python interpreter by doing the following:

    1) Click the interpreter in the bottom right corner of the project and select 'Interpreter Settings'

    2) Click the settings button to the right of the interpreter name and select 'Show All':

    3) Make sure your project's interpreter is selected and click the fifth button in the bottom toolbar, 'show paths for the selected interpreter':

    4) Click the '+' button in the bottom toolbar and add a path to the folder containing your module:

    0 讨论(0)
  • 2020-11-22 16:27

    Add path in PyCharm 2017

    File -> Settings (or Ctrl+Alt+S) -> Project -> Project Interpreter

    Show all

    Select bottom icon on the right side

    Click on the plus button to add new path to your module

    0 讨论(0)
  • 2020-11-22 16:27

    On Project Explorer, you can right click on the folder where the module is contained and set as 'Source'.

    It will be parsed in the Index for code completion as well as other items.

    0 讨论(0)
  • 2020-11-22 16:27

    As quick n dirty fix, this worked for me: Adding this 2 lines before the problematic import:

    import sys
    sys.path.append('C:\\Python27\\Lib\site-packages')
    
    0 讨论(0)
  • 2020-11-22 16:29

    For me, it was just a matter of marking the directory as a source root.

    0 讨论(0)
提交回复
热议问题