Fatal error in launcher: Unable to create process using pip.exe - python

Fatal error in launcher: Unable to create process using '"c:\users\owner\appdata\local\programs\python\python37-32\python.exe" "C:\Python37-32\Scripts\pip.exe" install pygame'
I have been trying to use pip installations in command prompt for the past while now and keep getting this issue. the first file location now no longer exists. Can anyone help me with this problem please ?

When we are looking at the execution file of pip, we can see the major entry file of python that pip is using, modify it to right path, and its done!
Or as described in https://stackoverflow.com/a/55210770/7621301 , you can reinstall pip.

Uninstall your current python and its launcher from control penal
Then download new python version and install it
While installing new one make sure you tick Add Launcher to all users(recommended) and ADD python to PATH both.
Now click customized install and tick all the boxes and install it
After install complete open powershell or cmd and type python to check it is
installed properly if you see:
PS C:\Users\Rohit> python
Python 3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
exit()
type exit() for quit python
This that means successfully installed
4.Now let's type pip + ENTER
if you see multiple pip commands congratulations your good to go
5.Okay then try to install your required python library
e.g : pip install pyttsx
PS C:\Users\Rohit> pip install pyttsx3
Defaulting to user installation because normal site-packages is not writeable
Collecting pyttsx3
Using cached pyttsx3-2.90-py3-none-any.whl (39 kB)
Collecting pywin32
Using cached pywin32-302-cp310-cp310-win_amd64.whl (9.2 MB)
Collecting pypiwin32
Using cached pypiwin32-223-py3-none-any.whl (1.7 kB)
Collecting comtypes
Using cached comtypes-1.1.10.tar.gz (145 kB)
Using legacy 'setup.py install' for comtypes, since package 'wheel' is not installed.
Installing collected packages: pywin32, pypiwin32, comtypes, pyttsx3
If your see this kind of stuff, your problem is solved.
NOTE : In case it not solved go to Microsoft store and install python and launch it. Then press windows button and search for edit environment variable >> environment variable. Check if python is added to the PATH if not then add it.

Related

Why am I unable to import the pcse (python crop simulation environment) into my jupyter notebook and how do I fix it?

