Ensurepip not available in Python embedable package

225 views Asked by At

I'm trying to install python on my company provided laptop which has blocked download of exe & tar.gz files. So i download embeddable file. But pip/ensurepip is missing in site-package folder of the embeddable file. System is running Windows Pro 10. I tried get-pip.py method, but i get SSL connecting error. The firewall is blocking the connection. Any help on how to solve this issue.

1

There are 1 answers

0
Luke On

It is annoying with such restrictive environment for developers. However, if you have access to another windows machine without such restrictions, you can unzip and create an embedded python fold at the same exact path. Then download get-pip.py and run with python.

Chance is that you may find the installed pip doesn't work and pip is not in sys.path. If so, follow the instruction here https://stackoverflow.com/a/44443956 to uncomment

#import site

and run

python -m site

to confirm that the \lib\site-packages is added to sys.path. You may also want to delete the directory of USER_SITE

%AppData%\Python\Python310\site-packages

to avoid surprises. That's a useful feature but could create problems for people unaware of their existence in sys.path.

Lastly, you may also find venv is not available with embedded python. Run

pip install virtualenv

and use virtualenv instead. There are also other well-known missing parts but you at least get the most important tools already. Once tested working, copy the site-packages to your restricted laptop at the exact same path and test it out. :-)