Adding packages to Python “embedded” installation for Windows

前端 未结 2 1720
醉梦人生
醉梦人生 2021-02-13 21:26

From the documentation:

The embedded distribution is a ZIP file containing a minimal Python environment.

Sounds great! The 64-bit

2条回答
  •  -上瘾入骨i
    2021-02-13 21:58

    There is a way to extend Python embedded installation. The trick is to install the same python version( I will call it NormalPython) as your target embedded python(I will call it EmbeddedPython). The version as well as architecture has to match exactly.

    You then install modules from pip on NormalPython. You can find pip on NormalPython\Scripts.

    Go to NormalPython\Lib\site-packages and copy all files that appear after installing whatever you want to install through pip to EmbeddedPython\Lib\

    Then add Lib to pythonXX._pth inside Embedded python folder.

    This worked for me on windows 10 after downloading the latest python embed and python install through https://www.python.org/downloads/windows/ . I used Michal Rawluk's answer to do it, but it was somewhat hard to understand so I am trying to explain it a bit differently.

提交回复
热议问题