利用uv自带的cpython软件包在离线机器中安装pandas软件

一台离线机器需要安装特定的cpython软件包和pandas软件,不能用uv直接安装,因为需要联网。

uv自带的cpython软件包地址是 https://github.com/astral-sh/python-build-standalone/releases/download,

可以在联网机器中选择相应的版本,比如:3.10.20,用curl下载。

复制代码
aaa@kylin-pc:~/par$ curl -LO https://bgithub.xyz/astral-sh/python-build-standalone/releases/download/20260408/cpython-3.10.20+20260408-aarch64-unknown-linux-gnu-install_only_stripped.tar.gz -k -C -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 28.8M  100 28.8M    0     0  45584      0  0:11:02  0:11:02 --:--:-- 43545

然后解压缩,进入bin目录执行该版本,验证确实能够执行且版本正确。

复制代码
aaa@kylin-pc:~/par$ cd 310/python
aaa@kylin-pc:~/par/310/python$ cd bin
aaa@kylin-pc:~/par/310/python/bin$ ./python
Python 3.10.20 (main, Apr  7 2026, 20:43:46) [Clang 22.1.1 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D

继续用pip在线安装numpy和pandas。这里不用uv安装是因为需要知道对应包的地址。

复制代码
aaa@kylin-pc:~/par/310/python/bin$ ./python ~/par/pip.pyz install numpy  -i https://mirrors.aliyun.com/pypi/simple/
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting numpy
  Downloading https://mirrors.aliyun.com/pypi/packages/eb/17/96a3acd228cec142fcb8723bd3cc39c2a474f7dcf0a5d16731980bcafa95/numpy-2.2.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.3/14.3 MB 2.1 MB/s  0:00:06
Installing collected packages: numpy
Successfully installed numpy-2.2.6
aaa@kylin-pc:~/par/310/python/bin$ ./python ~/par/pip.pyz install pandas  -i https://mirrors.aliyun.com/pypi/simple/
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting pandas
  Downloading https://mirrors.aliyun.com/pypi/packages/1d/03/3fc4a529a7710f890a239cc496fc6d50ad4a0995657dccc1d64695adb9f4/pandas-2.3.3-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (12.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.1/12.1 MB 2.3 MB/s  0:00:05
Requirement already satisfied: numpy>=1.22.4 in /home/aaa/par/310/python/lib/python3.10/site-packages (from pandas) (2.2.6)
Collecting python-dateutil>=2.8.2 (from pandas)
  Downloading https://mirrors.aliyun.com/pypi/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Collecting pytz>=2020.1 (from pandas)
  Downloading https://mirrors.aliyun.com/pypi/packages/10/99/781fe0c827be2742bcc775efefccb3b048a3a9c6ce9aec0cbf4a101677e5/pytz-2026.1.post1-py2.py3-none-any.whl (510 kB)
Collecting tzdata>=2022.7 (from pandas)
  Downloading https://mirrors.aliyun.com/pypi/packages/b0/70/d460bd685a170790ec89317e9bd33047988e4bce507b831f5db771e142de/tzdata-2026.1-py2.py3-none-any.whl (348 kB)
Collecting six>=1.5 (from python-dateutil>=2.8.2->pandas)
  Downloading https://mirrors.aliyun.com/pypi/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: pytz, tzdata, six, python-dateutil, pandas
Successfully installed pandas-2.3.3 python-dateutil-2.9.0.post0 pytz-2026.1.post1 six-1.17.0 tzdata-2026.1
aaa@kylin-pc:~/par/310/python/bin$ ./python ~/par/pip.pyz install matplotlib  -i https://mirrors.aliyun.com/pypi/simple/
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting matplotlib
  Downloading https://mirrors.aliyun.com/pypi/packages/73/ae/2d5817b0acee3c49b7e7ccfbf5b273f284957cc8e270adf36375db353190/matplotlib-3.10.8-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (9.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.5/9.5 MB 2.4 MB/s  0:00:03
Collecting contourpy>=1.0.1 (from matplotlib)
  Downloading https://mirrors.aliyun.com/pypi/packages/c1/bd/20c6726b1b7f81a8bee5271bed5c165f0a8e1f572578a9d27e2ccb763cb2/contourpy-1.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (312 kB)
Collecting cycler>=0.10 (from matplotlib)
  Downloading https://mirrors.aliyun.com/pypi/packages/e7/05/c19819d5e3d95294a6f5947fb9b9629efb316b96de511b418c53d245aae6/cycler-0.12.1-py3-none-any.whl (8.3 kB)
Collecting fonttools>=4.22.0 (from matplotlib)
  Downloading https://mirrors.aliyun.com/pypi/packages/4c/28/40f15523b5188598018e7956899fed94eb7debec89e2dd70cb4a8df90492/fonttools-4.62.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (4.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.9/4.9 MB 2.4 MB/s  0:00:01
Collecting kiwisolver>=1.3.1 (from matplotlib)
  Downloading https://mirrors.aliyun.com/pypi/packages/8a/e4/3f43a011bc8a0860d1c96f84d32fa87439d3feedf66e672fef03bf5e8bac/kiwisolver-1.5.0-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 2.2 MB/s  0:00:00
Requirement already satisfied: numpy>=1.23 in /home/aaa/par/310/python/lib/python3.10/site-packages (from matplotlib) (2.2.6)
Collecting packaging>=20.0 (from matplotlib)
  Downloading https://mirrors.aliyun.com/pypi/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl (74 kB)
Collecting pillow>=8 (from matplotlib)
  Downloading https://mirrors.aliyun.com/pypi/packages/a1/2a/8c79d6a53169937784604a8ae8d77e45888c41537f7f6f65ed1f407fe66d/pillow-12.2.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (6.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.4/6.4 MB 2.4 MB/s  0:00:02
Collecting pyparsing>=3 (from matplotlib)
  Downloading https://mirrors.aliyun.com/pypi/packages/10/bd/c038d7cc38edc1aa5bf91ab8068b63d4308c66c4c8bb3cbba7dfbc049f9c/pyparsing-3.3.2-py3-none-any.whl (122 kB)
Requirement already satisfied: python-dateutil>=2.7 in /home/aaa/par/310/python/lib/python3.10/site-packages (from matplotlib) (2.9.0.post0)
Requirement already satisfied: six>=1.5 in /home/aaa/par/310/python/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib) (1.17.0)
Installing collected packages: pyparsing, pillow, packaging, kiwisolver, fonttools, cycler, contourpy, matplotlib
Successfully installed contourpy-1.3.2 cycler-0.12.1 fonttools-4.62.1 kiwisolver-1.5.0 matplotlib-3.10.8 packaging-26.0 pillow-12.2.0 pyparsing-3.3.2
aaa@kylin-pc:~/par/310/python/bin$ 

