Python is by far one of the easiest programming languages for a complete beginner to learn. That said, it is powerful enough to be used by veterans for just about anything from computer vision to machine learning algorithms.
In this article, we’re talking about the “fatal error in launcher: unable to create process using PiP” error in Python, its causes and what you can do to fix the problem.
What causes this error?
The error is generally triggered when PiP, Python’s built-in package manager cannot install a package. Common causes include:
- Corrupt Python installation.
- Outdated PiP version.
- PiP isn’t installed.
- PiP isn’t added to your environment variables.
Also read: How to fix Fatal error: Python.h: No such file or directory?
How to fix this?
Here are five fixes you can try out.
Update Python and Pip
Python and its package manager Pip both get frequent updates. Using an older version can lead to problems when installing external packages like Wheel.
While updating Python is as simple as running the command in the fix mentioned above, you can update pip by typing the following command in a terminal.
pip install upgrade
Update Pip dependencies
There’s also a chance that Pip’s dependencies may be causing problems. To ensure everything’s up to date, you can update setuptools and wheel using these commands once you’ve updated Pip.
pip install –upgrade wheel pip install –upgrade setuptools
Set up the environment variables
Even if Python is installed on your computer if you haven’t set up the environment variables correctly, you’re going to run into problems. Here’s how you can set the correct environment variables for Python.
Step 1: Press Windows Key + R to open the Run prompt. Type sysdm.cpl and hit enter.
Step 2: Head over to the Advanced tab and click Environment Variables.
Step 3: Select Path under User variables and click Edit.
Step 4: Enter the installation paths for Python in the Edit environment variable window. The default Python installation paths for version 3.7 and above are as follows.
Make sure to change the aforementioned file paths according to your Windows user name and your installed Python version. Now restart your computer, and the error should be resolved.
Install packages using a Python script
You can also use a Python script to install the packages required. Here’s a small snippet showing how to install a package using a script.
import sys import subprocess python = sys.executable subprocess.check_call( [python, '-m', 'pip', 'install', 'package_name'] )
Make sure to replace the package_name placeholder in the script above with the name of the package you’re looking to install and you should be good to go.
Run a clean install
If nothing else works, your best bet is to uninstall Python from your PC and reinstall it again from scratch. This ensures that any wrong variables or modules that might be installed in the wrong places get removed, and everything else is done from the beginning in the correct order.
Check out our detailed guide for additional troubleshooting on PiP not working on your Windows machine.
Also read: How to fix Ray out of memory error in Python?
Someone who writes/edits/shoots/hosts all things tech and when he’s not, streams himself racing virtual cars.
You can contact him here: [email protected]