I installed pcse using this user guide: https://pcse.readthedocs.io/en/stable/user_guide.html#getting-started . I am unable to import the package in jupyter notebook while I have the environment activated in the miniconda terminal.
(base) C:\Users\merej>activate py3_pcse
(py3_pcse) C:\Users\merej>
I don't know if I'm required to add the virtual environment to jupyter notebook in order to use it so I added it using
pip install --user ipykernel
python -m ipykernel install --user --name=py3_pcse
The Kernel shows up in Jupyter notebook;However, Jupyter notebook is unable to connect to the notebook server. This is not a problem when I create a python3 notebook.
I saw that this may be a problem with Tornado so I uninstalled my current tornado, installed tornado 5.1.1, got an error message saying the tornando 5.1.1 would not work with my current version of jupyter notebook, uninstalled tornado 5.1.1, and reinstalled the updated version of tornado.
(py3_pcse) C:\Users\merej>pip uninstall tornado
Found existing installation: tornado 6.2
Uninstalling tornado-6.2:
Would remove:
c:\users\merej\miniconda3\envs\py3_pcse\lib\site-packages\tornado-6.2.dist-info\*
c:\users\merej\miniconda3\envs\py3_pcse\lib\site-packages\tornado\*
Proceed (Y/n)? y
Successfully uninstalled tornado-6.2
(py3_pcse) C:\Users\merej>pip install tornado==5.1.1
Collecting tornado==5.1.1
Downloading tornado-5.1.1.tar.gz (516 kB)
---------------------------------------- 516.8/516.8 kB 550.0 kB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Building wheels for collected packages: tornado
Building wheel for tornado (setup.py) ... done
Created wheel for tornado: filename=tornado-5.1.1-cp38-cp38-win_amd64.whl size=449834 sha256=160b8413fde8328df013e8729e86a92138e32c365dc6d9dc97a3e04b6cca17ea
Stored in directory: c:\users\merej\appdata\local\pip\cache\wheels\25\a1\e3\b0d37c6c451fc21f290cf026f6352382e6cbced32dc3f6a37a
Successfully built tornado
Installing collected packages: tornado
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
notebook 6.4.12 requires tornado>=6.1, but you have tornado 5.1.1 which is incompatible.
jupyterlab 3.4.4 requires tornado>=6.1.0, but you have tornado 5.1.1 which is incompatible.
jupyter-server 1.18.1 requires tornado>=6.1.0, but you have tornado 5.1.1 which is incompatible.
jupyter-client 7.3.5 requires tornado>=6.2, but you have tornado 5.1.1 which is incompatible.
ipykernel 6.15.2 requires tornado>=6.1, but you have tornado 5.1.1 which is incompatible.
Successfully installed tornado-5.1.1
(py3_pcse) C:\Users\merej>pip uninstall tornado
Found existing installation: tornado 5.1.1
Uninstalling tornado-5.1.1:
Would remove:
c:\users\merej\miniconda3\envs\py3_pcse\lib\site-packages\tornado-5.1.1.dist-info\*
c:\users\merej\miniconda3\envs\py3_pcse\lib\site-packages\tornado\*
Proceed (Y/n)? y
Successfully uninstalled tornado-5.1.1
(py3_pcse) C:\Users\merej>pip install tornado
Collecting tornado
Using cached tornado-6.2-cp37-abi3-win_amd64.whl (425 kB)
Installing collected packages: tornado
Successfully installed tornado-6.2
This Jupyter notebook: https://github.com/ajwdewit/pcse_notebooks/blob/master/01%20Getting%20Started%20with%20PCSE.ipynb doesn't say anything about a kernel so perhaps I installed pcse into the wrong place. My installation passes all of the tests that are listed in the user guide using the miniconda terminal. I saw that this may be a problem with the version of pip that I used to install it since pcse uses python version 3.8; However, I believe that I am using the correct version of pip.
(py3_pcse) C:\Users\merej>pip --version
pip 22.2.2 from C:\Users\merej\miniconda3\envs\py3_pcse\lib\site-packages\pip (python 3.8)
(py3_pcse) C:\Users\merej>python --version
Python 3.8.13
Then I thought it may be a path problem so I made a python path in jupyter notebook using the path given by using python in the miniconda terminal but that also did not work.
(py3_pcse) C:\Users\merej>python
Python 3.8.13 (default, Mar 28 2022, 06:59:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pcse
>>> pcse.__path__
['C:\\Users\\merej\\miniconda3\\envs\\py3_pcse\\lib\\site-packages\\pcse']
My level of understanding of all this is relatively low so feel free to explain anything you might find helpful.
Thanks!
tl;dr: You want to import pcse, but your jupyter kernel cannot yet do that.
You have correctly diagnosed this as being a virtual-environment issue.
And you're using conda, so the battle is half won already!
You chose to name your conda environment "py3_pcse", a perfectly good name.
That environment contains both PCSE and Jupyter dependencies.
Start by trying this in the base environment:
$ python -c 'import pcse'
Notice that, unsurprisingly, it fails.
Now $ conda activate py3_pcse, repeat the import, notice that it (silently) succeeds.
Here is the critically important piece.
While the environment is still active,
start the kernel with $ jupyter notebook
If the cPython interpreter could access pcse,
then the jupyter kernel will be able to, also.
Verify, by importing within a cell.

qt6 designer in python [duplicate]

Feeling really stupid, right now, but the title says it all:
How do you start the QtDesigner?
I've installed PyQt5 via pip and I believe to have identified the directory it's been installed in as
C:\Users\%username%\AppData\Local\Programs\Python\Python36\Lib\site-packages\PyQt5
Now what? There are a lot of .pyd files, some .dll's, too, but nothing executable (well, except a QtWebEngineProcess.exe in ...\site-packages\PyQt5\Qt\bin, but that doesn't sound like what I'm looking for.
I struggled with this as well. The pyqt5-tools approach is cumbersome so I created a standalone installer for Qt Designer. It's only 40 MB. Maybe you will find it useful!
If you are working in python virtual environment, in the command window
>>qt5-tools designer
can open designer window.
The latest PyQt5 wheels (which can be installed via pip) only contain what's necessary for running applications, and don't include the dev tools. This applies to PyQt versions 5.7 and later. For PyQt versions 5.6 and earlier, there are binary packages for Windows that also include the dev tools, and these are still available at sourceforge. The maintainer of PyQt does not plan on making any further releases of such binary packages, though - only the runtime wheels will now be made available, and there will be no official wheels for the dev tools.
In light of this, someone has created an unofficial pyqt5-tools wheel (for Windows only). This appears to be in it's early stages, though, and so may not keep up with recent PyQt5 releases. This means that it may not always be possible to install it via pip. If that is the case, as a work-around, the wheel files can be treated as zip files and the contents extracted to a suitable location. This should then allow you to run the designer.exe file that is in the pyqt5-tools/designer folder.
Finally, note that you will also see some zip and tar.gz files at sourceforge for PyQt5. These only contain the source code, though, so will be no use to you unless you intend to compile PyQt5 yourself. And just to be clear: compiling from source still would not give you all the Qt dev tools. If you go down that route, you would need to install the whole Qt development kit separately as well (which would then get you the dev tools).
The Qt designer is not installed with the pip installation.
You can either download the full download from sourceforge (probably won't be the last pyqt release, and might be buggy on presence of another installation, like yours) or install it with another (unofficial) pypi package - pyqt5-tools (pip install pyqt5-tools), then run the designer from the following subpath of your python directory -
...\Python36\Lib\site-packages\pyqt5-tools\designer\designer.exe
pip install pyqt5-tools
Then restart the cmd, just type "designer" and press enter.
If you cannot see the Designer , just look into this path "Lib\site-packages\qt5_applications\Qt\bin" for designer.exe and run it.
PyQt5 works after pip install PyQt5Designer
pip install pyqt5-tools
working in python 3.7.4
wont work in python 3.8.0
You can also install Qt Designer the following way:
Install latest Qt (I'm using 5.8) from Qt main site
Make sure you include "Qt 5.8 MinGW" component
Qt Designer will be installed in C:\Qt\5.8\mingw53_32\bin\designer.exe
Note that the executable is named "designer.exe"
For anyone stumbling across this post in 2021+ and finding the answers outdated: QT Designer is now in the qt5-applications package, under Qt\bin\. On Windows this means the default path, for CPython 3.9 using the Python.org installer, is %APPDATA%\Python\Python39\site-packages\qt5_applications\Qt\bin\designer.exe.
Download the module using pip:
pip install PyQt5Designer
Then, for anaconda users, open:
C:\ProgramData\AnacondaX\Lib\site-packages\QtDesigner\designer.exe
For python users:
64-bit:
C:\Program Files\PythonXX\Lib\site-packages\QtDesigner\designer.exe
32-bit:
C:\Program Files (x86)\PythonXX\Lib\site-packages\QtDesigner\designer.exe
Try using:
pip install pyqt5-tools
Now you'd find the designer in site-packages/pyqt5-tools.
If you are installing the pyqt5-tools then you can find the designer.exe file inside:
<python_installation>\Lib\site-packages\Qt
If you cannot locate the file or have any issues opening this directly, then open a command prompt and type:
<python_installation>\Scripts\pyqt5designer.exe
For Qt Designer 6 this worked for me thanks for that protip from #Bhaskar
pip install pyqt6-tools
Then started:
qt6-tools designer
End up with nice working lightweight Qt Designer 6.0.1 version
# pip install pyqt6-tools
Collecting pyqt6-tools
Using cached pyqt6_tools-6.1.0.3.2-py3-none-any.whl (29 kB)
Collecting pyqt6-plugins<6.1.0.3,>=6.1.0.2.2
Downloading pyqt6_plugins-6.1.0.2.2-cp39-cp39-manylinux2014_x86_64.whl (77 kB)
|████████████████████████████████| 77 kB 492 kB/s
Collecting python-dotenv
Using cached python_dotenv-0.19.2-py2.py3-none-any.whl (17 kB)
Collecting pyqt6==6.1.0
Downloading PyQt6-6.1.0-cp36.cp37.cp38.cp39-abi3-manylinux_2_28_x86_64.whl (6.8 MB)
|████████████████████████████████| 6.8 MB 1.0 MB/s
Requirement already satisfied: click in ./.pyenv/versions/3.9.6/lib/python3.9/site-packages (from pyqt6-tools) (8.0.1)
Collecting PyQt6-sip<14,>=13.1
Downloading PyQt6_sip-13.2.0-cp39-cp39-manylinux1_x86_64.whl (307 kB)
|████████████████████████████████| 307 kB 898 kB/s
Collecting PyQt6-Qt6>=6.1.0
Using cached PyQt6_Qt6-6.2.2-py3-none-manylinux_2_28_x86_64.whl (50.0 MB)
Collecting qt6-tools<6.1.0.2,>=6.1.0.1.2
Downloading qt6_tools-6.1.0.1.2-py3-none-any.whl (13 kB)
Collecting click
Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
|████████████████████████████████| 82 kB 381 kB/s
Collecting qt6-applications<6.1.0.3,>=6.1.0.2.2
Downloading qt6_applications-6.1.0.2.2-py3-none-manylinux2014_x86_64.whl (80.5 MB)
|████████████████████████████████| 80.5 MB 245 kB/s
Installing collected packages: qt6-applications, PyQt6-sip, PyQt6-Qt6, click, qt6-tools, pyqt6, python-dotenv, pyqt6-plugins, pyqt6-tools
Attempting uninstall: click
Found existing installation: click 8.0.1
Uninstalling click-8.0.1:
Successfully uninstalled click-8.0.1
Successfully installed PyQt6-Qt6-6.2.2 PyQt6-sip-13.2.0 click-7.1.2 pyqt6-6.1.0 pyqt6-plugins-6.1.0.2.2 pyqt6-tools-6.1.0.3.2 python-dotenv-0.19.2 qt6-applications-6.1.0.2.2 qt6-tools-6.1.0.1.2
you should find it here if your using anaconda
C:\Users\%username%\anaconda3\envs\untitled\Lib\site-packages\qt5_applications\Qt\bin
By far the easiest way to do this is to use this installer:
https://build-system.fman.io/qt-designer-download
It seems as though the other answers here are now out of date, not to mention confusing for someone who is just starting out with this. Sourceforge no longer has this package, I installed the tools as suggested but nothing appeared in the scripts folder, and none of the pip commands above worked either.
I was having the same problem, however I was able to install using the Pygame module installation code, changing some information:
pygame:
py -m pip install -U pygame --user
PyQt5:
py -m pip install -U pyqt5-tools --user
In a Windows' terminal, activate your virtual env where you have installed PyQt5 then just type designer.
You can create a shortcut by finding its path with where designer

Installing Packages on ATOM for python (linter and autopep8)

I am trying to set up my environment for ATOM for python. I did this on my previous PC and didn't run into much trouble but this time I believe something is messed up and I don't know how to fix it.
Linter-flake8 installation:
I installed it by doing this:
settings --> install --> search packages --> linter-flake8 --> install.
Dependencies were installed afterward automatically.
then I ran the CMD and installed flake8 using:
py -m pip install flake8
When I try typing my code into ATOM; I get this error:
[Linter] Error running Flake8 Error: Failed to spawn command `flake8`. Make sure `flake8` is installed and on your PATH
at C:\Users\yazan\.atom…\lib\helpers.js:130
(anonymous) # C:\Users\yazan\.atom…ter\dist\index.js:1
Things I tried to fix this:
Adding ATOM to my path, which I did but did not work (ATOM and
Python both are in my user and system, environment variables)
Checking that my ATOM is running the same version of python.
import sys
print(sys.version)
3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)]
Checked installation path for my linter-flake8 in CMD:
result -->
C:\Users\yazan>py -m pip install flake8
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: flake8 in c:\users\yazan\appdata\roaming\python\python39\site-packages (3.9.2)
Requirement already satisfied: mccabe<0.7.0,>=0.6.0 in
c:\users\yazan\appdata\roaming\python\python39\site-packages (from flake8) (0.6.1)
Requirement already satisfied: pyflakes<2.4.0,>=2.3.0 in
c:\users\yazan\appdata\roaming\python\python39\site-packages (from flake8) (2.3.1)
Requirement already satisfied: pycodestyle<2.8.0,>=2.7.0 in
c:\users\yazan\appdata\roaming\python\python39\site-packages (from flake8) (2.7.0)
I am running out of ideas and searched a lot but could not figure out how to fix this.
Thanks!
As mentioned in the linter-flake8 README, you can set the executablePath in the package settings. This should help you get around Atom's flaky support for environment variables.

How to get Python packages installed as .exe to run on Windows 10; "failed to create process"

After installing Python 3.5.1 on Windows 10 x64, cpplint installed from pip produces the error: failed to create process. There seems to be a possibly related issue with pip related to having a space in the path, which exists in my use case. It seems to be related to how the exe is created. How can this error be remedied? Reinstalling Python and cpplint does not solve the problem.
C:\Users>python -V
Python 3.5.1
C:\Users>pip list
pip (7.1.2)
setuptools (18.2)
C:\Users>pip -V
pip 7.1.2 from c:\users\john hagen\appdata\local\programs\python\python35\lib\site-packages (python 3.5)
C:\Users>pip install cpplint
Collecting cpplint
Using cached cpplint-0.0.6.tar.gz
Installing collected packages: cpplint
Running setup.py install for cpplint
Successfully installed cpplint-0.0.6
C:\Users>where.exe cpplint
C:\Users\John Hagen\AppData\Local\Programs\Python\Python35\Scripts\cpplint.exe
C:\Users>cpplint
failed to create process.
Yep, this is a pip bug.
The workaround is to add quotes around the path in the first line of generated python scripts in the \Scripts\ directory. In the case of cpplint this is 'cpplint-script.py'. In your case the generated first line should something like:
#!c:\users\john hagen\appdata\local\programs\python\python35\python.exe
and should be edited to:
#!"c:\users\john hagen\appdata\local\programs\python\python35\python.exe"

Install GDAL in virtualenvwrapper environment

I tried to install gdal (pip install gdal)in virtualenvwrapper environment but I got this error :
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for gdal
Failed to build gdal
I tried also "pip install --no-install GDAL" but there is nooption --no-install
what should I do !?
Yes, installing GDAL in a venv is a doozy. Conveniently, I just wrote up the documentation on how to do so for my advisor's lab! While I am not savvy enough to pinpoint the exact cause of your error, I can give you a bunch of things to try to fix it.
First, ensure you have gdal installed on the host (i.e. not in a venv). I just run the following:
sudo apt-get install libgdal1i libgdal1-dev libgdal-dev
Now run gdal-config --version to get the version that apt-get provided you with. For example I get 1.11.3
Now, the easiest way in my experience to get the python bindings in a venv is using pygdal. The trick is to get the right version! To do so, activate your virtual environment and run
pip install pygdal==1.11.3
but replace the version with whatever you got from gdal-config --version. Note: you may get an error that says
Could not find a version that satisfies the requirement pygdal==1.11.3 (from versions: 1.8.1.0, 1.8.1.1, 1.8.1.2, 1.8.1.3, 1.9.2.0, 1.9.2.1, 1.9.2.3, 1.10.0.0, 1.10.0.1, 1.10.0.3, 1.10.1.0, 1.10.1.1, 1.10.1.3, 1.11.0.0, 1.11.0.1, 1.11.0.3, 1.11.1.0, 1.11.1.1, 1.11.1.3, 1.11.2.1, 1.11.2.3, 1.11.3.3, 1.11.4.3, 2.1.0.3) No matching distribution found for pygdal==1.11.3
If that happens, run the pip install again but with the highest version that still matches. e.g. in this case you would run pip install pygdal==1.11.3.3
Once pygdal has been successfully installed, you should be able to call
>>> from osgeo import gdal
Please let me know if anything fails and I'll do what I can to adjust my instructions. Also, if you need help with Proj.4, GEOS, or Cartopy, I have some experience there too.
use pygdal
pd#asghar:~$sudo apt-get install python3-gdal
pd#asghar:~$ virtualenv -p python3 test
Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/pd/test/bin/python3
Also creating executable in /home/pd/test/bin/python
Installing setuptools, pip, wheel...done.
pd#asghar:~$ gdal-config --version
2.1.3
pd#asghar:~$ test/bin/pip install pygdal==2.1.3
Collecting pygdal==2.1.3
Could not find a version that satisfies the requirement pygdal==2.1.3 (from versions: 1.8.1.0, 1.8.1.1, 1.8.1.2, 1.8.1.3, 1.9.2.0, 1.9.2.1, 1.9.2.3, 1.10.0.0, 1.10.0.1, 1.10.0.3, 1.10.1.0, 1.10.1.1, 1.10.1.3, 1.11.0.0, 1.11.0.1, 1.11.0.3, 1.11.1.0, 1.11.1.1, 1.11.1.3, 1.11.2.1, 1.11.2.3, 1.11.3.3, 1.11.4.3, 1.11.5.3, 2.0.0.3, 2.0.1.3, 2.0.2.3, 2.0.3.3, 2.1.0.3, 2.1.1.3, 2.1.2.3, 2.1.3.3, 2.2.0.3)
No matching distribution found for pygdal==2.1.3
pd#asghar:~$ test/bin/pip install pygdal==2.1.3.3
Collecting pygdal==2.1.3.3
Collecting numpy>=1.0.0 (from pygdal==2.1.3.3)
Using cached numpy-1.13.1-cp35-cp35m-manylinux1_x86_64.whl
Installing collected packages: numpy, pygdal
Successfully installed numpy-1.13.1 pygdal-2.1.3.3
pd#asghar:~$ source test/bin/activate
(test) pd#asghar:~$ python
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from osgeo import gdal
>>>
On MacOS, first do brew install:
brew install gdal
Then do pip install:
pip install gdal

Categories