Python: Running from cygwin works, while running from PyCharm doesn't

后端 未结 1 893
孤街浪徒
孤街浪徒 2021-01-21 07:37

I can successfully run a python script that uses

from sklearn.cluster import DBSCAN

from the 64 bit cygwin terminal prompt which uses a 64bit b

相关标签:
1条回答
  • 2021-01-21 08:21

    When I had a similar problem (couldn't import numpy in Pycharm but on cygwin console), it turned out that cygwin was using a different interpreter as PyCharm.

    In PyCharm I had configured the interpreter from C:\Program Files\cygwin\usr\bin\python. In contrast, cygwin was using /bin/python. In PyCharm click File > Settings > Project: yourProjectName > Project Interpreter, click on "Add local" and find the interpreter used by cygwin (in my case C:\Program Files\cygwin\bin\python).

    Then open the Python Console in PyCharm via View > Tools Windows > Python Console and try your import statement.

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