简体   繁体   中英

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.

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

C:\Python35\ 

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

C:\Python35\python.exe.

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):

  1. selecting allow for all users
  2. installation path was set correctly and (stored safely for future)
  3. restart my Computer after installation.(not essential-but I did)
  4. opened Anaconda & Jet brian pycharm
  5. selected new project in PyCharm screen shot of my New project default Python interpreter location = C:\\Users\\Skboy\\PycharmProjects\\dani Interpreter = C:\\Users\\Skboy\\AppData\\Local\\Programs\\Python\\Python36-32\\python.exe

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

now my Python Interpreter(automatically -by default select) Python 3.6.3
edit configuration & check for interpreter

(C:\\Users\\user1\\AppData\\Local\\Programs\\Python\\Python36-32\\python.exe)

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

I have had the exact same problem and was unable to find the solution until just now. Hopefully this works for anyone that was struggling with it.

I went to the location of the Python 3.5 (32-Bit) in my C: Drive which it turns out is just a shortcut to the actual Python application, right click on it and select Open file location which should direct you to the application version of python - simply called 'python'. This is the .exe file that PyCharm was looking for to use as the interpreter.

Now go to the configure interpreter menu in Pycharm and type in the file location of the actual python application. To get to mine I had to go to AppData/Local/Programs/Python/Python35-32. Click on the python.exe file and it should work.

This is my first post here so if its formatted incorrectly or doesn't use the conventional terms - sorry. Let me know if the solution worked for anyone else with the problem or if I fluked it.

If you kept the default settings while installing python, Your project interpreter for PyCharm will be:

C:\\Users\\yourUserName\\AppData\\Local\\Programs\\Python\\Python36\\python.exe

Chose the above location as your project interpreter inside PyCharm.

Depending on which python version you have, it could be either Python36\\python.exe or Python35\\python.exe.

For me the following solution it worked:

My configuration: Pycharm Community edition 2019.1.1 Anaconda distribution with python 3.7. Interpreter in standard location.

Problem: Pycharm was not able to find python interpreter after reinstallation of anaconda distribution.

Solution: - Make sure you run pycharm as admin (right click and run as admin). This was actually the critical step. - Create new project (or open an existing one) - Depending on the choice choose interpter or go to file > settings > project interpreter > choose small gear on rights side > add > on base interpreter choose the 3 dots > paste the location of the interpreter in the anaconda distribution.

Hope it helped someone. For me the blocking point was that for some reason pycharm was not launching with admin rights.

Blockquote

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM