PyCharm is our favorite IDE for developing applications with Python. With the release of PyCharm 2020.1, PyCharm can now install the Python interpreter automatically if it does not detect an existing installation. I wasn’t able to try this feature out as I already have several versions of Python installed on my primary computer. I recently picked up a Microsoft Surface Go 2 which provided the perfect opportunity to let PyCharm install Python.
Installing the Python Interpreter
PyCharm allows you to create a new virtual environment when you create a new Python project. If Python is not already installed, the base interpreter will give you the option to download the latest build from one of the two most recent major versions of Python.
After clicking the Create button, PyCharm will download and install the selected version of Python, create the virtual environment, and open the new project.
Questions… and Answers
Normally I’d start developing the new project, but at this point I had a lot of questions. Where is Python installed? Which features were installed? Is the new installation in my path?
PyCharm downloads the 64 bit executable installer for the version you selected. It then runs the installer with the default options selected in quiet mode. Quiet mode hides the installer’s user interface.
Python will be installed in \Users\\AppData\Local\Programs\Python\PythonXX where <username> is the username for the current user and XX is the version of Python you selected.
The installed features include IDLE, pip, and the documentation.
Installation will NOT be in your path. This means if you open the command prompt or Terminal and type Python, you will not the get Python interpreter you just installed. Instead the Windows Store will open and prompt you to install Python 3. More on this later.
The Python interpreter installed by PyCharm will appear in the list of apps and features and can be uninstalled like any other program.
Installing Python from the Windows Store
Starting with the May 2019 update to Windows 10 (1903), You will be prompted to install Python 3 from the Windows Store if a Python interpreter is not already in your path. You can read more about this here.
You can disable this feature with the following steps:
- Open Settings and choose Apps
- Click App execution aliases
- Turn off all of the entries for Python (there may be more than one)
Installing Additional Python Versions
Once you have a system-wide Python interpreter installed, you will not be able to install another version from within PyCharm. Although there has been some discussion regarding this in the issue tracker, the PyCharm team doesn’t seem keen on adding this feature.
Your best bet is to head over to python.org and download the installer for additional versions.
If you need help creating or implementing custom software, give us a call – 586.263.1775