pandas - 在 Ubuntu 20.04 上为 pandas 构建轮子需要 20 多分钟,但在 18.04 上不需要

标签 pandas pip ubuntu-20.04 erpnext frappe

我有一个 ERPNext 安装脚本,它在 Ubuntu 18.04 上运行良好。
当我在 20.04 运行相同的脚本时,我不得不等待 20 多分钟才能完成,而在 18.04 需要大约 30 秒。
我的脚本包括这两行:

  ./env/bin/pip install numpy==1.18.5
  ./env/bin/pip install pandas==0.24.2
他们的输出是:
Collecting numpy==1.18.5
  Downloading numpy-1.18.5-cp38-cp38-manylinux1_x86_64.whl (20.6 MB)
     |████████████████████████████████| 20.6 MB 138 kB/s 
Installing collected packages: numpy
Successfully installed numpy-1.18.5
Collecting pandas==0.24.2
  Downloading pandas-0.24.2.tar.gz (11.8 MB)
     |████████████████████████████████| 11.8 MB 18.0 MB/s 
Requirement already satisfied: python-dateutil>=2.5.0 in ./env/lib/python3.8/site-packages (from pandas==0.24.2) (2.8.1)
Requirement already satisfied: pytz>=2011k in ./env/lib/python3.8/site-packages (from pandas==0.24.2) (2019.3)
Requirement already satisfied: numpy>=1.12.0 in ./env/lib/python3.8/site-packages (from pandas==0.24.2) (1.18.5)
Requirement already satisfied: six>=1.5 in ./env/lib/python3.8/site-packages (from python-dateutil>=2.5.0->pandas==0.24.2) (1.13.0)
Building wheels for collected packages: pandas
  Building wheel for pandas (setup.py) ... done
  Created wheel for pandas: filename=pandas-0.24.2-cp38-cp38-linux_x86_64.whl size=43655329 sha256=0067caf3a351f263bec1f4aaa3e11c5857d0434db7f56bec7135f3c3f16c8c2b
  Stored in directory: /home/erpdev/.cache/pip/wheels/3d/17/1e/85f3aefe44d39a0b4055971ba075fa082be49dcb831db4e4ae
Successfully built pandas
Installing collected packages: pandas
Successfully installed pandas-0.24.2
“Building wheel for pandas (setup.py) .../”行是发生 20 分钟延迟的地方。
这一切都在 Frappe/ERPnext 命令目录中运行,该目录具有 pip3 的嵌入式副本,如下所示:
erpdev@erpserver:~$ cd ~/frappe-bench/
erpdev@erpserver:~/frappe-bench$ ./env/bin/pip --version
pip 20.1.1 from /home/erpdev/frappe-bench/env/lib/python3.8/site-packages/pip (python 3.8)
erpdev@erpserver:~/frappe-bench$ 
我将不胜感激任何有关如何加快速度的建议。

最佳答案

您的问题可能与您的发行版无关,而与您的 virtualenv 中的 Python 版本有关。 Ubuntu 20.04 的默认 Python 指向 3.8 .
来自 pandas项目挂牌 PyPI ,您的 pip 搜索与您的系统兼容的版本,由项目维护者提供。
看来您正在使用 CPython3.8 . pandas==0.24.2没有为您的版本构建轮子,因此您的系统每次都为自己构建它们。您可以从 here 查看可用的下载文件。 .
可能的解决方案:

  • 在创建您的 env 时, 退房 this answer为不同版本生成虚拟环境。似乎您的选择介于 3.5 之间, 3.63.7 .
  • CPython3.8 制作一个轮子并将其与您的脚本一起发送。您可以使用 that 安装您的软件包.
  • 关于pandas - 在 Ubuntu 20.04 上为 pandas 构建轮子需要 20 多分钟,但在 18.04 上不需要,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62885419/

    相关文章:

    python - Zipline:使用 pandas-datareader 为非美国金融市场提供 Google 财经数据框

    python - 根据条件 datetime64 合并 DataFrames

    python - 使用 pip 和 macport 安装的 virtualenv 路径错误

    python-3.x - Azure DevOps - pip ValueError : HTML doctype missing or incorrect

    ubuntu - nginx.service 启动失败 : Unit nginx. 找不到服务

    python - 寻找树内最近的节点

    python - 主动份额措施的计算

    python - Pyinstaller 错误 xfd 模块

    yocto - petalinux 项目构建因 m4-native-1.4.18-r0 do_compile 在主机 Ubuntu 20.04 LTS 上失败而失败

    influxdb - Influx CLI 快把我逼疯了,无法打开 CLI