Unable to load DLL python module in PyCharm. Works fine in IPython

后端 未结 7 2068
青春惊慌失措
青春惊慌失措 2020-12-16 06:40

When I use the IPython included with Enthought Python Distribution, I can import the pyvision package just fine. However, when I try to import pyvision inside of PyCharm 1.2

7条回答
  •  情深已故
    2020-12-16 07:10

    This is a pretty frustrating bug in PyCharm. Even if you set your virtualenv from within PyCharm, the "python console" defaults to the system python. When you installed PyCharm, presumably you used a win32 python on a 64 bit machine.

    Go to file>settings>Build, Execution, Deployment>Console>Python Console and change the Python Interpreter from the system version to your virtualenv.

    Of course, PyCharm doesn't immediately refresh it. You have to close your project and reopen it.

    To verify this was successful, open the Python Console (Tools>Python Console) and check the very first line of the output: it should point to the python.exe of your virtual environment, not the system python.

提交回复
热议问题