将上述安装日志信息复制到一个文件a,然后用cat a|grep https 就能筛选出所有地址,再在前面加上curl命令,就可以重新下载所需的依赖包

将cpython软件包、依赖包和pip.pyz命令写入光盘,插入离线机器光盘驱动器,就能重新安装了。

相关推荐
万粉变现经纪人2 小时前
如何解决 pip install ta-lib 报错 本地 TA-Lib 库未安装 问题
数据库·python·scrapy·oracle·bug·pandas·pip
李昊哲小课3 小时前
Pandas数据分析 - 第十一章:数据可视化
信息可视化·数据挖掘·数据分析·pandas·matplotlib
rannn_11119 小时前
【Redis|实战篇7】黑马点评|附近商铺、用户签到、UV签到
java·数据库·redis·后端·uv
絆人心2 天前
Python 数据分析核心库:Pandas 与 NumPy 从入门到实战全指南(附电商用户分析完整代码)
python·数据挖掘·数据分析·numpy·pandas·数据处理·电商数据分析
李昊哲小课2 天前
Pandas数据分析 - 第十二章:性能优化
性能优化·数据挖掘·数据分析·pandas
李昊哲小课2 天前
Pandas数据分析 - 第二章:Series 对象详解
数据挖掘·数据分析·pandas
测试开发Kevin2 天前
Pandas 2.x核心技术—— Apache Arrow 高性能数据处理的基石
大数据·pandas
李昊哲小课2 天前
Pandas数据分析 - 第三章:DataFrame 对象详解
数据挖掘·数据分析·pandas
不会唱歌的拖拉机3 天前
使用Pandas进行RFM分析全过程
数据分析·pandas