Build a Python environment offline

A note on how to install Python packages on devices that are not connected to the internet.

The list of packages you want to install is organized in requirements.txt.

I verified it in Windows 10 (x86_64) + Anaconda3 environment, but I feel that it can be done on other platforms as well.

Download the package on your online device

$ pip download --dest=src -r requirements.txt

This online terminal uses the same platform as the offline terminal (installation destination). pip download has an option called --platform, so if you specify this well, it may be possible on different platforms, but it has not been verified. Reference: pip download — pip documentation

If you look in the src directory, you can see that the package can be downloaded in the form of a wheel or tarball.

Install the package on an offline device

It is assumed that the package file downloaded on the online terminal is copied to the offline terminal and placed under the src directory.

$ pip install --no-index --find-links=src -r requirements.txt

This will try to install the package based on requirements.txt, but will look for the package in the src directory instead of from PyPI (Internet).

Recommended Posts

Build a Python environment offline
Build a python3 environment on CentOS7
Build a python environment on MacOS (Catallina)
I want to build a Python environment
Create a Python environment
Build a python virtual environment with pyenv
Build a Python + OpenCV environment on Cloud9
Build a modern Python environment with Neovim
Simply build a Python 3 execution environment on Windows
Build a python environment with ansible on centos6
Build a Python environment on Mac (Mountain Lion)
[Python] Build a Django development environment with Docker
Create a python3 build environment with Sublime Text3
Build a Python development environment on your Mac
Build a simple Python virtual environment without pyenv
Build a Python environment with OSX El capitan
Quickly build a Python Django environment with IntelliJ
Build a Python machine learning environment with a container
Build a Python development environment on Raspberry Pi
Build a python execution environment with VS Code
Build a LAMP environment [CentOS 7]
Build python3 environment with ubuntu 16.04
Build python environment with direnv
Build python environment on windows
Build a machine learning environment
Building a Python virtual environment
Build a GVim-based Python development environment on Windows 10 (3) GVim8.0 & Python3.6
# 2 Build a Python environment on AWS EC2 instance (ubuntu18.04)
Build a python virtual environment with virtualenv and virtualenvwrapper
Build a machine learning Python environment on Mac OS
Build a python environment for each directory with pyenv-virtualenv
Build a GVim-based Python development environment on Windows 10 (1) Installation
How to build a Django (python) environment on docker
Build a Python development environment on Mac OS X
Build a Python virtual environment using venv (Django + MySQL ①)
Build a Python environment on your Mac using pyenv
Build a machine learning application development environment with Python
Build a python virtual environment with virtualenv and virtualenvwrapper
Build a Python development environment using pyenv on MacOS
Build python 1.0
How to build a Python environment on amazon linux 2
Building a Python environment on Mac
Build python virtual environment with virtualenv
Build a go environment using Docker
Building a Python environment on Ubuntu
Create a Python environment on Mac (2017/4)
Build Mysql + Python environment with docker
Create a virtual environment with Python!
Building a virtual environment with Python 3
Build Python 3.8 + Pipenv environment on Ubuntu 18.04
Build a python machine learning study environment on macOS sierra
How to build a new python virtual environment on Ubuntu
Build a Python development environment in Eclipse (add HTML editor)
Build a python data analysis environment on Mac (El Capitan)
Build a GVim-based Python development environment on Windows 10 (2) Basic settings
Build a Python environment and transfer data to the server
How to build a python2.7 series development environment with Vagrant
Build a python environment with pyenv (OS X El Capitan 10.11.3)
Build a Python environment with WSL + Pyenv + Jupyter + VS Code
Build a python environment on CentOS 7.7 for your home server
[Pyenv] Building a python environment with ubuntu 16.04