Как исправить ошибку python: invalid python SDK?
Когда скачиваю библиотеку пишет ошибку
- Вопрос задан более двух лет назад
- 6644 просмотра
Комментировать
Решения вопроса 0
Ответы на вопрос 2
Maverickxo @Maverickxo
В папке проекта \venv(папка с вирт. окружением) внутри файл pyvenv.cfg измените имя учетной записи на текущую
Ответ написан 29 янв.
Нравится 1 1 комментарий
py_root_dev @py_root_dev
Спасибо огромное за эту информацию! Она мне сильно помогла.
1. Попробуйте пересоздать virtual environment и проверить работает ли любая программа типа Hello world!
2. Для pyautogui нет whl — надо собирать из исходников. А установлены ли у Вас MS Build Tools?
2. И, как обычно, кириллица в имени пользователя — сборка пакета неизбежно закончится ошибкой.
Ответ написан более двух лет назад
Комментировать
Нравится Комментировать
Ваш ответ на вопрос
Войдите, чтобы написать ответ
- Python
- +2 ещё
Почему при заходе на сайт выдаёт ошибку 403 Forbidden?
- 1 подписчик
- 13 часов назад
- 67 просмотров
Why do I get an ‘SDK seems invalid’ error when setting up my Project Interpreter in PyCharm?
I try to set up project interpteter Python 3.5 in Pycharm and get an SDK error? Any solution to fix it?
11k 8 8 gold badges 70 70 silver badges 108 108 bronze badges
asked Jan 5, 2016 at 18:33
NibiruSpetsnaz NibiruSpetsnaz
603 1 1 gold badge 5 5 silver badges 7 7 bronze badges
Did you just copy python34.exe to your desktop? Python is normally not installed into the desktop directory.
Jan 6, 2016 at 17:27
13 Answers 13
did you move the whole project after you open it with pycharm? if so, just remove the .idea/* (run rm -r .idea under you project)
This problem is caused by: pycharm will create a .idea file under the project after the first time you import the project. SO the path in there will remain the old one after you moved the project. Thus the pycharm will keep trying to import ‘old_path/venv/bin/activate’ which is kept in .idea/*
answered Aug 10, 2018 at 9:36
Yicheng Feng Yicheng Feng
369 3 3 silver badges 2 2 bronze badges
I reinstalled Python, recreated vritualenvs and this was the key to my problems seemingly. At least to some of them.
Jan 22, 2019 at 22:37
I had such problem. The solution was pretty easy. I created an account in russian in Windows, and you could emphasize that the error message (the big one) then contains the word about encoding is used. Therefore check your Windows account name — change it if it’s not in english and contains spaces and other unwanted signs. Thanks.
answered May 3, 2018 at 9:55
Sergei Shumilin Sergei Shumilin
431 5 5 silver badges 17 17 bronze badges
As of PyCharm 2022.2.2, PyCharm will still give you this error if you have a space in your Windows username or path to Python executable. I worked around this by making a symlink to the Python directory, without using spaces.
Nov 3, 2022 at 18:43
I just had this error and got around it, and long-story-short I think it may have had to do with my PATH / PY_HOME / PYTHONPATH environment variables pointing to a different version of Python. Here’s what I did:
Background:
- In my case, I was trying to get a Python 2.7 venv running on a laptop where I’d previously been working with Python 3.
- I’m using Windows 7.
Solution:
- Hit the Windows key to pop up the Start menu.
- Type out ‘path’ and hit Enter.
- The ‘Environment Variables’ window should appear.
- There should be two sections of the window:
- One should say, «User variables for your_user_name».
- The other should say «System variables».
- I removed any references to Python 3.
- I set the PY_HOME variable to C:\Python27 (or whatever the path is to the Python installation you’re trying to get working in PyCharm.)
answered Nov 19, 2016 at 2:48
Nathan Wailes Nathan Wailes
11k 8 8 gold badges 70 70 silver badges 108 108 bronze badgesI got the same problem on windows 10, and got the solution.
Root cause: — Python cannot be launched due to no python27.dll.
Solution: — Install python or put python27.dll in PATH
answered Oct 17, 2017 at 3:44
21 3 3 bronze badgesIn my case, python.exe that I had in my venv was the problem.
Thus, I downloaded a specific version of Python and pasted contests of its Script folder to my \venv\Scripts folder.
answered Apr 16, 2021 at 14:15
Başar Söker Başar Söker
686 8 8 silver badges 17 17 bronze badgesA fix for this issue, is tell to the global var named-> LD_LIBRARY_PATH to include the new python libraries compiled. Let’s assume that you have just download python, extracted it & installed; assume that you have downloaded the 3.6.4 version
For include the library, you have to edit your .bashrc file. (This file is quite interesting, have a look 😉 ). This file is an «hidden file» placed in your home: nano ~/.bashrc is a quite easy text editor. Go at the end of the file and append this command, replacing your path of new python export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ whoami /Downloads/Python-3.6.4
CTRL+X for save file.
For load the new file:
answered Feb 14, 2018 at 20:34
alessiosavi alessiosavi
2,901 2 2 gold badges 20 20 silver badges 40 40 bronze badgesOperating system: Windows 10 / cygwin
Desired Python: 2.7.14
Error: «SDK seems invalid»
- Remove Python 64 bit version
- Install Python 32 bit version
- using the windows environment variable dialog set PY_HOME=\\Python27
PYTHONPATH=\\Python27
note: I guess it works since the errors I see are python generated eg «Traceback (most recent call last): File . «
Cannot set up a python sdk что делать?
Добрый день, подскажите в чем проблема? вообще не знаю как обойти эту ошибку.
Cannot set up python SDK at python 3.10
The SDK seems invalidЯ удалял питон и пайчарм полностью, пытался переустановить но по-прежнему получаю невозмонжость добавление интерпретатора в виртуальное окружение.
Лучшие ответы ( 1 )
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
Ответы с готовыми решениями:Что мне делать, выручайте с SDK
Ребята, попал в неловкую ситуацию. Уехал работать в дальние дали, на долгий срок, там где ловит.«No Android SDK found. configure an Android SDK». Что делать?
Сначала Андроид Студио зависал при компиляции приложения и выдавал сообщение, что слетел.В Android Studio нужно внедрить в приложение DropBox. У сервиса есть своё SDK, однако я не понимаю, что с ним делать
Вот ссылка на SDK: https://github.com/dropbox/dropbox-sdk-java/. Сначала я подумал, что нужно.Что делать если в Nested Set таблице на 1000 записей, вручную была удалена одна запись из phpmyadmin?
Добрый день, вся суть в вопросе, использую YII , до трагедии благополучно наращивал свое дерево.Изучил python: что делать дальше?
Изучал до этого javascript — всё изучил но ничего не мог написать(сложный для новичка). Изучил.Автоматизируй это!
7107 / 4611 / 1215
Регистрация: 30.03.2015
Сообщений: 13,243
Записей в блоге: 29Сообщение было отмечено Alarih_ как решение
Решение
Alarih_, пичарм то при чем? удали питон, создай папку c:/python установи заново питон имено в нее. В пичарме выбери для интерпретатора эту папку
Регистрация: 17.03.2021
Сообщений: 15Офигеть, это сработало. Спасибо большое!
Странно, почему пайчарм не видел интерпретатор, установленный по умолчанию, хотя раньше я работал с этой ide и все было хорошоРегистрация: 28.09.2022
Сообщений: 1Welemir1, спасибо огромное, на решение ушло несколько дней, пока не нашли Ваше решение. Это действительно работает)
Configure a Python SDK
Make sure that the Python plugin is installed and enabled. The plugin implements all the features of PyCharm, the standalone IDE for Python developers. For more information about the supported features, refer to the PyCharm documentation.
To develop Python scripts in IntelliJ IDEA, download and install Python and configure at least one Python SDK. A Python SDK can be specified as a Python interpreter for Python project.
IntelliJ IDEA supports:
To view the list of available SDKs, choose File | Project Structure from the main menu Ctrl+Alt+Shift+S . Python SDKs can be configured on the following levels:
The selected SDK can be used for all Python projects.
The selected SDK will be used for the current project and all its modules.
The selected SDK will be used for the current project module.
To easily tell them from each other, enter different names in the Name field. For more information about SDK configuration, refer to SDKs.
To add a Python SDK, you must configure a Python interpreter. Regardless of the level, you can configure a local or a remote Python interpreter.
Configuring local Python interpreters
To configure a local Python interpreter, adhere to one of the following procedures:
Configure a system interpreter
- Ensure that you have downloaded and installed Python on your computer. Installing Python on Windows from Microsoft Store If you are on Windows, you can download Python from the Microsoft Store and install it as a Python interpreter. Once the Python application is downloaded from the Microsoft Store, it becomes available in the list of the Python executables. Note that interpreters added from the Microsoft Store installations come with some limitations. Because of restrictions on Microsoft Store apps, Python scripts may not have full write access to shared locations such as TEMP and the registry.
- Navigate to File | Project Structure or press Ctrl+Alt+Shift+S .
- In the Project Structure dialog, select SDKs under the Platform Settings section, click , and choose Add Python SDK from the popup menu.
- In the left-hand pane of the Add Python Interpreter dialog, select System Interpreter .
- In the Interpreter drop-down, select one of the Python interpreters that have been installed in your system, or click and in the Select Python Interpreter dialog that opens, choose the desired Python executable. You will need admin privileges to install, remove, and upgrade packages for the system interpreter. When attempting to install an interpreter package through an intention action, you might receive the following error message: As prompted, consider using a virtual environment for your project.
- Click OK to complete the task.
For more information, refer to the PyCharm documentation.
Create a virtualenv environment
- Navigate to File | Project Structure or press Ctrl+Alt+Shift+S .
- In the Project Structure dialog, select SDKs under the Platform Settings section, click , and choose Add Python SDK from the popup menu.
- In the left-hand pane of the Add Python Interpreter dialog, select Virtualenv Environment .
- The following actions depend on whether you want to create a new virtual environment or to use an existing one. New virtual environment
- Specify the location of the new virtual environment in the Location field, or click and browse for the desired location in your file system. The directory for the new virtual environment should be empty.
- Choose the base interpreter from the list, or click and find the desired Python executable in your file system.
- Select the Inherit global site-packages checkbox if you want all packages installed in the global Python on your machine to be added to the virtual environment you’re going to create. This checkbox corresponds to the —system-site-packages option of the virtualenv tool.
- Select the Make available to all projects checkbox if you want to reuse this environment when creating Python interpreters in IntelliJ IDEA.
Existing virtual environment
- Choose the desired interpreter from the list.
- If the desired interpreter is not on the list, click , and then browse for the desired Python executable (for example, venv/bin/python on macOS or venv\Scripts\python.exe on Windows).
The selected virtual environment will be reused for the current project.
If IntelliJ IDEA displays the Invalid environment warning, it means that the specified Python binary cannot be found in the file system, or the Python version is not supported. Check the Python path and install a new version, if needed.
For more information, refer to the PyCharm documentation.
Create a conda environment
- Ensure that Anaconda or Miniconda is downloaded and installed on your computer, and you’re aware of a path to its executable file. For more information, refer to the installation instructions.
- Navigate to File | Project Structure or press Ctrl+Alt+Shift+S .
- In the Project Structure dialog, select SDKs under the Platform Settings section, click , and choose Add Python SDK from the popup menu.
- In the left-hand pane of the Add Python Interpreter dialog, select Conda Environment .
- The following actions depend on whether you want to create a new conda environment or to use an existing one. New conda environment
- Specify the location of the new conda environment in the Location field, or click and browse for the desired location in your file system. The directory for the new conda environment should be empty.
- Select the Python version from the list.
- Normally, IntelliJ IDEA will detect conda installation. Otherwise, specify the location of the conda executable, or click to browse for it.
- Select the Make available to all projects checkbox if you want to reuse this environment when creating Python interpreters in IntelliJ IDEA.
Existing conda environment
- Select the environment from the list.
- If the desired interpreter is not on the list, click, and then browse for the Python executable within the previously configured conda environment.
- If necessary, specify the location of the conda executable, or click to browse for it.
- Select the Make available to all projects checkbox if you want to reuse this environment when creating Python interpreters in IntelliJ IDEA.
The selected conda environment will be reused for the current project.
For more information, refer to the PyCharm documentation.
Create a pipenv environment
- Navigate to File | Project Structure or press Ctrl+Alt+Shift+S .
- In the Project Structure dialog, select SDKs under the Platform Settings section, click , and choose Add Python SDK from the popup menu.
- In the left-hand pane of the Add Python Interpreter dialog, select Pipenv Environment .
- Choose the base interpreter from the list, or click and find the desired Python executable in your file system.
- If your project contains Pipfile , you can choose whether you want to install the packages listed in it by enabling or disabling the Install packages from Pipfile checkbox. By default, the checkbox is enabled.
- If you have added the base binary directory to your PATH environmental variable, you don’t need to set any additional options: the path to the pipenv executable will be autodetected. If the pipenv executable is not found, follow the pipenv installation procedure to discover the executable path, and then specify it in the dialog.
- Click OK to complete the task.
When you have set the pipenv virtual environment as a Python interpreter, all available packages are added from the source defined in Pipfile . The packages are installed, removed, and updated in the list of the packages through pipenv rather than through pip.
For more information, refer to the PyCharm documentation.
Create a Poetry environment
- Navigate to File | Project Structure or press Ctrl+Alt+Shift+S .
- In the Project Structure dialog, select SDKs under the Platform Settings section, click , and choose Add Python SDK from the popup menu.
- In the left-hand pane of the Add Python Interpreter dialog, select Poetry Environment .
- The following actions depend on whether you want to create a new Poetry environment or to use an existing one. New Poetry environment
- Select Poetry Environment .
- Choose the base interpreter from the list, or click and find the desired Python executable in your file system.
- If your project contains pyproject.toml , you can choose whether you want to install the packages listed in it by enabling or disabling the Install packages from pyproject.toml checkbox. By default, the checkbox is enabled.
- If IntelliJ IDEA doesn’t detect the poetry executable, specify the following path in the dialog, replacing jetbrains with your username:
/Users/jetbrains/Library/Application Support/pypoetry/venv/bin/poetry
C:\Users\jetbrains\AppData\Roaming\pypoetry\venv\Scripts\poetry.exe
/home/jetbrains/.local/bin/poetry- Make sure that the project directory contains a pyproject.toml file.
- Select Existing environment . Then expand the Interpreter list and choose the desired interpreter.
- If the desired interpreter is not on the list, click, and then browse for the Python executable within the previously configured Poetry environment.
The selected Poetry environment will be reused for the current project.
For more information, refer to the PyCharm documentation.
Configuring remote Python interpreters
To configure a remote Python interpreter:
Configure a WSL interpreter
- Click the Windows button in the lower-left corner of the screen and start typing System Information . To ensure that your system works well with WSL, upgrade your Windows to the latest available version.
- Install the Windows Subsystem for Linux and initialize your Linux distribution as described in the WSL Installation Guide.
- If your Linux distribution doesn’t come with rsync, you need to install it:
sudo apt install rsync
sudo pacman -S rsyncWhen working with WSL 2, mind the following known WSL issues:
- Add «allow» rule to Windows firewall for WSL2 network
- stdin is explicitly closed for Python process
- Debugger doesn’t work properly if firewall is not opened for WSL IP.
- Navigate to File | Project Structure or press Ctrl+Alt+Shift+S .
- In the Project Structure dialog, select SDKs under the Platform Settings section, click , and choose Add Python SDK from the popup menu.
- In the left-hand pane of the Add Python Interpreter dialog, select WSL .
- Select the Linux distribution with the required Python interpreter.
- In Python interpreter path field, specify the path to the Python executable. You can accept the default, type in a different path, or click to browse.
- Click OK . The configured remote interpreter is added to the list.
Configure an interpreter using Vagrant
- Ensure that the following prerequisites are met (outside of IntelliJ IDEA):
- One of supported Vagrant providers is installed on your computer.
- Vagrant is installed on your computer, and all the necessary infrastructure is created.
- The parent folders of the following executable files have been added to the system PATH variable:
- vagrant.bat or vagrant from your Vagrant installation. This should be done automatically by the installer.
- VBoxManage.exe or VBoxManage from your Oracle’s VirtualBox installation.
- The required virtual boxes are created.
- Make sure that the Vagrant plugin is installed and enabled.
- Ensure that you have properly initiated and started Vagrant. Basically, you need to open the Terminal window and execute the following commands:
$ vagrant init ubuntu/trusty64
$ vagrant upFor more information, refer to Vagrant documentation.
- Navigate to File | Project Structure or press Ctrl+Alt+Shift+S .
- In the Project Structure dialog, select SDKs under the Platform Settings section, click , and choose Add Python SDK from the popup menu.
- In the left-hand pane of the Add Python Interpreter dialog, select Vagrant .
- In Python interpreter path field, specify the path to the Python executable. You can accept the default, type in a different path, or click to browse.
- Click OK . The configured remote interpreter is added to the list.
Configure an interpreter using SSH
You cannot use a Windows machine as a remote host when configuring SSH interpreters.
- Ensure that there is an SSH server running on a remote host, since IntelliJ IDEA runs remote interpreters via ssh-sessions.
- Navigate to File | Project Structure or press Ctrl+Alt+Shift+S .
- In the Project Structure dialog, select SDKs under the Platform Settings section, click , and choose Add Python SDK from the popup menu.
- Select New server configuration , then specify server information (host, port, and username). Alternatively, you can select Existing server configuration and choose any available deployment configuration from the list. If needed, click to review the Connection settings, Mappings, and Excluded paths for the selected deployment configuration. Click Next to continue configuring an interpreter.
- In the next dialog window, provide the authentication details to connect to the target server. Select Password or Key pair (OpenSSH or PuTTY) and enter your password or passphrase. If Key pair (OpenSSH or PuTTY) is selected, specify:
- Private key : location of the file with a private key
- Passphrase : similar to a password, it serves to encrypt the private key.
Click Next to proceed.
Configure an interpreter using Docker
- Make sure that the following prerequisites are met:
- Docker is installed, as described in the Docker documentation.
- You have stable Internet connection, so that IntelliJ IDEA can download and run busybox:latest (the latest version of the BusyBox Docker Official Image). Once you have successfully configured an interpreter using Docker, you can go offline.
Note that you cannot install any Python packages into Docker-based project interpreters.
Configure an interpreter using Docker Compose
- Make sure that the following prerequisites are met:
- Docker is installed, as described in the Docker documentation.
- You have stable Internet connection, so that IntelliJ IDEA can download and run busybox:latest (the latest version of the BusyBox Docker Official Image). Once you have successfully configured an interpreter using Docker, you can go offline.
Note that you cannot install any Python packages into Docker-based project interpreters.
For more information about remote Python interpreters, refer to the PyCharm documentation.
Removing Python interpreters
If you no longer need a Python interpreter for a project, you can remove it from the project settings.
- Navigate to File | Project Structure or press Ctrl+Alt+Shift+S .
- In the Project Structure dialog, click SDKs node under Platform Settings .
- Choose the interpreter that you want to remove and click .
For any of the configured Python interpreters (but Docker-based), you can:
- Manage interpreter paths
- Install, uninstall, and upgrade packages