简体   繁体   English

python:无法打开文件“C:\\Program”:[Errno 2] 没有这样的文件或目录

[英]python: can't open file 'C:\Program': [Errno 2] No such file or directory

I installed localstack using:我使用以下方法安装了localstack

pip install localstack

Installation successfully completed.安装成功完成。

localstack==0.12.19.1
localstack-client==1.26
localstack-ext==0.12.19.2
localstack-plugin-loader==1.0.0

Python 3.9.6

System environment path:系统环境路径:

C:\Program Files\Python39\Scripts\
C:\Program Files\Python39\

Python location on PC: PC 上的 Python 位置:

在此处输入图片说明

When I use any command related to localstack , I'm getting the below error:当我使用与localstack相关的任何命令时,出现以下错误:

在此处输入图片说明

C:\Users\BRT.JNEHME\Desktop\FRC\freight_rate_collector-main>localstack -h

C:\Users\BRT.JNEHME\Desktop\FRC\freight_rate_collector-main>python C:\Program Files\Python39\Scripts\\localstack -h
python: can't open file 'C:\Program': [Errno 2] No such file or directory

Anyone have any idea about this issue ?任何人对这个问题有任何想法吗?

You need to add quote to your python command because you have spaces in your path您需要在 python 命令中添加引号,因为您的路径中有空格

In other words, you should write this :换句话说,你应该这样写:

python "C:\Program Files\Python39\Scripts\localstack" -h

Instead of this而不是这个

python C:\Program Files\Python39\Scripts\\localstack -h

The error comes from the command you enter: the syntax is not correct.错误来自您输入的命令:语法不正确。

When you write a command and this command has a path where spaces can be found (here it is your case with Program Files), you must add quotes to the whole path so that the path is interpreted as a single argument and not two arguments (because on the command line, adding a space indicates the addition of a parameter)当你编写一个命令并且这个命令有一个可以找到空格的路径时(这里是你的程序文件的情况),你必须在整个路径中添加引号,以便路径被解释为单个参数而不是两个参数(因为在命令行中,加空格表示加参数)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 python:无法打开文件'python2':[Errno 2]没有这样的文件或目录 - python: can't open file 'python2': [Errno 2] No such file or directory 无法打开文件'/c':[Errno 2] 没有这样的文件或目录 - can't open file '/c': [Errno 2] No such file or directory python:无法打开文件“帮助”:[Errno 2]没有此类文件或目录 - python: can't open file 'help': [Errno 2] No such file or directory 无法打开文件'python':[Errno 2]没有这样的文件或目录 - can't open file 'python': [Errno 2] No such file or directory C:\\ Python27 \\ python.exe:无法打开文件'/ cygdrive / c / Python27 / Scripts / Program':[错误2]没有此类文件或目录 - C:\Python27\python.exe: can't open file '/cygdrive/c/Python27/Scripts/Program': [Errno 2] No such file or directory 无法打开文件:[Errno 2] 没有那个文件或目录 - can't open file : [Errno 2] No such file or directory 无法打开文件:[Errno 2] 没有那个文件或目录 - can't open file : [Errno 2] No such file or directory 无法打开文件 [Errno 2] 没有这样的文件或目录 - Can't Open File [Errno 2 ] No such file or directory python:无法打开文件'C:\\usr\\local\\bin\\django-admin.py':[Errno 2]没有这样的文件或目录 - python: can't open file 'C:\\usr\\local\\bin\\django-admin.py': [Errno 2] No such file or directory c:\\ python27 \\ python.exe:无法打开文件'C:\\ Python27 \\ Scripts \\ slicer':[Errno 2]没有此类文件或目录 - c:\python27\python.exe: can't open file 'C:\Python27\Scripts\slicer': [Errno 2] No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM