【问题标题】:Cygwin + Anaconda not working properly on Windows 7Cygwin + Anaconda 在 Windows 7 上无法正常工作
【发布时间】:2016-07-04 11:02:53
【问题描述】:

我首先要说我是 Linux 和 Mac 人,出于工作原因,我被“强迫”在 Windows 上工作,更具体地说是 Windows 7。这实际上是我第一次使用 Windows。

我首先安装了 Anaconda(尽管由于我缺乏 Windows 经验,这将是最简单的方法),然后是 Cygwin,只运行 setup-x86_64.exe 文件中的默认值。

我可以在commander(cmd.exe)中启动python和Ipython,所以举例

C:\Users\username> ipython
Python 3.5.1 |Anaconda 4.0.0 (64-bit)| (default, Feb 16 2016, 09:49:46) [MSC v.1900 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 4.1.2 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details. 

In [1]: import os 
In [2]: import sys
In [3]: os.path.dirname(sys.executable)
Out[4]: 'C:\\Anaconda3'

但这在 cygwin 中不起作用。看起来 Cygwin 找到了正确的安装(?)

username@AELAP3ZZ5662 /
$ which python
/cygdrive/c/Anaconda3/python

username@AELAP3ZZ5662 /
$ which ipython
/cygdrive/c/Anaconda3/Scripts/ipython

但是当我启动 python 时,它会完全冻结,对于 Ipython:

$ ipython
In [1]:

没有初始化消息,自动完成、向上箭头和其他常用的 ipython 功能将不起作用。

无论如何,关于如何使用 Cygwin 设置 anaconda 有什么建议吗?我很确定所有人都将要编辑PATH 或使用setup-x86_64.exe 文件安装一些东西,但Windown 和我似乎关系不太好(到目前为止)。

谢谢

【问题讨论】:

标签: python windows cygwin anaconda


【解决方案1】:

您是否尝试使用 -i 标志运行它?否则它对我不起作用:

$ ipython
Python 3.6.0 |Anaconda 4.3.0 (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: <it hangs right here...>

当我使用 -i 运行时:

$ ipython -i
Python 3.6.0 |Anaconda 4.3.0 (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import os

In [2]: import sys

In [3]: os.path.dirname(sys.executable)
Out[3]:
'C:\\Anaconda3'

当我使用ipython 时,我的终端一退出就会崩溃,但如果我改用python 则可以正常工作。我知道您不久前提出了这个问题,但如果您仍然感兴趣this page 可能对您有用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多