PyCharm 当我尝试使用 macports 时抛出错误 python

PyCharm throwing an error when I try to use macports python

我正在尝试安装 Theano,这样我就可以开始玩一些很酷的 ML 东西,但是我 运行 遇到了 PyCharm 的问题。我正在按照说明 here 安装所有先决条件,以便我可以 运行 Theano 顺利进行,所以我使用 macports 下载 numpy 和 scipy,以及 python 2.7.12。 PyCharm 最初设置为使用 usr/bin/python 的解释器(与我上次在 python 工作时计算机上的不同 python 版本),但我切换了它转到 opt/local/bin/python,这样所有内容都将 运行ning 来自相同的 macports 版本。

问题是,使用 macports python 启动我的 PyCharm 在控制台中出现此错误:

/opt/local/bin/python -u /Applications/PyCharm CE.app/Contents/helpers/pydev/pydevconsole.py 60364 60365
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/utils/traitlets.py:5: UserWarning: IPython.utils.traitlets has moved to a top-level traitlets package.
  warn("IPython.utils.traitlets has moved to a top-level traitlets package.")
Traceback (most recent call last):
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevconsole.py", line 491, in <module>
    pydevconsole.StartServer(pydev_localhost.get_localhost(), int(port), int(client_port))
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevconsole.py", line 328, in StartServer
    interpreter = InterpreterInterface(host, client_port, threading.currentThread())
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_ipython_console.py", line 26, in __init__
    self.interpreter = get_pydev_frontend(host, client_port)
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_ipython_console_011.py", line 469, in get_pydev_frontend
    _PyDevFrontEndContainer._instance = _PyDevFrontEnd()
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_ipython_console_011.py", line 300, in __init__
    self.ipython = PyDevTerminalInteractiveShell.instance()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/traitlets/config/configurable.py", line 412, in instance
    inst = cls(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/terminal/interactiveshell.py", line 396, in __init__
    super(TerminalInteractiveShell, self).__init__(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 495, in __init__
    self.init_completer()
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_ipython_console_011.py", line 219, in init_completer
    self.Completer = self._new_completer_200()
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_ipython_console_011.py", line 191, in _new_completer_200
    use_readline=self.has_readline,
AttributeError: 'PyDevTerminalInteractiveShell' object has no attribute 'has_readline'

Process finished with exit code 1
Couldn't connect to console process.

我已经进行了一些谷歌搜索,但我只能找到通过更新解决此问题的人(我刚刚下载了这个 python 版本,所以我很确定它是最新的),并且根本没有解决的人。有任何想法吗?非常感谢您的帮助。 :)

编辑:找到 this 页面,人们在该页面上遇到了类似的错误。发布了一个补丁,但我在我的计算机上的任何地方都找不到它引用的 pydev 文件。我还下载了readline库,还有ipython2.7。仍然没有运气:(

编辑 2:已修复!问题出在我的 ipython (5.1) 上,它与 pycharm 不兼容。我卸载它并恢复到 4.2,这清除了使用控制台的错误,但留下了关于 ipython.utils.traitlets 包的错误。为了解决这个问题,我刚刚禁用了 pycharm 对 ipython 的使用。现在一切似乎都很顺利!

已修复!问题出在我的 ipython (5.1) 上,它与 pycharm 不兼容。我卸载它并恢复到 4.2,这清除了使用控制台的错误,但留下了关于 ipython.utils.traitlets 包的错误。为了解决这个问题,我刚刚禁用了 pycharm 对 ipython 的使用。现在一切似乎都很顺利!