Also, this does not make your packages cross-platform. You can move the directory around, but it can only be used on other similar computers. Some known environmental differences that can cause incompatibilities: a different version of Python, when one platform uses UCS2 for its internal unicode representation and another uses UCS4 (a compile-time option), obvious platform changes like Windows vs. Linux, or Intel vs. ARM, and if you have libraries that bind to C libraries on the system, if those C libraries are located somewhere different (either different versions, or a different filesystem layout).
考虑使用virtualenv的
relocatable
选项。有关完整文档,请参阅virtualenv documentation on the subject。在一个有趣的音符:
作为这种方法的替代方法,我将简单地使用设置.py需求(
install_requires
,setup_requires
)或pip要求.txt文件。这是更便携和跨平台。在相关问题 更多 >
编程相关推荐