Cygwin + Anaconda在Windows 7上无法正常工作

时间:2016-07-04 11:02:54

标签: python windows cygwin anaconda

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

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

我可以在指挥官(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和我似乎没有很好的联系(到目前为止)。

谢谢

1 个答案:

答案 0 :(得分:1)

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

$scope.selectedStudents = [];
angular.ForEach(studentsArr,function(value,key){
   // looping on each student's hobbies
   angular.ForEach(value.hobby,function(value2,key2){
     if(value2.sport == $scope.searchForSport) { 
       $scope.selectedStudents.push(value)
     }
  })
})

当我使用-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...>

使用$ 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则可以正常工作。我知道你刚才提出这个问题,但如果你仍然感兴趣this page可能对你有用。