Windows上的AWS CLI文件扩展名关联警告 [英] AWS CLI file extension association warning on Windows

查看:106
本文介绍了Windows上的AWS CLI文件扩展名关联警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows上将aw cli与pythno 3一起使用时,总是会收到警告,但是该程序在出现此消息后运行良好.

Using aws cli with pythno 3 on Windows, always getting a warning, but the program runs well after this message.

例如:

>>> aws --version --debug
Не найдено сопоставление для расширения имени файла .py.
aws-cli/1.15.83 Python/3.6.0 Windows/7 botocore/1.10.82

(模糊地-'找不到文件扩展名.py的关联)

(vaguely -' Cannot find association for filename extension .py')

任何想法,aws脚本的哪一部分都会发出此警告,以及如何解决此警告? AWS在哪一部分使用Windows通话?

Any idea which part of aws scripts issues this warning and how to fix it? At what part does aws use Windows call?

推荐答案

如@Evgeny在Windows中描述的,在安装AWS CLI后,文件aws.cmd具有以下行,该行调用命令assoc并产生警告:

As @Evgeny describes in Windows after install AWS CLI the file aws.cmd has this line that calls the command assoc and produces the warning:

    for /f "tokens=2 delims==" %%i in ('assoc .py') do (

命令assoc .py显示Windows中是否存在与python文件的关联.如果您在主命令行中没有与* .py文件关联的python可执行文件(在Anaconda环境中则为否).

The command assoc .py shows if there is an association to python files in Windows. If you don't have a python executable associated with *.py files in your main command line (no in environments of Anaconda).

您可以测试打开命令行窗口并尝试以这种方式在文件夹中运行简单脚本:

You can test that opening a command line window and try to run a simple script in a folder this way:

    >test.py

如果遇到错误,并且想要删除警告,则必须使用以下选项之一为python文件建立新的关联.

If you get an error and you like to remove the warning you have to make a new association for python files, with one of this options.

  • 通过命令行(以管理员身份)
    assoc .py=py_auto_file
    ftype py_auto_file="C:\Anaconda3\python.exe" "%1" %*

  • 通过GUI更改默认应用程序
  • 右键单击任何扩展名为* .py的文件,然后选择属性,然后选择一个管理该文件的程序,例如在"C:\ Anaconda3 \ python.exe"中,或更改默认应用程序.

    Right clic any file with extension *.py and select properties, and select a program that manage this file, for example in "C:\Anaconda3\python.exe" or change the default app.

    在Windows 10中,您可以按照以下顺序操作:开始菜单,选择设置>应用>默认应用"

    In Windows 10 you can follow this sequence "Start menu, select Settings > Apps > Default apps"

    这篇关于Windows上的AWS CLI文件扩展名关联警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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