Still getting error in ex 46

I am getting error while doing this:

(Py) PS C:\Users\AMISHA SINGH\projects\skeleton> cp C:\Users\AMISHA SINGH\Qsync\Python\skeleton\setup.py

The error is this one-
cp : Cannot find path ‘C:\Users\AMISHA’ because it does not exist.

While doing : ls skeleton
It is showing that it does not exist but I have made this directory.

I have tried this many times but still it is showing me error. Please help me

Hello @amisha12

I guess the space between your first and last name causing this problem.

Perhaps you could try this I found at StackOverflow:

For any file path with space, simply put them in double quotations will work in Windows Powershell. For example, if you want to go to Program Files directory, instead of use

PS C:> cd Program Files
which will induce error, simply use the following will solve the problem:

PS C:> cd ”Program Files”

Note that this one has quotes around the name of the folder.

I hope this helps. I am not used to Powershell my self.

1 Like

Oh Ok. I will try and inform you soon

A quick fix is to use ~ (tilde) instead of the full path to your home directory:

cp ~\Qsync\Python\skeleton\setup.py project\

The ~ character says “my home directory”, so it expands to C:\Users\AMISHA SINGH\ correctly.

If you put quotes around it then do the entire thing:

cp “C:\Users\AMISHA SINGH\Qsync\Python\skeleton\setup.py” project

Sir after doing this: cp ~ \Qsync\python\skeleton\setup.py\project\

I did this one:
cat .\setup.py

But it showed an error. The error was that -
cat : Cannot find path ‘C:\Users\AMISHA SINGH\projects\skeleton\setup.py’ because it does not exists.

What should I do?

Hello @amisha12

There is two very useful commands that you should start to use frequently:

pwd # to see where you are at the moment.
ls # to see what you have in this directory (folder)

You should also get comfortable how to ”cd” to where your files are located.
Type ”cd” start to type the first 2-4 letters in the directory the press Tab to fulfill the name. Then enter to get into it.

And you should have a look in the appendix of the book(learn Python the hard way)
There is a chapter covering these things.

Alright, but you didn’t get the spacing right. Space characters are very important. I typed this:

cp
SPACE
~\Qsync\Python\skeleton\setup.py
SPACE
project\

You typed:

cp
SPACE
~
SPACE
\Qsync\python\skeleton\setup.py\project\
--------------------------------^  NO SPACE

Imagine I told you to say this to get into a secret club:

“I would like a banal turnip.”

So you go to the secret club and you say this:

“Iwoul dlike abana lturn ip.”

That’s basically what you did when you typed the command. When you type English you don’t add random spaces. You do that just fine, so treat these commands like you would English.

cp – that’s a word
~\Qsync\Python\skeleton\setup.py <-- this is ONE WHOLE WORD
project\ <-- this is ONE WHOLE WORD

All commands on the command line work on words, but they call them “arguments”. Each argument is separated by a space character, so when you add random spaces you are making new words. You have to put quotes around your name because you have a space character in it, and that tells PowerShell that you are writing two words, but you mean one “Word” that has a space in it.

Now, are you watching the videos?

1 Like

Yes sir I am watching the videos and I have followed it up. When I did ex 46 first time watching the video I did it right but at last I stuck. So I decided to work on it again. But whenever I am making directory projects it shows me that it is made but when I did this:

(Py) C:\Users\AMISHA SINGH\projects\skeleton> ls projects

It showed me that " projects does not exist"
But I made it.
Similarly when I did the ls skeleton
It showed it does not exist.

I have completed the appendix crash course earlier. I have tried many times ex 46 but I am confused now. What should I do?

Try this:

start from C:
(start Powershell,
type: cd C:)

Then:

cd .\Users

pwd

to confirm that you are in the Users directory

ls

to see if you can find ‘AMISHA SINGH’ in there.
If so…

cd ‘.\AMISHA SINGH’

single quotes because there is a space between “amisa” and “singh”

pwd

to confirm that you are in the AMISHA SINGH directory

again:

ls

to look for “projects”
If you find “projects” in the list:

cd projects

And so on until you find the directory that contains files you want to access.

There is a way to reach them from some directories above.
But I am not going to tell you before you know how to cd into next directory below.
You need to practice navigation in the file structure a little bit!
Perhaps this sounds a little bit hard.
But I know you will be happy later when you know how to run a script below or above where you are at the moment.
Your key to success:
pwd,
ls,
cd,
practice.

1 Like

Ok I will practice this

Hi @amisha12.

Please tell us if you get it working.

1 Like

Yes now I have completed ex46. Thanks @zedshaw and @ulfen69

Nice, what was the main mistake you kept making and how did you fix it?

Whenever I made project and skeleton directory and did ‘ls projects’ or ‘ls skeleton’ I got an error Everytime. But they were present in the folder. So I deleted those directories from the folder and started everything from the beginning. And at last I completed ex46.

Nice, remember that in the future. Sometimes if you’ve gone down a bad path with your install it’s best to just start over.