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

Viewed 8713

I installed localstack using:

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:

enter image description here

When I use any command related to localstack, I'm getting the below error:

enter image description here

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 ?

1 Answers

You need to add quote to your python command because you have spaces in your path

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)

Related