- 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/*
推薦閱讀
- Mastering Concurrency Programming with Java 8
- Mastering Adobe Captivate 2017(Fourth Edition)
- Python量化投資指南:基礎(chǔ)、數(shù)據(jù)與實戰(zhàn)
- C++ Builder 6.0下OpenGL編程技術(shù)
- Android 7編程入門經(jīng)典:使用Android Studio 2(第4版)
- Python 3網(wǎng)絡(luò)爬蟲實戰(zhàn)
- Cassandra Data Modeling and Analysis
- TypeScript圖形渲染實戰(zhàn):基于WebGL的3D架構(gòu)與實現(xiàn)
- Python Data Analysis(Second Edition)
- LabVIEW虛擬儀器入門與測控應(yīng)用100例
- Quantum Computing and Blockchain in Business
- Microsoft 365 Certified Fundamentals MS-900 Exam Guide
- SQL Server 2016 從入門到實戰(zhàn)(視頻教學(xué)版)
- Learning iOS Penetration Testing
- TypeScript High Performance