Of course it is possible to use an embeddable package as an interpreter.
First download python 3.11 embeddable package from the official website( Here is the windows system. ),

and then unzip it to your computer. Older systems may require additional download and use of an unzip tool.

Note that the path should preferably be in full English and without spaces and special characters.
Next there are two ways to specify it as an interpreter in VS Code
Method one
Ctrl+Shift+P -->
Python:Select Interpreter-->Enter Interpreter Path...
Paste the python.exe path you just unzipped in the box and press Enter. On my computer this is:
C:\Users\Admin\Downloads\python-3.11.0-embed-amd64\python.exe
Or you can click
Find...and select the python.exe you just unzipped in the opened folder window.
Method two
Add the following configuration in settings.json
"python.defaultInterpreterPath": "C:/Users/Admin/Downloads/python-3.11.0-embed-amd64/python.exe", // "python.defaultInterpreterPath": "C:\\Users\\Admin\\Downloads\\python-3.11.0-embed-amd64\\python.exe",The path is the absolute path of python.exe. If you use a backslash
\, remember to escape it. like my comment aboveThen select Use Python from `python.defaultInterpreterPath` setting in the Select Interpreter panel.

Run the code to output the interpreter path

Hey, so I've been learning to code(python) over the last month and its going well so far. Something that has been confusing me is versions of a download. For example if I want to get scrappy or flask, there's always different versions. I just switched from mac to windows today, and I'm not sure which python to download. would be great if someone could break down the basics. (and by versions I don't mean like 3.6 vs 3.5, I mean 'embedable zip file vs web-based installer vs executable installer)
Windows embeddable package
Windows installer
This applies to all programs, not just Python:
An executable installer has every component of the program you're installing locally in the installer itself. This means that you can download the installer on a computer with internet access, copy it over to a computer without internet access and install it there. This is useful if you're installing network card drivers.
Web-based installers are small programs that when you start them, download the necessary files and install them directly. This means that the installer is very small.
If you just want to install python on your local computer which has web-access, it doesn't really matter which one you pick.
Installer size comparison
The distinction made up by Python is completely artificial: both their executable and their web-based installer are executable installers. One for offline use (which contains all the components), the other for online use (which downloads these components during execution). The latter may download and install the current version, while the former will install the version available when you downloaded the executable installer. In general you should but stay away from executable installers: these are almost always vulnerable. Prefer packages for the package installer of your operating system!
There is a similar trick.
Install pip in the embedded version:
curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
Edit pythonXX._pth by adding
Lib
Lib\site-packages
Use pip to install other packages
At least with the latest Python versions (tested on 3.8 and 3.11) this appears to work fine:
Download the Windows embeddable package you need from the official site, and extract it.
PS> Invoke-WebRequest -Uri https://www.python.org/ftp/python/3.11.1/python-3.11.1-embed-amd64.zip -OutFile python-3.11.1-embed-amd64.zip PS> Expand-Archive .\python-3.11.1-embed-amd64.zip PS> cd .\python-3.11.1-embed-amd64Open the
python3xx._pthfile corresponding to your version (e.g.python311._pthfor Python 3.11), and make sure the following import line is uncommented. This will automatically add site directories used by pip to the Python path:# Uncomment to run site.main() automatically import siteIn Powershell this can be automated by running:
PS> Add-Content -Path .\python311._pth -Value 'import site'Download the official pip bootstrap script, e.g. with Powershell:
PS> Invoke-WebRequest -Uri https://bootstrap.pypa.io/get-pip.py -OutFile get-pip.pyRun the downloaded script (make sure you're using the correct Python executable in the current directory
.\):PS> .\python.exe get-pip.py Collecting pip Using cached pip-22.3.1-py3-none-any.whl (2.1 MB) Collecting setuptools Downloading setuptools-66.0.0-py3-none-any.whl (1.3 MB) ---------------------------------------- 1.3/1.3 MB 16.0 MB/s eta 0:00:00 Collecting wheel Using cached wheel-0.38.4-py3-none-any.whl (36 kB) Installing collected packages: wheel, setuptools, pip WARNING: The script wheel.exe is installed in 'C:\Users\xxxx\Downloads\python-3.11.1-embed-amd64\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The scripts pip.exe, pip3.11.exe and pip3.exe are installed in 'C:\Users\xxxx\Downloads\python-3.11.1-embed-amd64\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed pip-22.3.1 setuptools-66.0.0 wheel-0.38.4Run pip from the
.\Scriptsdirectory:PS> .\Scripts\pip.exe list Package Version ---------- ------- pip 22.3.1 setuptools 66.0.0 wheel 0.38.4 PS> .\Scripts\pip.exe install numpy Collecting numpy Downloading numpy-1.24.1-cp311-cp311-win_amd64.whl (14.8 MB) ---------------------------------------- 14.8/14.8 MB 11.9 MB/s eta 0:00:00 Installing collected packages: numpy WARNING: The script f2py.exe is installed in 'C:\Users\xxxx\Downloads\python-3.11.1-embed-amd64\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed numpy-1.24.1 PS> .\python.exe -c 'import numpy; print(numpy.__version__)' 1.24.1