Pycharm adding new project interpreter makes duplicate

前端 未结 1 1849
醉话见心
醉话见心 2021-01-07 05:23

In PyCharm, whenever I try to add new Project Interpreters, two duplicated entries are created.

For example, after adding 2.7.10 python.exe, interpreter list contain

相关标签:
1条回答
  • 2021-01-07 06:02

    It seems to be some kind of bug in PyCharm.

    As a workaround, you may remove duplicated entries manually. They are located in config file in PyCharm preferences directory. Default path is ~/.PyCharmxy/config/options/jdk.table.xml, where xy represents version (e.g. PyCharm40 for PyCharm 4.x).

    Each <jdk> element represents single configured interpreter. To remove duplicates simply find elements with subelement <name value="your duplicate name"> and delete entire <jdk> tag.

    Sample entry looks like below. (1) in name indicates duplicate.

    <jdk version="2">
      <name value="Python 2.7.10 (C:\Python27\python.exe) (1)" />
      <type value="Python SDK" />
      <version value="Python 2.7.10" />
      <homePath value="C:\Python27\python.exe" />
      (...) // a lot of other fields
    </jdk>
    

    Answer is based on The mystery of PyCharm and duplicate interpreters blog post.

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