Distributing python packages to offline machines

久未见 提交于 2019-12-23 05:22:52

问题


Let's say that I have two machines.

macOS 10.13 with internet connection 
macOS 10.12 with no network connection

I want to install readline (for example) via a wheel.

I can grab the wheel easily enough with:

pip wheel -w . readline

and what I get is:

readline-6.2.4.1-cp36-cp36m-macosx_10_13_x86_64.whl

however, when I take this wheel over the the 10.12 machine and try to install it with:

pip install --no-index --find-links . readline

it will not install because the filename is tagged with 10.13.

Now, of course, the situation could be made a bit more complicated when either the internet connected machine or the offline machine is running Ubuntu.

Is there a way to ask pip for a particular wheel for a particular target OS?

Is the standard way of handling this to run 'pip wheel -w . readline' on the OS for the OS on which it will ultimately be installed?


回答1:


Is the standard way of handling this to run 'pip wheel' on the OS for the OS on which it will ultimately be installed?

Yes. People who release binary packages for a lot of architectures run a fleet of virtual machines or containers with a lot of emulated processor architectures and OSes.

For free software you can use free tiers on commercial CIs. At Travis CI you can generate wheels for Linux and Mac OS X, at AppVeyor for w32.

See https://pypi.python.org/pypi/cibuildwheel and https://github.com/matthew-brett/multibuild for example of programs that help to build wheels for different platforms.



来源:https://stackoverflow.com/questions/49635600/distributing-python-packages-to-offline-machines

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!