我正在使用 Ubuntu WSL,并且安装了 AWSCLI,但由于它也安装在 Windows 上,因此 Ubuntu 会抛出一个错误,因为它试图使用 Windows 版本一……
/mnt/c/Users/jonathan.lafleur/web 对象 aws --version zsh: /mnt/c/Program Files/Python36/Scripts//aws: 错误的解释器:c:\program: 没有此文件或目录 ✘ /mnt/c/Users/jonathan.lafleur/web 对象 其中 aws /mnt/c/Program Files/Python36/Scripts//aws
但我知道 AWS 已经安装,因为我收到以下消息:
成功安装了 PyYAML-5.1 awscli-1.16.207 botocore-1.12.197 colorama-0.3.9 docutils-0.14 futures-3.3.0 jmespath-0.9.4 pyasn1-0.4.5 python-dateutil-2.8.0 rsa-3.4.2 s3transfer-0.2.1 six-1.12.0 urllib3-1.25.3
如果我回应我的路径:
回显 $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/ProgramData/DockerDesktop/version-bin:/mnt/c/Program Files/Docker/Docker/Resources/bin:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/Program Files/PHP/v5.3:/mnt/c/Program Files/Python36/Scripts/:/mnt/c/Program Files/Python36/:/mnt/c/ProgramData/Oracle/Java/javapath:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Program文件(x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/PuTTY/:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/jonathan.lafleur/AppData/Roaming/nvm:/mnt/c/Program Files/nodejs:/mnt/c/Program Files(x86)/Druide/Antidote 9/Application/Bin64/:/mnt/c/Program Files(x86)/Druide/Antidote 9/Application/Bin32/:/mnt/c/Users/jonathan.lafleur/AppData/Local/JetBrains/Toolbox/apps/WebStorm/ch-0/173.4548.30/bin:/mnt/c/Program Files(x86)/Windows Kits/8.1/Windows Performance Too:/mnt/c/Program Files (x86)/Windows 工具包/8.1/Windows 性能工具包/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Microsoft VS Code/bin:/mnt/c/nodejs/:/mnt/c/PHP/7.1:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files(x86)/Intel/Intel(R)管理引擎组件/DAL:/mnt/c/Program Files/Intel/Intel(R)管理引擎组件/DAL:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/PowerShell/6/:/mnt/c/Users/jonathan.lafleur/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/jonathan.lafleur/AppData/Roaming/npm:/mnt/c/MinGW/msys/1.0/bin:/mnt/c/MinGW/bin:/mnt/c/Program Files(x86)/FontForgeBuilds
知道如何修复吗?
答案1
问题在于 Windows 和 Linux 互操作性,您可以通过标志或配置文件禁用它,解决方案如下:https://stackoverflow.com/a/51345880/435514