pip with embedded python

前端 未结 4 1398
感动是毒
感动是毒 2020-12-04 22:16

I installed embedded python from here, titled \"Windows x86-64 embeddable zip file\", but it does not have pip installed, it does not have site-packages either, when I try t

4条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 22:42

    Even if explicitly stated that the embeddable version of Python does not support Pip, it is possible with care. You need to:

    1. Download and unzip Python embeddable zip file.

    2. In the file python39._pth or similar, uncomment the import command. Result should look similar to this:

      python39.zip
      .
      import site
      
    3. Download get-pip.py to the Python install folder

    4. Run get-pip.py. this installs Pip into the Scripts directory:

      python get-pip.py
      
    5. Run Pip directly from command line as Pip is a executable program (this example is to install Pandas):

      .\Scripts\pip install pandas
      

    You could find more information about this in the Pip issue 4207

提交回复
热议问题