- #PYCHARM NO PYTHON INTERPRETER HOW TO#
- #PYCHARM NO PYTHON INTERPRETER INSTALL#
- #PYCHARM NO PYTHON INTERPRETER CODE#
How To Check Python Version Using Python ConsoleĪnother option available to check the version of your Python interpreter within P圜harm is from the Python Console window.
#PYCHARM NO PYTHON INTERPRETER CODE#
Therefore, depending on your Python scripts and how you want to run them from your Mac be mindful of whether to prefix your script with either python or python3 depending on which version you’ve written your code in. To check what default version of Python3 is used on your Mac, run the same command above but instead use the syntax python3 instead of just python, like so: ~ % python -version This means whenever I run the command python from my Mac’s terminal window it will actually run the Python 2.7 version. To check the default Python version your Mac is using you can run the same command as done above: ~ % python -version If you open up a new terminal window you might see something like this: Last login: Mon Dec 13 08:39:57 on console You can check your Python version from your Mac terminal using the same command above. Checking Python Version From Mac Terminal This result tells you what version of Python is running from the terminal window within P圜harm. When you enter this command you should see the following result: (venv) % python -version Once you’ve loaded terminal within P圜harm to check the version of the environment enter the following command: (venv) % python -versionĪs you can see above from what I see on the terminal prompt you need to enter the command python -version. This is the flexibility you have when using Python, you can create different projects and use different Python versions. The word in the parentheses might be different (venv) but the prompt is to show you that you are running a Python interpreter according to the project’s settings (as shown above) and therefore may not necessarily be the default interpreter when running Python code on your machine. In P圜harm when you open the terminal window you should see the terminal contain the virtual environment of your project.įor example, when opening a normal terminal prompt on the Mac you would see something like this: ~ %īut when opening the terminal window in P圜harm you should see something a little different, perhaps something like this: (venv) % How To Check Python Version Using Terminal When you do you should see something like this: The Python Interpreter section in your Project shows you the version of Python being usedĪs you can see from this section in P圜harm you should easily be able to spot the version of Python being used by your project. You want to click on the option Python Interpreter. Open that branch and you should see two options underneath: Python Interpreter and Project Structure. To check the version of Python being used in your P圜harm environment, simply click on the P圜harm menu item in the top left of your screen, and then click on Preferences.įrom the Preferences window find an option that starts with Project: and then has the name of your project. Let’s look at each of these in a little more detail: How To Check Python Version Using P圜harm Settings open the Python Console window in your Python project. open a terminal prompt in your P圜harm project 3. There are three ways to check the version of your Python interpreter being used in P圜harm: 1. Step 4: Modify environment variable in extractor python file.How can you check the version of Python you are using in P圜harm? When adding the run configuration, make sure to select this for the extractor. Then select 'docker' - you will then see all docker images pulled locally and can select from among them. Search for Python Interpreter and select add or manage. Step 3: Add Docker Image as Python Interpreter in P圜harm If you would like to use an existing docker image, do a docker pull for that image. Step 2: Pull docker image if using a remote image You will not have to push the image to a remote repository as long as it is local P圜harm will find it. In order to be used as a python interpreter, the docker image must at least contain python and contain all currently required dependencies. Step 1: Build Docker Image (if one does not exist) The problem of something working locally (but not in docker) or an extractor that runs (but not locally) can be avoid using this method. This also ensures that the local environment will be the same as the docker image deployed elsewhere. Since a docker image will eventually be created for any extractor, it also makes sense to build this into the development process as early as possible.
#PYCHARM NO PYTHON INTERPRETER INSTALL#
This can be helpful when extractors require dependencies that can be difficult to install (like GDAL). It is possible to use a docker image as the project interpreter in P圜harm.