Python 安装程序包失败,后端为
我想从github安装一个包 软件包的设置如下:Python 安装程序包失败,后端为,python,cython,setuptools,setup.py,python-poetry,Python,Cython,Setuptools,Setup.py,Python Poetry,我想从github安装一个包 软件包的设置如下: pyproject.toml ... build = "build.py" [tool.poetry.dependencies] python = "^3.7" [build-system] requires = ["poetry-core>=1.0.0", "cython"] build-backend = "poetry.core.masonr
pyproject.toml
...
build = "build.py"
[tool.poetry.dependencies]
python = "^3.7"
[build-system]
requires = ["poetry-core>=1.0.0", "cython"]
build-backend = "poetry.core.masonry.api"
build.py
from Cython.Build import cythonize
from distutils.command.build_ext import build_ext
def build(setup_kwargs):
setup_kwargs.update({
'ext_modules': cythonize(["asyncmy/*.pyx"],
language_level=3,
compiler_directives={'linetrace': True}),
'cmdclass': {'build_ext': build_ext}
})
# setup.py
import setuptools;setuptools.setup()
setup.cfg
[flake8]
ignore = E501,W503,E203
我正在使用python3.7.7
+pip 21.0.1
在win32上运行[MSC v.1900 64位(AMD64)],并且在安装此软件包时使用
python -m pip install .
我犯了这样的错误
ERROR: Could not build wheels for asyncmy which use PEP 517 and cannot be installed directly
但是如果我添加一个setup.py
from Cython.Build import cythonize
from distutils.command.build_ext import build_ext
def build(setup_kwargs):
setup_kwargs.update({
'ext_modules': cythonize(["asyncmy/*.pyx"],
language_level=3,
compiler_directives={'linetrace': True}),
'cmdclass': {'build_ext': build_ext}
})
# setup.py
import setuptools;setuptools.setup()
软件包可以正确安装,那么配置有什么问题吗
谢谢。pip
无法将poetry用作构建后端,您需要使用poetry
构建/安装此项目
如果您在*nix工作站上,则可以运行curl-sSLhttps://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py |python-
安装它(有关详细信息,请参阅)。完成后,运行poyment安装
而不是python-m pip安装。
以获得项目的开发人员安装(包括虚拟化)
如果您想创建一个可分发文件,您可以将其上载到包索引或直接使用pip
安装,请运行poetry build
,您的意思是它不能打包并上载到pypi
进行pip安装
吗,这更容易,因为您不需要额外的库来处理发布poetry build
将为您创建一个轮子分发,这是您希望上载到pypi的工件。poetry可以使用poetry publish
(有关详细信息,请参阅)。当有人用pip install
安装您的软件包时,它是用诗歌构建的这一事实是无关紧要的,它可以正常工作。但是我很困惑为什么不能通过pip install
在windows平台上安装模块asyncmy
,你能帮我吗?我可以尝试在到达windows pc后复制它。但是从他们的pypi条目中可以看出,他们没有为windows上传控制盘,只有linux。他们上传了一个源发行版,pip下载该发行版,然后尝试在本地构建。当它这样做时,pip会看到pyproject.toml
文件,并假设它无法决定应该选择哪个后端。您可以通过将pip升级到最新版本来修复它,该版本应该能够正确解析pypoject文件。好吧,我很好奇地启动了另一台机器,可以重现您在项目中创建的问题中发布的错误。恐怕没有简单的解决方案,调试它需要一些时间。有cython和windows经验的人可能会无意中发现这个问题,并提供一些见解。