Pip not installing at all - python

I am using VS code and I have been trying for two hours now. Technically I should have Pip preinstalled as I'm using 3.8.2, although when I tried downloading and installing it (from https://bootstrap.pypa.io/get-pip.py) nothing is there and nothing will come up when i type pip help/pip --version in cmd and when i do any pip install . It's not installing. Any help?

Based on my research you might one of these useful:
PIP installation is not added to the system variable – In order to be able to run Python commands from a CMD window, you will need to add the path of your PiP installation to your PATH in the system variable. If you installed Python using the installation executable, it should be added automatically.
The installation is incorrectly added in your PATH – It’s easy to mess up the PATH if you add it manually. Additional space or the missing of a semicolon before the new PATH will end up producing the error.

I'm a beginner, but I would suggest uninstalling python completely, and installing it again.

Related

What is the difference between installing a package in my Windows CMD and in VS Code terminal?

I am doing this project where i need to install a package called Twint.
I want to install this package and use it's commands in my VS Code.
What happends when i for example type this in my Windows CMD?
pip3 install --user --upgrade git+https://github.com/twintproject/twint.git#origin/master#egg=twint
Because i can't type this in my VS code terminal, where i usually install packages with pip.
It will return an error that says ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?''
Now if i run this in my Windows Command it seems that i can't directly import the package in VS code?
Can anyone help me out with this confusion, where does the files get stored and how do i create good habbits around installing packages?
Hope someone understands what im struggeling with here.
Best
It is often the case that computers have more than one version of python installed and that editors like VS code use a different version than pip uses on the command line. pip installs packages where the version of python it is linked to expects them to be, but VScode doesn't know to look there.
It sounds like you have git installed where pip installs things, so you can upgrade from the command line without issue, but there's no installation of git where VScode is looking, so there's nothing to upgrade.
You either need to find where pip installs things and add it to the $PATH VScode uses, or try running a variation of python -m pip install --user git (specifying a specific url, or other things, as needed) from within VScode, which will ensure the package gets installed in a place that VScode looks for packages.
Download and Install git in your windows from here:
https://git-scm.com/download/win
Then add its installation bin path to your windows's environment path. Then you will find the git command at the command prompt globally.
This may solve you problem.

How can I uninstall a corrupted PIP instance on Windows?

Today, I was trying to install Python 3.10.1.
I was successful in this, but, then, as I was installing Flask, pip will tell me that it installed, then, when I run the script, it says nothing is installed.
After a while, I realized I was running my Python scripts in Python 3.10.1, but I was running pip in Python 3.7. I did as this post said and ran pip --version to discover this.
I ran pip show flask to see where the module is, and it's in the Python 3.7 folder.
However, when I tried to uninstall Python 3.7, I can't find it in my start menu or in Control Panel > Programs > Programs & Features. I believe I had uninstalled it a long time ago.
To counteract this, I did as some YouTube video said (I lost the link to it) and re-installed Python 3.10.1, checked the "Add to PATH" option, checked to install for all users, and checked on the pip install.
After doing this, I upgraded my pip version to the latest version, uninstalled Flask, and re-installed it.
It was still installed in the Python 3.7 folder.
Next, I decided I will just uninstall PIP.
I ran CMD as an Administrator and typed pip uninstall pip as instructed here.
However, when I did this, it says I'm missing access to the places it wants to modify.
I found that strange, so I checked if I'm actually running it Administrator, and, yes, I am.
I looked at the directories that it wants to modify and gave ADMINISTRATORS ownership of all of them.
Absolutely nothing changed and did it again.
I gave myself ownership of it and did it again.
Absolutely nothing changed.
Then, I decided to run pip uninstall pip again. It says pip is not installed. That's strange.
I typed pip, and the help command for pip shows up.
Then, I (probably stupidly) went to all the directories and files PIP listed that it wants to uninstall, and manually deleted them, then uninstalled Python 3.10.1, and made sure to install PIP from there.
And now we're back at Python 3.7, and pip still isn't installed somehow.
I don't know what's happening. I haven't coded anything in Python for 2 or 3 years, and I want to try again, but this is starting to confuse me. Could anyone help?
Edit: Based on the suggestion of one of the answerers, I tried to manually delete pip. I couldn't find it in %APPDATA%, but pip --version shows me the path.
I tried deleting pip from there, but it says I need permission from ADMINISTRATORS. I am an administrator on my computer -.-
Anyways, I tried to take ownership of the folder, but nothing ever came of that.
Try to locate %APPDATA%\pip\pip by typing it into the file explorer. Pip will be located there, and you should be able to delete it.
I've managed to fix the issue.
I found that if I press this button in the start menu search for Python 3.7, it's possible to uninstall it from there (Control Panel said it uninstalled it when I used that, but it didn't).
I think I had installed Python from the Microsoft Store, which is why I couldn't find it in %APPDATA%.
Once I did that, I tried to uninstall Python 3.10 then re-install it. It kept saying it's installed, but it wouldn't show up in Command Prompt.
I fixed this by installing Python 3.10 from the Microsoft Store instead.
This fixed the problem.

