Multiple Python Interpreters used in the same project?

后端 未结 4 2179
甜味超标
甜味超标 2021-01-04 02:08

I am using pycharm and it only lets you use one interpreter for example Python 2.7.5 or Python 3.5.1.

The problem is I have certain modules one from google to access

4条回答
  •  独厮守ぢ
    2021-01-04 03:09

    This is actually possible with a bit of hacking.

    • close the pycharm IDE.
    • open $PROJECT/.idea/modules.xml and add another module with a different name like this:

    • now add a file by the same name in $PROJECT/.idea.
    • reopen the project.
    • open project settings where you will see something like this:
    • notice that now there are two modules and you can configure each one separately. This means that you can configure folders, exclusion and different interpreters. Now it's you job to configure things properly.

    Caveat: This is a hack which has no GUI in pycharm. This could stop working at any upgrade to pycharm. However, I don't think it will for various reasons.

提交回复
热议问题