How To Install Python Using The "embeddable Zip File"
Solution 1:
There are 2 main steps (each with its own set of substeps) that need to be followed:
Download and unpack the interpreter on your machine:
- 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:\Work\Dev\StackOverflow\q050818078\python36x64")
- 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
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 1 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:
In PyCharm main window (considering your project is open), go to menu "File -> Settings...":
You could also go to "File -> Default Settings...", check [JetBrains]: Project and IDE Settings for differences between them.
In the "Settings" window, click "Project Interpreter -> Show All" (you might need to scroll down - if you have multiple interpreters configured)
In the "Project Interpreters" window, click the "Add" button (green + on upper right side). Also, you might have to click an "Add Local..." control that appears when you click "Add"
In the "Add Local Python Interpreter", make sure to:
- Check "Exiting environment" radio button
- Click the "..." ("Browse") button
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"
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:\Work\Dev\StackOverflow\q050818078\python36x64\python.exe E:/Work/Dev/StackOverflow/q050818078/src/code.py
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 282018, 17:00:18) [MSC v.190064 bit (AMD64)] on win32
E:\Work\Dev\StackOverflow\q050818078\python36x64\python.exe
E:\Work\Dev\StackOverflow\q050818078\src\code.py
Process finished withexit 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.
Post a Comment for "How To Install Python Using The "embeddable Zip File""