Install PIP in Embedded Python
`-=[]โจโฉ\;',./~!@#$%^&*()_+{}|:"<>? ๐๐๐๐๐๐๐โ๐๐๐๐๐๐๐๐๐๐๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง
ร
โโโรโโ
โยฑโ๊๏นฆโโ โฏ ๐ธ๐นโ๐ป๐ผ๐ฝ๐พโ๐๐๐๐๐โ๐โโโ๐๐๐๐๐๐๐โค๐ด๐ต๐ถ๐ท๐ธ๐น๐บ๐ป๐ผ๐ฝ๐พ๐ฟ๐๐๐๐๐๐
๐๐๐๐๐๐๐๐
โผโฝโพโโโโโ
โโโโโโโ โก โคโฅโฆโงโจโฉโชโซ
โโโโโโ โโโโ
โโ ๐ผ๐ฝ๐พ๐ฟ๐๐๐๐๐๐
๐๐๐๐๐๐๐๐๐๐๐๐๐๐
โโโโ
โฆฐโโโโโโดโต โโโโโโโ โงโจโฉโช
โซโฌโญโฎโฏโฐโฑโฒโณ โฅโฎโฏโฐโฑ โ โฒ โณ โด โ โ สน สบ โต โถ โท
๏น ๏น ๏น ๏น ๏ธน ๏ธบ ๏ธป ๏ธผ ๏ธ ๏ธ ๏ธฟ ๏น ๏ธฝ ๏ธพ ๏น ๏น ๏ธท ๏ธธ โ โ โด โต โ โ โ โก
โโโโโคโฆโฅโงโโโโโโโฒโผโโถโบโปโฒโณ โผโฝโพโฟโโโโโโ
โโ โโโโโโโโโโโโโโโณโฅขโฅฃโฅคโฅฅโฅฆโฅงโฅจโฅฉโฅชโฅซโฅฌโฅญโฅฎโฅฏ
Draft for Information Only
Content
To Intstall PIP in Embedded Python on Windows โInstall Embedded Python on Windows โInstall PIP in Embedded Python on Windows โCheck PIP Installion in Embedded Python โCheck sys.path of Embedded Python โCheck Default Configuration of Embedded Python โCheck PIP Installion in Embedded Python โSources and References
To Intstall PIP in Embedded Python on Windows
Install Embedded Python on Windows
Install PIP in Embedded Python on Windows
- Download
get-pip.py from https://bootstrap.pypa.io/get-pip.py and save the file on the Python directory.
- Launch a command prompt.
- Change directary to the Python directory.
- Run
python get-pip.py to install PIP
D:\python-3.8.1-embed-amd64>python get-pip.py
Collecting pip
Using cached pip-21.3-py3-none-any.whl (1.7 MB)
Collecting setuptools
Using cached setuptools-58.2.0-py3-none-any.whl (946 kB)
Collecting wheel
Using cached wheel-0.37.0-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel, setuptools, pip
Successfully installed pip-21.3 setuptools-58.2.0 wheel-0.37.0
Check PIP Installion in Embedded Python
- Check
PIP Installion by
D:\python-3.8.1-embed-amd64>pip.exe -V
Traceback (most recent call last):
File "runpy.py", line 193, in _run_module_as_main
File "runpy.py", line 86, in _run_code
File "D:\python-3.8.1-embed-amd64\scripts\pip.exe\__main__.py", l
ine 4, in <module>>
ModuleNotFoundError: No module named 'pip'
D:\python-3.8.1-embed-amd64>
- FAILED
Check sys.path of Embedded Python
- Open Python
- Type
import sys
- Type
print(sys.path)
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AM
D64)] on win32
>>> import sys
>>> print(sys.path)
['D:\\python-3.8.1-embed-amd64\\python38.zip', 'D:\\python-3.8.1-embed-amd64']
>>>
Check Default Configuration of Embedded Python
- Check default configuration by
with open('python38._pth', 'r') as fin:
print(fin.read())
>>> with open('python38._pth', 'r') as fin:
... print(fin.read())
...
python38.zip
.
# Uncomment to run site.main() automatically
#import site
>>>
- Uncomment to run
site.main() automatically by
with open('python38._pth', 'r') as fin:
filetext=fin.read()
filetext=filetext.replace('#import site','import site')
with open('python38._pth', 'w') as fin:
fin.write(filetext)
>>> with open('python38._pth', 'r') as fin:
... filetext=fin.read()
...
>>> filetext=filetext.replace('#import site','import site')
>>> with open('python38._pth', 'w') as fin:
... fin.write(filetext)
...
73
>>>
- Check configuration again
>>> with open('python38._pth', 'r') as fin:
... print(fin.read())
...
python38.zip
.
# Uncomment to run site.main() automatically
import site
>>>
- Restart the Embedded Python and check sys.path of Embedded Python again
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.path)
['D:\\python-3.8.1-embed-amd64\\python38.zip', 'D:\\python-3.8.1-embed-amd64', '
D:\\python-3.8.1-embed-amd64\\lib\\site-packages']
>>>
Check PIP Installion in Embedded Python
Sources and References
https://michlstechblog.info/blog/python-install-python-with-pip-on-windows-by-the-embeddable-zip-file/
ยฉsideway
ID: 211200001 Last Updated: 12/1/2021 Revision: 0
|
 |