0

I'm trying to copy the python package from the source directory in .local/lib/python3.8/site-packages to another folder. Following is the command that I'm using

cp -R home/my_name/.local/lib/python3.8/site-packages/pdfminer/ home/my_name

This gives me following error

cp: cannot stat 'home/my_name/.local/lib/python3.8/site-packages/pdfminer/': No such file or directory

The directory and its content exist, as I have checked it.

How should I carry out the copying task?

Lawhatre
  • 167
  • 1
  • 2
  • 11
  • 3
    I guess you should have a '/' in front? i.e., cp -R /home/my_name/...? – Ray May 17 '21 at 09:38
  • Oh? Ok... I was thinking there might have been something else, after you added it in. I'll write it up... – Ray May 17 '21 at 09:42

1 Answers1

4

In the command that you have written, you need a forward slash (/) in front of the source and destination paths. So, change your command to:

cp -R /home/my_name/.local/lib/python3.8/site-packages/pdfminer/ /home/my_name

This is because you are referring to both the source and destination from the root (/) directory. Without, the command would still work, but only if you current working directory happened to be the root directory. i.e., this would work, too:

cd /
cp -R home/my_name/.local/lib/python3.8/site-packages/pdfminer/ home/my_name

And unrelated to your question, but if it's your own directory, you can replace /home/my_name/ with ~. i.e.,

cp -R ~/.local/lib/python3.8/site-packages/pdfminer/ ~
Ray
  • 2,071