How to install Python using the "embeddable zip file"

Question:

I downloaded the Windows x86-64 embeddable zip file from https://www.python.org/downloads/release/python-365/.

(I cannot use the executable/web-based installer on my computer)

I want to install this on my PyCharm. How do I achieve this?

Asked By: Jun Jang

||

Answers:

There are 2 main steps (each with its own set of substeps) that need to be followed:

  1. Download and unpack the interpreter on your machine:

    1. Download the .zip file (e.g. [Python]: python-3.6.5-embed-amd64.zip) on your computer, in an empty dir (on my machine it’s: "e:WorkDevStackOverflowq050818078python36x64")

    2. Unzip the file (some (.pyd, .dll, .exe, .zip, ._pth) files will appear). At the end, you can delete the .zip file that you downloaded in previous step

  2. Configure PyCharm to use it:

    Notes:

    • In order for the images below to be a small as possible (from size and display PoV), I have reduced the sizes of all windows from their default values

    • Some PyCharm stuff is specific to my machine / environment, (obviously) that will be different in your case

    • The script that I used for testing, is a dummy one that just prints some paths (that’s why I didn’t add it as code, it’s just in the 1st image)

    • I only illustrate the minimal required steps to get you going, so even if for some steps there are options to customize them, I’m not going to mention them

    • I am using PyCharm Community Edition 2017.3.3 (in other versions things could be slightly different)

    Steps:

    1. In PyCharm main window (considering your project is open), go to menu File -> Settings…:

      Img0

      You could also go to File -> Default Settings…, check [JetBrains]: Project and IDE Settings for differences between them.

    2. In the Settings window, click Project Interpreter -> Show All (you might need to scroll down – if you have multiple interpreters configured)

      Img1

    3. In the Project Interpreters window, click the Add button (green + (plus) on upper right side). Also, you might have to click an Add Local… control that appears when you click Add

      Img2

    4. In the Add Local Python Interpreter, make sure to:

      • Check Exiting environment radio button

      • Click the (Browse) button

      Img3

    5. In the Select Python Interpreter window, go to the folder where you unzipped the file at #1.1., select python.exe and then click OK

      Img4

    6. Click the OK button in all the windows opened at previous steps (in reversed order), until you’re back to main window

In order to test, on the code editor window, right click and from the popup menu choose Run ‘code’. Here’s console output window content:

E:WorkDevStackOverflowq050818078python36x64python.exe E:/Work/Dev/StackOverflow/q050818078/src/code.py
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32

E:WorkDevStackOverflowq050818078python36x64python.exe
E:WorkDevStackOverflowq050818078srccode.py

Process finished with exit code 0

As a final note, naming the test file code.py was "a bit" uninspired, as there is such a module in Python‘s standard library (in the meantime, I renamed it to code00.py), but I don’t feel like doing all the screenshots (that contain it) again.

[SO]: PyCharm doesn’t recognize installed module (@CristiFati’s answer) might contain useful info on possible related problems.

Answered By: CristiFati
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.