简体   繁体   中英

Install python packages in windows server 2016 which has no internet connection

I need to install python packages in a windows server 2016 sandbox for running a developed python model in production.This doesn't have internet connection.

My laptop is windows 2010 and the model is now running in my machine and need to push this to the server.

My question is how can i install all the required packages in my server which has no internet connection.

Thanks Mithun

For the windows server machine make sure you have pip installed and added to path.

Then proceed with the following steps:

  1. Since you are using windows try to download the packages from Unofficial Python Binaries in your personal laptop that has an internet connection. Try to download the whl file.
  2. Copy / transfer the downloaded whl file to the windows server machine.
  3. Use pip to install the copied / transferred whl file.
pip install <filname>.whl

If you dont want to install any mathematical packages, you can use the official Python Package Index (PyPI) repository.

Proceed with the following steps to download a Python Library from the Official Library:

  1. Open the Official Python Package Index page.

  2. Search for your required package (eg, I am searching for a library named beautifulsoup4 link )

  3. You need to select Download Files from the side menu. eg,

  4. Download the required version whl file.

  5. Copy / transfer the downloaded whl file to the windows server machine.

  6. Use pip to install the copied / transferred whl file.

A simply way is to install the same python version on another machine having internet access, and use normally pip on that machine. This will download a bunch of files and installs them cleanly under Lib\\site_packages of your Python installation.

You can they copy that folder to the server Python installation. If you want to be able to later add packages, you should keep both installations in sync: do not add or remove any package on the laptop without syncing with the server.

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