Getting error while saving python file: There is no Pip installer available in the selected environment

I'm getting an error "There is no Pip installer available in the selected environment." when saving python files in Visual Studio Code. I have pip3 installed, and it's available from the terminal. I have selected the python interpreter in the VS Code. I also tried manually installing autopep8 with pip3 in the project directory. But the error still occurs. Unfortunately, these are the only solutions I was able to find on the internet, but none of them worked. I use Lenovo's Chromebook, which is Debian-based. Does anyone have any clue how to solve the issue?
Selected interpreter:
You obviously have installed multiple Python environments on your system. The one in /usr/bin is usually the one installed by your system's package manager (apt on Debian) and most probably the default one that is used if you just call the python commands without absolute path from your shell. You can verify that by calling:
which python3
which pip3
I assume that both binaries are used from /usr/bin/.
Your Python installation selected in VS code is located in /usr/local/bin, which probably has been installed from a different origin (maybe you have compiled Python from source?). If VS code complains that no pip has been found in your selected environment, probably /usr/local/bin/pip3 does not exist for some reason. You can verify that by calling:
ls /usr/local/bin/pip3
Easiest solution to this would be to select the /usr/bin/python3 environment in VS code.
If you really need the Python version from /usr/local/bin, find out where this installation came from and complete it in order to have pip3 there as well.
The most sustainable solution, however, would be to use a virtual environment. This would make your Python version system-independent and you have full control over the packages in there.
I think you should check in your terminal "pip3 freeze" command, if it shows some list , then pip is working, otherwise you should check the environment variable in your system for pip3.

Pip is selecting wrong path

I'm using windows 10 and I got rid of python 3.8 and installed 3.7 as the only python version on my system.
When trying to install libraries using pip I now get the error:
Fatal error in launcher: Unable to create process using '"c:\users\user\appdata\local\programs\python\python38-32\python.exe" "C:\Users\User\AppData\Local\Programs\Python\Python38-32\Scripts\pip.exe" install pygame_menu': The system cannot find the file specified.
when I checked in the console which -a pip I got:
C:\Users\User>which -a pip
/cygdrive/c/Users/User/AppData/Local/Programs/Python/Python38-32/Scripts/pip
/cygdrive/c/Users/User/AppData/Local/Programs/Python/Python37/Scripts/pip
Now when I look for Python in my variable path it is alright...
Anyways I can't figure out how to change the path of pip so the right one is selected... besides its pretty weird that ive uninstalled python and pip multiple times and it still gets it wrong every time during installation.
Thanks
For me this solution did the job, thanks itsAPK
python -m pip install --upgrade --force-reinstall pip
The cause of this problem was me installing python from Microsoft store and having another version installed from the default installer, when I removed the Microsoft store version it was prompting me with errors.
to fix do this :
check if you still have the python38-32 folder in your local variable list
Delete the "%userprofile%\AppData\Local\Programs\Python\Python38" folder
run pip from command line
if the problem still persists then type "environment variables" in the windows search box
and add "%userprofile%\AppData\Local\Programs\Python\Python37" to your system variable named "Path"
This should completely fix your problem
if not
uninstall all the python files including py launcher
reinstall python # when installing you must select ADD PYTHON to system environment variable
When I was facing the same issue I fixed it by checking the python version pointed to by pip3.x executable. The pip3.10 was pointing to /usr/bin/python9 which was causing problems with package installation.
Just check if your pip3.x is pointing to the correct python version.
vim $HOME/.local/bin/pip3.10
Python version is on the first line (starting with the '#').

