Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python: can't open file get-pip.py error 2] no such file or directory

When I am trying to execute this in CMD

python get-pip.py

I am getting this error:

python: can't open file get-pip.py error 2] no such file or directory

While the file store in (get-pip.py)

C:\Python27\Tools\Scripts

like image 348
Muhammad Faizan Khan Avatar asked Sep 30 '16 11:09

Muhammad Faizan Khan


People also ask

Can't open file install ': Errno 2 No such file or directory Python?

The Python "FileNotFoundError: [Errno 2] No such file or directory" occurs when we try to open a file that doesn't exist in the specified location. To solve the error, move the file to the directory where the Python script is located if using a local path, or use an absolute path.

Why can't I install pip in Python?

One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.

How do I get the pip py file?

Step 1: Download the get-pip.py (https://bootstrap.pypa.io/get-pip.py) file and store it in the same directory as python is installed. Step 2: Change the current path of the directory in the command line to the path of the directory where the above file exists. Step 4: Now wait through the installation process. Voila!

Does Python 2 have pip?

The latest pip has dropped support for Python 2 And you cannot install the latest pip via get-pip.py using Python 2.7. Update: Found an answer here with the script for Python 2.7 https://stackoverflow.com/a/65866547/429476. You should upgrade to Python 3.


2 Answers

For Linux/Mac, you can go for

curl 'https://bootstrap.pypa.io/get-pip.py' > get-pip.py && sudo python get-pip.py
  1. Fetching installer
  2. Executing file with superuser access
like image 134
Denis Rybalka Avatar answered Sep 27 '22 23:09

Denis Rybalka


Try to either cd into folder with script (cd "C:\Python27\Tools\Scripts") or add this folder to your PATH variable.

like image 41
vovaminiof Avatar answered Sep 27 '22 23:09

vovaminiof