【发布时间】:2021-07-12 04:28:01
【问题描述】:
我写了一个C嵌入式python包,用下面的代码构建了一个wheel文件:
python3 setup.py bdist_wheel
在我的 dist 文件夹中,我发现: mypackage-1.0-cp38-cp38-macosx_10_14_6_x86_64.whl
操作系统版本:10.15.7
64位-Python版本:3.8
pip3 版本:21.1.3
我的第一个问题是我的macosx的版本是10.15.7,但是为什么轮子将.whl文件构建为10.14.6版本
然后我尝试使用以下方式安装软件包:
python3 -m pip install dist/*
我收到错误为 ERROR: mypackage-1.0-cp38-cp38-macosx_10_14_6_x86_64.whl is not a supported wheel on this platform.
然后我将 .whl 文件更改为“mypackage-1.0-cp38-cp38-macosx_10_15_7_x86_64.whl”并得到同样的错误。
谁有什么问题? 下面是我的 setup.py
#!/usr/bin/env python
from setuptools import setup, Extension
import numpy as np
c_mycode = Extension(
'c_mycode',
sources=['c_mycode/pymycode.c',
'c_mycode/mycode.c' ],
include_dirs=['c_mycode', np.get_include()],
define_macros=[('NPY_NO_DEPRECATED_API', 'NPY_1_4_API_VERSION')])
setup(
name='mypackage',
version='1.0',
description=(
"a package in Python."
),
setup_requires=["wheel"],
author='xxx',
author_email='xxx@xxx',
license="BSD compatable (see the LICENSE file)",
packages=['mycode'],
ext_modules=[c_mycode]
)
【问题讨论】:
标签: python python-wheel