[英]How to package a wheel for a library meant to run on python3.8 32bits on windows10?
I'm building a python library: my_custom_library , with standard requirements (NumPy, pandas, librosa ...) and custom functions.我正在构建一个 python 库: my_custom_library ,具有标准要求(NumPy、pandas、librosa ...)和自定义函数。
I would like to build a wheel of my_custom_library to then pip install
this library on python3.8 32bits on windows10 on a machine with no access to internet (flash drive transfert).我想构建一个my_custom_library的轮子,然后在无法访问互联网(闪存驱动器传输)的机器上的 windows10 上的 python3.8 32bits 上
pip install
此库。 This install should be a "true" windows10 install and should not require WSL.这个安装应该是一个“真正的” windows10安装,应该不需要WSL。
I would consider the packaging a success if I could produce one file my_custom_library-0.0.0-win32.whl
similar to numpy-1.18.1-cp38-cp38-win32.whl
on https://pypi.org/project/numpy/#files .如果我可以在https://pypi.org/project/numpy/上生成一个类似于
numpy-1.18.1-cp38-cp38-win32.whl
文件my_custom_library-0.0.0-win32.whl
我会认为打包是成功的#文件。 This package is meant to stay private, I don't want to publish anything on pypi.这个包是为了保密,我不想在 pypi 上发布任何东西。
What is the best practice to build the wheel of my_custom_library for windows10 ?为windows10构建my_custom_library的轮子的最佳实践是什么?
What is the shortest list of commands to do that ?执行此操作的最短命令列表是什么?
From what I saw, it seems I need to build the wheel on the same OS as the OS where the wheel will be installed.从我所看到的,似乎我需要在与安装轮子的操作系统相同的操作系统上构建轮子。
Can I build the wheel on a linux machine (ubuntu 18.04LTS) and install it on windows10 ?我可以在 linux 机器(ubuntu 18.04LTS)上构建轮子并将其安装在 windows10 上吗?
If it's possible, what is the shortest list of commands to do that ?如果可能,那么最短的命令列表是什么?
my_custom_library will import many well-known libraries including: my_custom_library将导入许多著名的库,包括:
librosa==0.7.1
matplotlib==3.1.1
numpy==1.16.4
opencv-python==4.1.2.30
pandas==0.24.2
scikit-learn==0.21.3
scipy==1.3.2
Can I build the wheel on a linux machine (ubuntu 18.04LTS) and install it on windows10 ?
我可以在 linux 机器(ubuntu 18.04LTS)上构建轮子并将其安装在 windows10 上吗?
Pure Python library — yes.纯 Python 库——是的。 Actually a pure Python library doesn't need to be platform-specific at all, you can build a universal wheel or use sdist (source distribution).
实际上,纯 Python 库根本不需要特定于平台,您可以构建一个万能轮或使用 sdist(源代码分发)。
But if the library has code written in C/C++ then no, you have to build it on an exact platform (processor architecture, minimal OS version, exact Python version).但是,如果库中有用 C/C++ 编写的代码,那么就不能,您必须在精确的平台(处理器架构、最小操作系统版本、精确的 Python 版本)上构建它。 You can build 32-bit library on a 64-bit Windows using 32-bit Python.
您可以使用 32 位 Python 在 64 位 Windows 上构建 32 位库。 But not the other way around — you cannot build 64-bit library on a 32-bit Windows.
但反之亦然——您不能在 32 位 Windows 上构建 64 位库。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.