I have installed python3.7 on redhat machine by compiling source code but I have a problem when dealing with pip3. I have made this steps after installation:
sudo ln /usr/local/bin/python3.7 /usr/bin/python3
sudo ln /usr/local/bin/pip3.7 /usr/bin/pip3
python3 -- version gives Python 3.7.3
But I have this errors by running these commands :
python3 -m pip install requests
gives /usr/bin/python3: No module named pip.__main__; 'pip' is a package and cannot be directly executed
pip3 install requests
gives ModuleNotFoundError: No module named 'pip._internal'
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.
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.
Try to reinstall the pip
as follows :
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py --force-reinstall
I have had the same issue, eventually found out the I have a version of pip install in C:\Program Files (x86)\Microsoft Visual Studio\Shared\anaconda
and it was defaulting to this.
I identified this by using
python -m ensurepip --default-pip
In a command prompt.
Deleted the anaconda folder and it finally works!
If you are on a Unix distribution update pip with sudo:
sudo python3 -m pip install --upgrade pip
To update pip, run:
python -m pip install --upgrade pip
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With