- Secret Recipes of the Python Ninja
- Cody Jackson
- 116字
- 2021-06-25 22:14:42
How to do it...
To create an archive (from the official documentation: https://pip.pypa.io/en/latest/user_guide/#installation-bundles), perform the following:
- Create a temporary directory:
$ tempdir = $(mktemp -d /tmp/archive_dir)
- Create a wheel file:
$ pip wheel -r requirements.txt --wheel-dir = $tempdir
- Let the OS know where to place the archive file:
$ cwd = `pwd`
- Change to the temporary directory and create the archive file:
$ (cd "$tempdir"; tar -cjvf "$cwd/<archive>.tar.bz2" *)
To install from an archive, do the following:
- Create a temporary directory:
$ tempdir=$(mktemp -d /tmp/wheelhouse-XXXXX)
- Change to the temporary directory and unarchive the file:
$ (cd $tempdir; tar -xvf /path/to/<archive>.tar.bz2)
- Use pip to install the unarchived files:
$ pip install --force-reinstall --ignore-installed --upgrade --no-index --no-deps $tempdir/*
推薦閱讀
- Visual C++串口通信開發(fā)入門與編程實踐
- Java面向?qū)ο筌浖_發(fā)
- 單片機C語言程序設(shè)計實訓(xùn)100例:基于STC8051+Proteus仿真與實戰(zhàn)
- Xcode 7 Essentials(Second Edition)
- Windows Presentation Foundation Development Cookbook
- C語言從入門到精通(第4版)
- Java 9模塊化開發(fā):核心原則與實踐
- 編程數(shù)學(xué)
- 輕松上手2D游戲開發(fā):Unity入門
- C/C++數(shù)據(jù)結(jié)構(gòu)與算法速學(xué)速用大辭典
- Training Systems Using Python Statistical Modeling
- INSTANT Apache ServiceMix How-to
- Web前端開發(fā)技術(shù):HTML、CSS、JavaScript
- C語言程序設(shè)計與應(yīng)用實驗指導(dǎo)書(第2版)
- Beginning C# 7 Hands-On:The Core Language