Configuring PyCharm with existing virtualenv

后端 未结 4 973
忘掉有多难
忘掉有多难 2020-12-11 02:02

I am trying to get PyCharm running using existing virtualenv setting. I have pointed my PyCharm project to python interpreter in existing virtualenv ~/.virtualenvs/myproj/ i

4条回答
  •  情书的邮戳
    2020-12-11 02:51

    To run PyCharm properly for your project, you need to set Python Interpreter and Python Structure correctly.

    I had set Python Interpreter correctly but missed out on Python Structure.

    Go to Pycharm->Preferences->your_project->Project Structure

    Add the right content root

    It has nothing to do with your working directory which you can set separately in your debug/run configuration

    also don't forget to add environment variables you need and you should be good to go.

    For Intellij Idea 2016.2, following is the path to add site-packages installed in virtualenv File -> Project Structure -> Sources -> "Use + button and add as Sources"

    if hidden directory may is be visible, you may either change your view settings or copy paste the path to site-packages in virtualenv

提交回复
热议问题