pip/easy_install failure: failed to create process - python

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"

Related

Why does it say that pygame is already installed but I can't use it [duplicate]

Running on Windows 10, I have Python 3.7.3 installed to my c/users/myUser/appdata/local/programs folder.
When I use PIP to install a package, it seems to run fine, but when I use "import package" in python it doesn't recognize that package. What would cause this?
Running 'python --version' works and also running 'pip --version' works.
PIP shows up in my c/users/myUser/appdata/local/programs/python37-32/lib/site-packages/pip folder.
UPDATE:
So I was looking through files to determine where the libraries are located that do work with my python. The folder is located in Python/Python37-32/Lib. All of those currently work when importing. However when I do anything with PIP it does not add anything to that folder.
I noticed there are a couple different PIP executables within Python/Python37-32/Scripts which include pip.exe, pip3.exe, and pip3.7.exe. I tried using "pip3.7 install numpy" which also did not work.
I noticed when trying to add an existing package its pointing to the Python37-32/lib/site-packages folder.
SOLUTION:
I removed python from my machine, and reinstalled it. I had the same problem. What I done to fix this was to use
PS
python -m pip install --user package
Also I appended my PATH environment variable with
cmd
setx path "%path%;C:\Users\MyUser\AppData\Roaming\Python\Python38\Scripts"
That seemed to have taken care of my issue. Now when I install a package with PIP I can reference it through python.

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.

Problem with install pyinstaller with pip [duplicate]

Whenever I try to install a new python package I get this message first :
Defaulting to user installation because normal site-packages is not writeable
even though I have administrator rights and I am running my py scripts and installation commands on my computer.
Any ideas why I keep getting this message before every and each pip installation?
Thanks in advance
While this most likely is to be avoided, the only option I found to work is to use the --ignore-installed switch such as:
pip install -U --ignore-installed python-openstackclient
as root which allowed python to overwrite all old distro files with the correct new versions.
This is an old question, but it mirrored my problem well. After running python3 -m virtualenv myproject, it created myproject/local/bin/activate instead of myproject/bin/activate, and after sourcing this file, pip3 install some_package would report Defaulting to user installation because normal site-packages is not writeable and proceed to install packages as the user rather than the virtual environment.
The fix for both issues was:
sudo pip3 uninstall virtualenv
sudo apt install -y python3-virtualenv
This second command will be different for non-Debian distributions.
I had this problem. you can copy packages file to AppData>Roaming>Python>Python3.(X)>script directory
work for me!
first I need to ask when you open cmd, is python added to path? when you type 'python' in cmd does something happen? If not, try to add python to path, otherwise if that doesn't work, try re-installing python. Also which version of python do you have? Does this happen with every package you try to install? Finally if nothing works, try to change the download location of python, and run cmd as admin/without admin, try both.
For anyone who does not wanna reinstall python, if u get the defaulter message, then all you have to do is go to AppData>Roaming>Python>Python3.(X)>site-packages. Cut the folders that are related to the package(U can identify by seeing the date modified), and paste the folders in originally installed python.exe destination then>Lib>site-packages. Hopefully when you restart the code editor modules will work. I did this and it worked.

"Defaulting to user installation because normal site-packages is not writeable" python message

Whenever I try to install a new python package I get this message first :
Defaulting to user installation because normal site-packages is not writeable
even though I have administrator rights and I am running my py scripts and installation commands on my computer.
Any ideas why I keep getting this message before every and each pip installation?
Thanks in advance
While this most likely is to be avoided, the only option I found to work is to use the --ignore-installed switch such as:
pip install -U --ignore-installed python-openstackclient
as root which allowed python to overwrite all old distro files with the correct new versions.
This is an old question, but it mirrored my problem well. After running python3 -m virtualenv myproject, it created myproject/local/bin/activate instead of myproject/bin/activate, and after sourcing this file, pip3 install some_package would report Defaulting to user installation because normal site-packages is not writeable and proceed to install packages as the user rather than the virtual environment.
The fix for both issues was:
sudo pip3 uninstall virtualenv
sudo apt install -y python3-virtualenv
This second command will be different for non-Debian distributions.
I had this problem. you can copy packages file to AppData>Roaming>Python>Python3.(X)>script directory
work for me!
first I need to ask when you open cmd, is python added to path? when you type 'python' in cmd does something happen? If not, try to add python to path, otherwise if that doesn't work, try re-installing python. Also which version of python do you have? Does this happen with every package you try to install? Finally if nothing works, try to change the download location of python, and run cmd as admin/without admin, try both.
For anyone who does not wanna reinstall python, if u get the defaulter message, then all you have to do is go to AppData>Roaming>Python>Python3.(X)>site-packages. Cut the folders that are related to the package(U can identify by seeing the date modified), and paste the folders in originally installed python.exe destination then>Lib>site-packages. Hopefully when you restart the code editor modules will work. I did this and it worked.

PIP install package - installed but python is not importing

Running on Windows 10, I have Python 3.7.3 installed to my c/users/myUser/appdata/local/programs folder.
When I use PIP to install a package, it seems to run fine, but when I use "import package" in python it doesn't recognize that package. What would cause this?
Running 'python --version' works and also running 'pip --version' works.
PIP shows up in my c/users/myUser/appdata/local/programs/python37-32/lib/site-packages/pip folder.
UPDATE:
So I was looking through files to determine where the libraries are located that do work with my python. The folder is located in Python/Python37-32/Lib. All of those currently work when importing. However when I do anything with PIP it does not add anything to that folder.
I noticed there are a couple different PIP executables within Python/Python37-32/Scripts which include pip.exe, pip3.exe, and pip3.7.exe. I tried using "pip3.7 install numpy" which also did not work.
I noticed when trying to add an existing package its pointing to the Python37-32/lib/site-packages folder.
SOLUTION:
I removed python from my machine, and reinstalled it. I had the same problem. What I done to fix this was to use
PS
python -m pip install --user package
Also I appended my PATH environment variable with
cmd
setx path "%path%;C:\Users\MyUser\AppData\Roaming\Python\Python38\Scripts"
That seemed to have taken care of my issue. Now when I install a package with PIP I can reference it through python.

Categories