On my Windows machine numpy takes 8 minutes to build and install [*]. And no, that doesn't include the time to install the compiler tools, it wouldn't even be close. I'm not sure what's going on, in an Ubuntu VM it builds and installs in under 3 minutes. It's annoying, but fortunately enough there's a nice trick to speed up installation: store all your wheels somewhere and then use that directory as a cache. This makes installing large packages that don't have wheels on PyPI faster even if they don't have C extensions as the build step is skipped.
In case you were wondering, pip doesn't cache the wheels built locally [1], so this is worth doing when there are no wheels for your platform on PyPI.
On Windows just make a file c:\Users\username\pip\pip.ini and add this in:
[global]
find-links = file://c:/Users/username/.pip-wheelhouse
[wheel]
wheel-dir = c:/Users/username/.pip-wheelhouse
For Linux it's /home/username/.pip/pip.conf:
[global]
find-links = file:///home/username/.pip-wheelhouse
[wheel]
wheel-dir = /home/username/.pip-wheelhouse
Alternatively, you can use environment variables for this. In your .bashrc or .zshrc add:
export STANDARD_CACHE_DIR="${XDG_CACHE_HOME:-${HOME}/.cache}/pip"
export WHEELHOUSE="${STANDARD_CACHE_DIR}/wheelhouse"
export PIP_FIND_LINKS="file://${WHEELHOUSE}"
export PIP_WHEEL_DIR="${WHEELHOUSE}"
Then just run:
pip wheel numpy ::...
免责声明:
当前网页内容, 由 大妈 ZoomQuiet 使用工具: ScrapBook :: Firefox Extension 人工从互联网中收集并分享;
内容版权归原作者所有;
本人对内容的有效性/合法性不承担任何强制性责任.
若有不妥, 欢迎评注提醒:
或是邮件反馈可也:
askdama[AT]googlegroups.com
订阅 substack 体验古早写作:
点击注册~> 获得 100$ 体验券:![]()
关注公众号, 持续获得相关各种嗯哼:
![]()
自怼圈/年度番新
![]()
关于 ~ DebugUself with DAMA ;-)
粤ICP备18025058号-1
公安备案号: 44049002000656 ...::