'Invalid Python SDK' error right after creating a new project in PyCharm
‘Invalid Python SDK’ error right after creating a new project in PyCharm
Background
Some time ago I seriously crashed my Windows computer while using PyCharm – I remember some errors about memory and then a hard crash with no blue screen – just black with some thin vertical lines and reboot to Windows installation / fixing screen. Since then, I had this problem, with no way I found online to fix this.
Edit : Apparently, this has nothing to do with the problem.
The problem
Whenever I open a project, or create a new one, an error appears with the Invalid Python SDK error message.
Also, this is what the work environment looks like the moment I close this message. In the Project window, the venv directory (and every directory under it) is marked as an Exclusion, and in the code, the print(f’Hi,
![]()
What’s more, when I go to Python Interpreter settings at File -> Settings -> Project -> Python Interpreter there’s a yellow bar on the bottom which says:
which after some time says:
Python packaging tools not found.
Upon installing, nothing changes, and I can’t add packages from this screen (the ‘+’ button is greyed out):

When I try to check Python interpreter paths, there are no paths shown, and I don’t know what that means:

In short, all of the default Python functions like print are marked as errors, even though they work when executed. This makes coding extremely confusing, as I can’t quickly distinguish between real errors and ‘errors’.
The search for solution
Normally this would be a problem with interpreter set-up or path, but I’ve tried most of the methods proposed in other answers to similar questions. To name a few :
- PyCharm shows unresolved references error for valid code
- ‘Cannot setup a Python SDK’ in PyCharm project using virtualenv after OS reinstallation
- Why do I get an ‘SDK seems invalid’ error when setting up my Project Interpreter in PyCharm?
- Invalid Python SDK Error while using python 3.4 on PyCharm
- Invalid Python SDK when setting a venv
There were supposed to be links, but I don’t have enough reputation on Stack Overflow to post them with the questions. These, however, can be easily looked up in Google, all of them are posted to Stack Overflow.
What I tried
I should mention that the first things I tried were removing and installing PyCharm, all user configurations and Python itself as well. I installed Python from the official site, and from the PyCharm application, both methods ended with the same result.
- File -> Invalidate Caches. -> Invalidate and restart. Didn’t work.
- Checking file interpreter in Edit Configurations . Don’t know what to make of it. The result:

- Refreshing the interpreter paths. Even now, the paths yield no results.

- Removing the interpreter and adding it again. No result.
- Deleting the .idea folder. No result.
- Deleting PyCharm user preferences under %homepath%/.PyCharm50 . I don’t have that folder though.
- Switching interpreter back and forth. No result.
- Creating a new interpreter in a different location. No result.
- Marking project directory as root ProjectName -> Mark Directory as -> Sources Root and unmarking other directories as Excluded. No result.
- Using no interpreter. Yeah, it doesn’t mark non-errors as errors anymore. But the code doesn’t work. That’s not a solution for me.
- Checking if venv/pyvenv.cfg has paths set correctly. These look fine to me.

- Checking Windows environment variables – Path variable. It was in the user section, but wasn’t in the system section. I added it, restarted but still no result.
- Changing account name in Windows. My account name was ‘username’ and that’s how my User folder is called `C:Usersusername’, but I later connected it to Microsoft account and my user name is now User Name with a space and I can’t really change it. My folder stayed the same. Not sure if I can fix it that way.
To the two last things I tried I should also add that I changed my Windows username from ‘username’ to ‘user name’ with a space, but that wasn’t until recently.
I’m attaching the idea.log file for you to check. I replaced my real username with ‘User Name’ to highlight the existence of a space.
Solution – 1
OK, that was a lucky one! I’m thus posting my comment as an answer:
The problem is caused by the non-ASCII characters in the path, and the solution is to remove them. As indicated by @TheLazyScripter this is a known issue.
How to fix invalid python sdk error while using python 3.4 on pycharm in Python 3.X?
Invalid Python SDK Error is a common issue faced by PyCharm users while using Python 3.4. This error occurs when PyCharm is unable to detect a valid Python installation in the system or the installed Python version is not supported by the PyCharm IDE. This issue can be resolved by following a few simple steps which are outlined below:
Method 1: Installing a Supported Version of Python
If you are facing the Invalid Python SDK Error while using Python 3.4 on PyCharm, you can fix it by installing a supported version of Python. Here are the steps to do it:
First, you need to download a supported version of Python. You can download Python 3.4 from the official website: https://www.python.org/downloads/release/python-340/
Install Python 3.4 on your system. Make sure to select the option to add Python to your system PATH during the installation process.
Open PyCharm and go to File > Settings > Project: <project_name> > Project Interpreter.
Click on the gear icon and select "Add".
In the "Add Python Interpreter" window, select "System Interpreter".
Click on the ". " button next to the "Interpreter" field.
In the "Python Interpreters" window, click on the "+" icon.
In the "Add Python Interpreter" window, select "Virtualenv Environment".
Enter a name for your new virtual environment and select "Python 3.4" as the base interpreter.
Click on "OK" to create the virtual environment.
Select the newly created virtual environment as the interpreter for your project.
Click on "OK" to save the changes.
Now, you should be able to use Python 3.4 in PyCharm without any issues. Here is an example of a Python script that you can run to test if everything is working correctly:
When you run this script, you should see the output "Hello, World!" in the console.
That's it! You have successfully fixed the Invalid Python SDK Error in PyCharm by installing a supported version of Python.
Method 2: Updating PyCharm
To fix the Invalid Python SDK Error while using Python 3.4 on PyCharm, you can try updating PyCharm to the latest version. Here are the steps to do so:
- Open PyCharm and click on "Help" in the menu bar.
- Click on "Check for Updates" and wait for PyCharm to check for updates.
- If there are any updates available, click on "Update" to download and install the updates.
- Once the updates are installed, restart PyCharm.
- Open your Python 3.4 project in PyCharm and go to "File" > "Settings" > "Project Interpreter".
- Click on the gear icon and select "Add".
- Select "System Interpreter" and click on the ". " button.
- Browse to the location of your Python 3.4 interpreter and select it.
- Click on "OK" to add the interpreter to PyCharm.
- PyCharm should now recognize the Python 3.4 interpreter and the Invalid Python SDK Error should be resolved.
In the above code, we are importing the sys module and printing the Python version and version info. This is just an example to show that the Python 3.4 interpreter has been added to PyCharm.
Overall, updating PyCharm is a simple and effective way to fix the Invalid Python SDK Error while using Python 3.4 on PyCharm.
Method 3: Checking the System Environment Variables
To fix the Invalid Python SDK Error while using Python 3.4 on PyCharm, you can check the System Environment Variables. Here are the steps:
- Open the System Properties by right-clicking on "This PC" and selecting "Properties".
- Click on "Advanced system settings".
- Click on "Environment Variables".
- Under "System Variables", check if there is a "Path" variable. If not, click on "New" and add a new variable called "Path".
- Click on "Edit" and add the path to your Python 3.4 installation folder. For example, "C:\Python34".
- Click "OK" to close all the windows.
After completing these steps, PyCharm should be able to locate the Python 3.4 interpreter and the Invalid Python SDK Error should be resolved.
Here is an example code to check the System Environment Variables and add the Python 3.4 path to the "Path" variable:
This code checks if the Python 3.4 path is already in the "Path" variable and adds it if it is not there. The os.environ.get() function gets the value of the "Path" variable and the os.environ['Path'] statement sets the new value of the "Path" variable with the Python 3.4 path added to it.
Another example code to check the System Environment Variables and print the value of the "Path" variable:
This code gets the value of the "Path" variable using os.environ.get() and prints it using the print() function.
Method 4: Reinstalling PyCharm
If you are facing the "Invalid Python SDK Error" while using Python 3.4 on PyCharm, you can try reinstalling PyCharm to fix the issue. Here are the steps to do it:
Uninstall PyCharm: First, you need to uninstall the existing PyCharm from your system. You can do it by following the steps given below:
- On Windows: Go to Control Panel > Programs > Programs and Features, select PyCharm and click on Uninstall.
- On Mac: Drag the PyCharm app to the Trash.
- On Linux: Use the package manager to uninstall PyCharm.
Download and Install PyCharm: Once you have uninstalled PyCharm, download the latest version of PyCharm from the official website and install it on your system.
Configure Python Interpreter: After installing PyCharm, you need to configure the Python interpreter. Here are the steps to do it:
- Open PyCharm and go to File > Settings > Project: <project name> > Project Interpreter.
- Click on the gear icon and select "Add".
- Select "System Interpreter" and choose the Python 3.4 interpreter from the list.
- Click on "OK" to save the settings.
Test the Configuration: Finally, you can test the configuration by creating a new Python project and running a sample program. Here is an example program:
- Create a new Python file in PyCharm and copy the above code.
- Run the program by clicking on the Run button or by pressing Shift+F10.
- If the program runs without any errors, your PyCharm configuration is working fine.
That's it! By following the above steps, you should be able to fix the "Invalid Python SDK Error" while using Python 3.4 on PyCharm by reinstalling PyCharm.
Method 5: Using the Correct Python Interpreter in PyCharm
To fix the "Invalid Python SDK Error" while using Python 3.4 on PyCharm, you can use the following steps to ensure that you are using the correct Python interpreter in PyCharm.
Open PyCharm and go to "File" > "Settings" > "Project Interpreter".
Click on the gear icon in the top right corner and select "Add".
In the "Add Python Interpreter" window, select "System Interpreter" and click "OK".
In the "Interpreter" field, select the path to your Python 3.4 interpreter. This may be something like "/usr/bin/python3.4" or "C:\Python34\python.exe".
Click "OK" to save the interpreter.
If PyCharm prompts you to install any packages, click "Install".
Once the packages are installed, you should be able to run your Python 3.4 code in PyCharm without any issues.
Here's an example of how to set the Python interpreter in PyCharm using the Python API:
In this example, we first set the path to our Python 3.4 interpreter using the python_path variable. We then add this path to the system path using the sys.path.append() method.
Finally, we use the PyCharmSettings class from the pycharm_settings module to set the Python interpreter in PyCharm using the set_interpreter() method.
By following these steps, you should be able to fix the "Invalid Python SDK Error" while using Python 3.4 on PyCharm.
Issue
Some time ago I seriously crashed my Windows computer while using PyCharm — I remember some errors about memory and then a hard crash with no blue screen — just black with some thin vertical lines and reboot to Windows installation / fixing screen. Since then, I had this problem, with no way I found online to fix this.
Edit : Apparently, this has nothing to do with the problem.
The problem
Whenever I open a project, or create a new one, an error appears with the Invalid Python SDK error message.
Also, this is what the work environment looks like the moment I close this message. In the Project window, the venv directory (and every directory under it) is marked as an Exclusion, and in the code, the print(f’Hi,

What’s more, when I go to Python Interpreter settings at File -> Settings -> Project -> Python Interpreter there’s a yellow bar on the bottom which says:
which after some time says:
Python packaging tools not found.
Upon installing, nothing changes, and I can’t add packages from this screen (the ‘+’ button is greyed out):

When I try to check Python interpreter paths, there are no paths shown, and I don’t know what that means:

In short, all of the default Python functions like print are marked as errors, even though they work when executed. This makes coding extremely confusing, as I can’t quickly distinguish between real errors and ‘errors’.
The search for solution
Normally this would be a problem with interpreter set-up or path, but I’ve tried most of the methods proposed in other answers to similar questions. To name a few :
- PyCharm shows unresolved references error for valid code
- ‘Cannot setup a Python SDK’ in PyCharm project using virtualenv after OS reinstallation
- Why do I get an ‘SDK seems invalid’ error when setting up my Project Interpreter in PyCharm?
- Invalid Python SDK Error while using python 3.4 on PyCharm
- Invalid Python SDK when setting a venv
There were supposed to be links, but I don’t have enough reputation on Stack Overflow to post them with the questions. These, however, can be easily looked up in Google, all of them are posted to Stack Overflow.
What I tried
I should mention that the first things I tried were removing and installing PyCharm, all user configurations and Python itself as well. I installed Python from the official site, and from the PyCharm application, both methods ended with the same result.
- File -> Invalidate Caches. -> Invalidate and restart. Didn’t work.
- Checking file interpreter in Edit Configurations . Don’t know what to make of it. The result:

- Refreshing the interpreter paths. Even now, the paths yield no results.

- Removing the interpreter and adding it again. No result.
- Deleting the .idea folder. No result.
- Deleting PyCharm user preferences under %homepath%/.PyCharm50 . I don’t have that folder though.
- Switching interpreter back and forth. No result.
- Creating a new interpreter in a different location. No result.
- Marking project directory as root ProjectName -> Mark Directory as -> Sources Root and unmarking other directories as Excluded. No result.
- Using no interpreter. Yeah, it doesn’t mark non-errors as errors anymore. But the code doesn’t work. That’s not a solution for me.
- Checking if venv/pyvenv.cfg has paths set correctly. These look fine to me.

- Checking Windows environment variables — Path variable. It was in the user section, but wasn’t in the system section. I added it, restarted but still no result.
- Changing account name in Windows. My account name was ‘username’ and that’s how my User folder is called `C:\Users\username’, but I later connected it to Microsoft account and my user name is now User Name with a space and I can’t really change it. My folder stayed the same. Not sure if I can fix it that way.
To the two last things I tried I should also add that I changed my Windows username from ‘username’ to ‘user name’ with a space, but that wasn’t until recently.
I’m attaching the idea.log file for you to check. I replaced my real username with ‘User Name’ to highlight the existence of a space.
Solution
OK, that was a lucky one! I’m thus posting my comment as an answer:
The problem is caused by the non-ASCII characters in the path, and the solution is to remove them. As indicated by @TheLazyScripter this is a known issue.
Invalid Python SDK in PyCharm
Since this morning, I’m no longer able to run projects in PyCharm.
When generating a new virtual environment, I get an "Invalid Python SDK" error. Cannot set up a python SDK at Python 3.11. The SDK seems invalid.
What I noticed: No matter what base interpreter I select (3.8, 3.9, 3.10) Pycharm always generates a Python 3.11 interpreter.
I did completely uninstall PyCharm, as well as all my python installations and reinstalled everything. I also went through the "Repair IDE" option in PyCharm. I also removed and recreated all virtual environments.
When I run "cmd" and type ‘python’ then python 3.10.1 opens without a problem.
This morning, I installed a new antivirus software that did some checks and deleted some "unnecessary files" — maybe it is related (antivirus software is uninstalled again).