pip/easy_install failure: failed to create process

After following this article: How do I install pip on Windows? on my Windows system using Enthought Canopy 64 Bit system, I cannot get pip or easy_install to work due to error:
pip install requests
failed to create process
I tried re-installing setuptools, running cmd prompt as admin without any effect.
When I encountered this, it was because I'd manually renamed the directory python was in. This meant that both setuptools and pip had to be reinstalled. Or, I had to manually rename the python directory to what it had been previously.
It will help after changing the PATH to python in environment variables:
python -m pip install --upgrade pip --force-reinstall
Just ran into this. Sort of. Pip worked for me, but after installing pytest-watch, running the ptw script was giving this error.
For some reason, pip stopped quoting the #! in ptw-script.py:
#!C:\Program Files (x86)\Python\python.exe
It worked after I added quotes manually:
#!"C:\Program Files (x86)\Python\python.exe"
I don't really know why this suddenly started happening. Adding this here in case anyone else coming here from Google runs into the same thing.
Here's a related pip issue (I think).
If you intentionally want to rename the folder where python.exe resides, you should also modify all python files in the Scripts folder. So a third solution would be to modify the python files as well: the first line in pip-2.7-script.py originally contain:
#!C:\OriginalPythonDir\python.exe
Modifying this path to the new Python folder fixes the problem.
(P.S. Unfortunately I cannot yet reply to answers, so I'll reply as a new answer because I thought it could be useful for other people as well).
To fix this error (after you change the folder where python is installed) run force-reinstall for pip and pyinstaller, like this:
python -m pip install --upgrade pip --force-reinstall
python -m pip install --upgrade pyinstaller --force-reinstall
I ran into this bug while installing an older version of Python (3.5.2) for compatibility with some aws-adfs scripting. I installed aws-adfs with pip, on Windows 10, and found that while Python is installed to a directory path with spaces in it you will get the failed to create process error.
The pip maintainers say that it was a deeper problem with setuptools and even offered a workaround if you want to patch the installation in place.
But another, easier solution if you're working with older versions of Python is just to reinstall Python to a directory without spaces.
When I came across this problem, I found that my path contained multiple entries for Python. After tidying up my path so that it had an entry for the python installation folder and the scripts folder (in my case C:\Python27 and C:\Python27\Scripts), pip worked properly.
Test this. it's worked correctly for me:
python -m pip install --upgrade pip --force-reinstall
I just use python in the command shell on Windows 7 and had this problem immediately after installing pip. In case the above solutions don't help you, you should check that the folder that pip.exe is installed in (in my case, the Script folder under Python32) is in the Path.
I had installed Anaconda and so I still had C:\Python27 along with C:\Anaconda in my path. When I removed C:\Python27 and all subfolders I was able to use pip again.
Please check out have you ever rename your python.exe
I install python2 and python3 on my PC at the same time , so I rename my python.exe to python3.exe.And when I use pip ,it boom...
After rename it back .It's ok again....
Running command prompt with administrator privileges worked for me.
I had the same problem and none of the above worked for me.
I deleted my venv. And created a new one by specifying the python path:
virtualenv --python C:\Path\To\Python\python.exe venv
.\venv\Scripts\activate
and this worked
Check whether the pip-script points out the exact location of python.exe, because pip always points (C:\python3.3\python.exe). In my system i've installed 2 versions of python i.e python2 & python3. I ve modified the home application of python.exe into python2.exe and python3.exe.
When i installed pip windows installer. it results me out with the error " failed to create process"

Categories