简体   繁体   中英

How to cerate local cahe for pip to use in LAN without internet?

I am trying to get pip install working in a machine without internet connection. I tried using three proxies(devpi-server, proxypypi and pypicache) in a server within same LAN, but with internet connection.

pip --no-cache-dir --trusted-host <serverip> install -i http://<serverip>:3141/root/pypi/+simple/ Flask

Pip ends up not using the proxy and try to collect packages directly from piwheels.org and files.pythonhosted.org and throws error(since the machine doesn't have internet connection).

Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='www.piwheels.org', port=443): Max retries exceeded with url: /simple/flask/ (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x75729ad0>: Failed to establish a new connection: [Errno 101] Network is unreachable',))

Any solutions? Thank you

I usually use the --proxy flag as the example here

sudo pip install --proxy=https://[username:password@]proxyserver:port somepackage

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM