Error please select a valid python interpreter что делать
Configure a Python interpreter
Python interpreters in PyCharm
Python interpreters can be configured for a new project or for the current project (you can create a new interpreter or use one of the existing interpreters).
Setting an existing Python interpreter
Change the Python interpreter using the Python Interpreter selector
The Python Interpreter selector is located on the status bar. It is the most convenient and quickest way to switch the Python interpreter. Just click it and select the target interpreter:
Change the Python interpreter in the project settings
Press Ctrl+Alt+S to open the IDE settings and select Project
Select the target interpreter.
When PyCharm stops supporting any of the outdated Python versions, the corresponding Python interpreter is marked as unsupported.
When you change an SSH interpreter, you might need to synchronize local content with the target server. Mind a notification balloon in the lower-right corner. You can click one of the links to perform the following actions:
Auto-upload files to the server
Synchronize files and then enable auto-uploading
Modify a Python interpreter
Press Ctrl+Alt+S to open the IDE settings and select Project
You can specify an alternative interpreter name for the selected interpreter. The Python interpreter name specified in the Name field, becomes visible in the list of available interpreters. Click OK to apply the changes.
For remote interpreters (that are available in PyCharm Professional ) you can modify configuration parameters.
Creating a new Python interpreter
To add a new interpreter to the current project:
Do one of the following:
Press Ctrl+Alt+S to open the project Settings/Preferences and go to Project
Choose the interpreter type to add and perform the specific settings:
Note that SSH, WSL, Vagrant, Docker, and Docker Compose are available only for the commercial version of PyCharm. WSL is Windows specific.
If New environment is selected:
If PyCharm detects no Python on your machine, it provides two options: to download the latest Python versions from python.org or to specify a path to the Python executable (in case of non-standard installation).
Select the Make available to all projects checkbox if you want to reuse this environment when creating Python interpreters in PyCharm.
If Existing environment is selected:
Select the Make available to all projects checkbox if you want to reuse this environment when creating Python interpreters in PyCharm.
Click OK to complete the task.
If you have added the user base’s 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.
Click OK to complete the task.
Click OK to save the changes and complete the task.
If Poetry environment is selected:
If Existing environment is selected:
Click OK to complete the task.
If New environment is selected:
Select the Python version from the list.
Select the Make available to all projects checkbox if you want to reuse this environment when creating Python interpreters in PyCharm.
If Existing environment is selected:
Select the Make available to all projects checkbox if you want to reuse this environment when creating Python interpreters in PyCharm.
Click OK to complete the task.
If PyCharm detects no Python on your machine, it provides two options: to download the latest Python versions from python.org or to specify a path to the Python executable (in case of non-standard installation).
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.
In the next dialog window, provide the authentication details to connect to the target server.
Select Password or Key pair (OpenSSL or PuTTY) and enter your password or passphrase. If Key pair (OpenSSL or PuTTY) is selected, specify:
Private key file : location of the file with a private key
Passphrase : similar to a password, it serves to encrypt the private key.
The RFC 4716 format for OpenSSH keys is not supported by PyCharm. See the workaround.
Click Next to proceed with the final configuration step.
You can also select the lowest checkbox to enable automatic upload of the local changes to the remote server.
In the left-hand pane of the Add Python Interpreter dialog, click Vagrant :
This results in showing the link to Vagrant host URL.
The Python interpreter path field displays the path to the desired Python executable. You can accept default, or specify a different one.
Select the Linux distribution and specify the path to the python executable in the selected Linux distribution. Typically, you should be looking for wsl.exe but you can specify any non default WSL distro.
Python interpreter path should have the default value:
Click OK to complete the task.
In the dialog that opens, select the Docker Compose option, from the drop-down lists select the Docker server, Docker Compose service (here web ), configuration file (here docker-compose.yml ) and Python interpreter path (here python ).
Next, wait while PyCharm starts your Docker Compose configuration to scan and index:
Click OK to complete the task.
When a remote Python interpreter is added, at first the PyCharm helpers are copied to the remote host. PyCharm helpers are needed to run remotely the packaging tasks, debugger, tests and other PyCharm features. Next, the skeletons for binary libraries are generated and copied locally. Also all the Python library sources are collected from the Python paths on a remote host and copied locally along with the generated skeletons. Storing skeletons and all Python library sources locally is required for resolve and completion to work correctly. PyCharm checks remote helpers version on every remote run, so if you update your PyCharm version, the new helpers will be uploaded automatically and you don’t need to recreate remote interpreter. SFTP support is required for copying helpers to the server.
Setting the default interpreter
In PyCharm, you can specify an interpreter that will be automatically set for all newly created projects.
From the main menu, select File | New Projects Setup | Settings for New Projects (on Window and Linux) or File | New Projects Setup | Preferences for New Projects (on macOS).
The change will become effective for all newly created projects in PyCharm.
Managing interpreter packages
For each interpreter, you can install, upgrade, and delete Python packages. By default, PyCharm uses pip to manage project packages. For Conda environments you can use the Conda package manager.
PyCharm doesn’t detect interpreter
I’m new to programming and just started a course on Python. I want to use PyCharm, so I downloaded and intalled it (v. 4.5, community edition). I had previously installed Python 3.5 64-bit from python.org (I’m using Windows 10).
To start using PyCharm, I need a project interpreter, which I can select in the settings. As far as I’m concerned, the interpreter is «py.exe», but when I select it, I get this error message: «The selected file is not a valid home for Python SDK». I also tried to use every file whose name contained «python» or «py», and failed.
On every website and video I see, they select a file called «python.exe», but they’re using Python 3.4 or a previous version. I checked that PyCharm supports 3.5 («Initial support for Python 3.5»).
Is there anything I’m doing wrong? What should I do to be able to use PyCharm?
All replies are appreciated. Thanks in advance.
7 Answers 7
file > new project settings > project Interpreter > click in the drop down and select ‘show all’ > click the ‘+’ button >
Now, in the Virtualenv Environment tab under the New environment radio button, check the path in the ‘Base interpreter:’ field. For me, mine was set to an invalid path. Once I had corrected the path to point to python.exe I recreated my new project and PyCharm built the virtualenv.
For me there was a bit more too. When creating the new project I expanded the drop down and had to verify the directory where the venv directory was being created. Once I had corrected the path here I had to click around a bit to get it to let me create the project.
I’m going to chaulk this up to a bug. I’m using Community edition.
When creating a project in PyCharm, if the interpret is not already selected, in the drop down menu under the projects «Location:», you can click the gear-looking icon to the right of the interpreter option, and click «Add Local»; then select the file location of the python.exe file that you have installed. It will probably be C:\Python35\Python.exe
I faced a Similar issue and was not able to find Python interpreter anywhere on the system.
The problem with it was that python was installed directly with default settings and there was no exe found in
and to solve this i tried uninstalling and reinstalling with custom settings and selecting allow for all users as well which did the trick and path was set correctly to
After which Pycharm was able to detect the interpreter on this path.
PyCharm project interpreter problem Resolved
I installed anaconda python distribution (Anaconda3-5.0.1-Windows-x86_64.exe) from the anaconda website. https://anaconda.org/anaconda/python
What it actually did was it re-installed my Python3.6.3 (pertinent to mention I have windows10, with pyCharm community & python 3.5 already but with the interpreter problem and while installing anaconda I chose the following settings and disabled my antivirus before my anaconda installation):
Wow! my pyCharm started working for me,
Resolution : Python6.3 re-installation with proper custom setting
make a python test test1.py program file to print «hello python test world»
Run
success test Run
worth to mention Anaconda Jupyter is a web based can also be used in case novice user are still having problems
Cannot select python interpreter #3535
Comments
BlackTrackDragon commented Dec 3, 2018
Environment data
Actual behavior
I downloaded a new version of python and now i cannot select the exe-file.
If the error message appears i select the only one choice (the correct path) and after this i get the same error message again.
Expected behavior
Select the python interpreter and run my code.
Steps to reproduce:
The text was updated successfully, but these errors were encountered:
brettcannon commented Dec 3, 2018
BlackTrackDragon commented Dec 3, 2018
I’m using powershell.
No, that also does’nt work. «python.pythonPath» is set to «python». When i overwrite this setting with the absolute path i get the same error message again.
shjohnson-pi commented Dec 5, 2018
I also had a problem with the error message asking me to select a Python Interpreter, even though I had «python.pythonPath»: «.venv/bin/python», in my workspace settings. (Pipenv environment, Linux Mint 18)
I had a flag in my
/.bashrc to show all python warnings: export PYTHONWARNINGS=»default»
I tracked down the problem to a python file that prints out json info about the current python intrepreter. The problem was that the warnings (in python 3.7) were printed at the top, causing invalid json.
Here is an example of running the file by hand. I also showed that by redirecting stderr, then only the json was printed out. The extension could do this to prevent this bug from happening when the user wants to show warnings.
I temporarily fixed my problem by commenting out export PYTHONWARNINGS=»default» in
Can’t install virtual interpreter in PyCharm in Linux
When I try to add virtualenv as an interpreter in PyCharm Community 2018.1.2 in Kubuntu 18.04 I get the following error:
ModuleNotFoundError: No module named ‘distutils.core’
How can I solve this?
6 Answers 6
I had to install it. This was fresh Kubuntu 18.04 install, obviously, without this needed package.
After that I restarted PyCharm and creating virtual project interpreter was successful.
If @Hrvoje T’s answer did not work (it did not work for me) then try this:
Run this command and you should be able to install the packaging tools in Pycharm:
Neither @Hrvoje T and @hyukkyulee worked for me since I had already installed those packages. Uninstalling and reinstalling didn’t solve the issue as well.
I just upgraded my system to Ubuntu 19.10 and I noticed that they had upgrade the python interpreter to 3.7. PyCharm however was generating the venv interpreter based to its previous one (python 3.6). By changing the base interpreter from New Interpreter block I solved this issue.
Actually, @hyukkyulee solution solved the issue.
It is because, by default, Ubuntu comes with python 2.7 and python 3.x version. And if you have installed pip using
will install ‘pip’ in python 2.7 folder.
so you need to specify python3-pip to install pip in python 3 folder along with other util packages.
Had the same issue with an installation of: PyCharm 2019.3.2 (Edu) Build #PE-193.6494.27, built on February 5, 2020 Runtime version: 11.0.5+10-b520.38 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Linux 5.3.0-7629-generic
Installed on Pop!_OS 19.10 with Python 3.7.2 installed. I did use Jetbrains Toolbox to install pycharm edu. Jetbrains Toolbox was installed using a script suggested by jetbrain’s pycharm download page.
Running: sudo apt install python3-pip
solved the problem instantly, didn’t even have to restart pycharm, just created a new project and no issue setting up the virtual environment.
I did install python-pip after updating to python 3.7.2 before having pychram installed. So same as running python3.7 in a terminal without changing the alias the 3 after python matters.
PyCharm не обнаруживает интерпретатора
Я новичок в программировании и только что начал курс по Python. Я хочу использовать PyCharm, поэтому я скачал и ввел его (V. 4.5, community edition). Ранее я установил Python 3.5 64-bit из python.org (я использую Windows 10).
Чтобы начать использовать PyCharm, мне нужен интерпретатор проекта, который я могу выбрать в настройках. Насколько я понимаю, интерпретатор-это «py.exe», но когда я выбираю его, я получаю следующее сообщение об ошибке: «The selected file is not a valid home for Python SDK». Я также попытался использовать каждый файл, имя которого содержало «python» или «py», и потерпел неудачу.
На каждом веб-сайте и видео, которые я вижу, они выбирают файл под названием «python.exe», но они используют Python 3.4 или предыдущую версию. Я проверил, что PyCharm поддерживает 3.5 («начальная поддержка Python 3.5»).
Я что-то делаю не так? Что я должен сделать, чтобы иметь возможность использовать PyCharm?
Все ответы приветствуются. Заранее спасибо.
7 ответов
Я новичок в Docker. Я использую Docker & docker-compose, проходя через учебник flask. Базовое изображение docker-это python 2.7 slim. Он работает на Linux. docker 1.11.2 Приложение работает нормально. Я хочу, чтобы pycharm pro подключился к удаленному интерпретатору, чего я никогда раньше не.
файл > новые настройки проекта > интерпретатор проекта > нажмите в раскрывающемся списке и выберите ‘show all’ > нажмите кнопку»+» >
Теперь на вкладке Virtualenv Среда под переключателем Новая среда проверьте путь в поле ‘Base interpreter:’. Для меня мой был установлен на недопустимый путь. Как только я исправил путь, чтобы указать на python.exe, я воссоздал свой новый проект, а PyCharm построил virtualenv.
Для меня тоже было немного больше. При создании нового проекта я расширил раскрывающийся список и должен был проверить каталог, в котором создавался каталог venv. Как только я исправил путь здесь, мне пришлось немного щелкнуть по нему, чтобы он позволил мне создать проект.
Я собираюсь довести это до жука. Я использую Community edition.
При создании проекта в PyCharm, если интерпретатор еще не выбран, в раскрывающемся меню в разделе проекты «Location:» вы можете щелкнуть значок шестеренки справа от опции интерпретатора и нажать кнопку «Добавить локальный»; затем выберите расположение файла python.exe, который вы установили. Вероятно, это будет C:\Python35\Python.exe
Я столкнулся с аналогичной проблемой и не смог найти Python interpreter нигде в системе.
и чтобы решить эту проблему, я попробовал uninstalling и reinstalling с пользовательскими настройками и выбрал разрешить для всех пользователей, что сделало трюк, и путь был правильно установлен на
После чего Pycharm смог обнаружить интерпретатор на этом пути.
PyCharm проблема интерпретатора проекта решена
Я установил дистрибутив anaconda python (Anaconda3-5.0.1-Windows-x86_64.exe) с сайта anaconda. https://anaconda.org/anaconda/python
Что он на самом деле сделал, так это переустановил мой Python3.6.3 (уместно упомянуть, что у меня есть windows10, с pyCharm сообществом & python 3.5 уже, но с проблемой интерпретатора, и при установке anaconda я выбрал следующие настройки и отключил антивирус перед установкой anaconda):
Ух ты! мой pyCharm начал работать на меня,
Разрешение : Python6.3 повторная установка с правильной пользовательской настройкой
создайте файл программы python test test1.py для печати «hello python test world»
Бежать
Выполнить
успешный тестовый запуск
стоит отметить, что Anaconda Jupyter-это веб-приложение, которое также можно использовать в случае, если у начинающего пользователя все еще возникают проблемы
Я использую удаленный интерпретатор Python (виртуальная среда, созданная с помощью pew), доступ к которому я получаю через ssh. Это прекрасно работает, когда вручную ssh ‘ подключается к серверу и использует интерпретатор. Однако при использовании PyCharm для его вызова он забывает о переменных.
Если вы сохранили настройки по умолчанию при установке python, ваш интерпретатор проекта для PyCharm будет:
Выберите указанное выше место в качестве интерпретатора проекта внутри PyCharm.
В зависимости от того, какая у вас версия python, это может быть либо Python36\python.exe, либо Python35\python.exe.
У меня была точно такая же проблема, и я не мог найти решение до сих пор. Надеюсь, это сработает для всех, кто боролся с этим.
Теперь перейдите в меню настройка интерпретатора в Pycharm и введите расположение файла фактического приложения python. Чтобы добраться до моего, мне пришлось пойти в AppData/Local/Programs/Python/Python35-32. Нажмите на файл python.exe, и он должен работать.
Для меня следующее решение сработало:
Моя конфигурация: Pycharm сообщества издание 2019.1.1 Anaconda распределение с python 3.7. Переводчик в стандартном месте.
Проблема: Pycharm не удалось найти интерпретатор python после переустановки дистрибутива anaconda.
Надеюсь, это кому-то помогло. Для меня блокирующим моментом было то, что по какой-то причине pycharm не запускался с правами администратора.
Похожие вопросы:
Я новый пользователь PyCharm, который перешел с Wing. В Wing, если я настрою Wing на использование интерпретатора Python3, консоль также будет работать с Python3. Однако в версии сообщества PyCharm.
Я настроил PyCharm (v3.4.1) на машине Windows 7 для использования virtualenv, который имеет Django 1.7 в качестве одного из своих пакетов. Мой базовый интерпретатор находится в.
Я использую pycharm 5.0.4 community edition. Я хотел установить пакет fuzzywuzzy. Но когда я захожу в окно интерпретатора проекта и пытаюсь установить пакет, он не показывает мне доступных пакетов.
Я настраиваю PyCharm для использования удаленного интерпретатора python. PyCharm, похоже, выполняет интерпретатор с опцией-u, и я не могу найти способ отключить это. Причина, по которой мне нужно.
Я новичок в Docker. Я использую Docker & docker-compose, проходя через учебник flask. Базовое изображение docker-это python 2.7 slim. Он работает на Linux. docker 1.11.2 Приложение работает.
Я использую удаленный интерпретатор Python (виртуальная среда, созданная с помощью pew), доступ к которому я получаю через ssh. Это прекрасно работает, когда вручную ssh ‘ подключается к серверу и.
У меня есть среда tensorflow conda с именем tensorflow_gpu. Я использую его с записными книжками jupyter, но теперь я хочу использовать его и с PyCharm. Как я могу добавить среду в качестве.
Я получил свежую установку Python 3.6.6 и PyCharm 2018.2 Commmunity Edition. К сожалению, PyCharm (а также установленный с Python IDLE) не видит пакетов, установленных с pip. Я установил с pip.
Я написал Dockerfile. Когда я создаю образ, запускаю контейнер и иду к консоли python, я могу получить доступ к определенным зависимостям python ( в моем случае rospy ). Когда я настраиваю образ.