在cygwin上配置AWS时没有此类文件或目录错误 [英] No such file or directory error when configuring aws on cygwin

查看:222
本文介绍了在cygwin上配置AWS时没有此类文件或目录错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了Cygwin和Python 2.5版.现在,我将在aws上设置一台深度学习计算机(遵循本教程: https://www .youtube.com/watch?v = 8rjRfW4JM2I )

I downloaded Cygwin and Python version 2.5. Now I am about to set up an deep learning computer at aws (following this tutorial: https://www.youtube.com/watch?v=8rjRfW4JM2I)

如果我运行pip install awscli,我会得到这个(很好)

If i run pip install awscli I get this (which is good)

 $ pip install awscli 
 Requirement already satisfied: awscli in c:\users\marc\anaconda2    \lib\site-packages
 Requirement already satisfied: s3transfer<0.2.0,>=0.1.9 in c:\users\marc\anaconda2\lib\site-packages (from awscli)
 Requirement already satisfied: rsa<=3.5.0,>=3.1.2 in c:\users\marc\anaconda2\lib\site-packages (from awscli)
 Requirement already satisfied: PyYAML<=3.12,>=3.10 in c:\users\marc\anaconda2\lib\site-packages (from awscli)
 Requirement already satisfied: docutils>=0.10 in c:\users\marc\anaconda2\lib\site-packages (from awscli)
Requirement already satisfied: botocore==1.4.92 in c:\users\marc\anaconda2\lib\site-packages (from awscli)
Requirement already satisfied: colorama<=0.3.7,>=0.2.5 in c:\users\marc\anaconda2\lib\site-packages (from awscli)
Requirement already satisfied: futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" in c:\users\marc\anaconda2\lib\site- packages (from s3transfer<0.2.0,>=0.1.9->awscli)
Requirement already satisfied: pyasn1>=0.1.3 in c:\users\marc\anaconda2\lib\site-packages (from rsa<=3.5.0,>=3.1.2->awscli)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in c:\users\marc\anaconda2\lib\site-packages (from botocore==1.4.92->awscli)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in c:\users\marc\anaconda2\lib\site-packages (from botocore==1.4.92->awscli)
Requirement already satisfied: six>=1.5 in c:\users\marc\anaconda2\lib\site-packages (from python-dateutil<3.0.0,>=2.1->botocore==1.4.92->awscli)

但是,当我要配置所有内容并键入aws时,会得到:

However when I want to configure everything and type aws I get:

$ aws
C:\Users\Marc\Anaconda2\python.exe: can't open file '/cygdrive/c/Users/Marc/Anaconda2/Scripts/aws': [Errno 2] No such file or directory

推荐答案

花了很多时间之后,我找到了一个可行的解决方案.

After a LOT of time spent on this, I found a solution that works.

主要问题是cygwin没有安装python,并且不知道在您的机器上哪里可以找到现有的Windows Anaconda版本.可以通过在cygwin中运行哪个python进行验证-它找不到python的保存位置.请注意,这可能会造成混淆,因为运行pip install awscli可能不会引发错误消息. Cygwin实际上在Window的Anaconda安装的Python中安装了awscli(我发现这很奇怪,因为我们没有运行conda install awscli).

The primary issue is that the cygwin didn't come with python installed, and doesn't know where to find the existing Windows Anaconda version on your machine. This can be verified by running which python from within cygwin - it couldn't find where python is saved. Note that this can be confusing because running pip install awscli likely doesn't throw an error message. Cygwin actually installs awscli in the Window's Anaconda installation of Python (I find this odd since we didn't run conda install awscli).

但是,与其尝试将cygwin指向计算机上已安装的Anaconda python版本,不如仅安装特定于cygwin的python实例将为您省去很多麻烦.此处记录了这样做的步骤: http://wiki.fast.ai/index.php/Awscli_in_cygwin )

HOWEVER, rather than try to point cygwin to the already installed version of Anaconda python on your machine it will save you a ton of headache to just install a cygwin-specific instance of python. The steps to do so are documented here: http://wiki.fast.ai/index.php/Awscli_in_cygwin)

  1. pip uninstall awscli
  2. wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg
  3. install apt-cyg /bin
  4. apt-cyg install python
  5. wget https://bootstrap.pypa.io/get-pip.py
  6. python get-pip.py
  7. pip install awscli
  1. pip uninstall awscli
  2. wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg
  3. install apt-cyg /bin
  4. apt-cyg install python
  5. wget https://bootstrap.pypa.io/get-pip.py
  6. python get-pip.py
  7. pip install awscli

...但是,请注意,第一个命令pip uninstall awscli为我挂断了".因此,只需使用quit()逃脱它,然后按顺序继续其他操作即可.

...Note, however, that the first command pip uninstall awscli "hung up" for me. So just escape out of it using quit() and continue with the others in order.

如果您在cygwin中运行which python,并且可以指向cygin版本(即/usr/bin/python,而不是/users/.../Anaconda2/),则可以检查一切是否正常.

You can check that everything worked if you run which python in cygwin and it points to the cygin version (i.e. /usr/bin/python , as opposed to: /users/.../Anaconda2/).

此外,如果您恰巧在观看fast.ai课程的设置视频时问这个问题( https://github.com/fastai下载所有的shell脚本/courses/tree/master/setup ),Windows会自动添加CRLF行终止符!因此,在cygwin中,运行以下命令以删除这些行尾:

Additionally, if you happen to be asking this in conjunction with watching the setup video for the fast.ai course (http://course.fast.ai/lessons/aws.html), then the next step is CRITICAL for Windows users: when you download all the shell scripts from Github setup folder (https://github.com/fastai/courses/tree/master/setup), Windows automatically adds CRLF line terminators! Therefore, in cygwin, run the following commands to remove these line endings:

  1. apt-cyg install dos2unix
  2. dos2unix setup_p2.sh
  3. dos2unix setup_instance.sh
  4. 然后是bash setup_p2.sh
  1. apt-cyg install dos2unix
  2. dos2unix setup_p2.sh
  3. dos2unix setup_instance.sh
  4. then finally, bash setup_p2.sh

这应该可以解决问题.

This should do the trick.

这篇关于在cygwin上配置AWS时没有此类文件或目录错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