【发布时间】:2023-02-07 19:55:11
【问题描述】:
我有一个项目需要依赖 pysam 的最新提交,因为我在 python 3.11 中工作。
这意味着从源代码构建包,所以我执行以下操作:
poetry add git+https://github.com/pysam-developers/pysam
但是,我收到一个错误,我认为这归结为构建环境中不包括 cython 的诗歌:
Unable to determine package info for path: /Users/agreen/Library/Caches/pypoetry/virtualenvs/rnacentral-pipeline-GU-1IkEM-py3.11/src/pysam
Fallback egg_info generation failed.
Command ['/var/folders/sg/3858brmd79z4rz781g0q__940000gp/T/tmpw8auvhsm/.venv/bin/python', 'setup.py', 'egg_info'] errored with the following return code 1, and output:
# pysam: no cython available - using pre-compiled C
Traceback (most recent call last):
File "/Users/agreen/Library/Caches/pypoetry/virtualenvs/rnacentral-pipeline-GU-1IkEM-py3.11/src/pysam/setup.py", line 345, in <module>
raise ValueError(
ValueError: no cython installed, but can not find pysam/libchtslib.c.Make sure that cython is installed when building from the repository
肯定安装了 Cython,它在 pyproject.toml 中,我可以从 poetry shell 调用它,或者在 poetry virtualenv 中启动的 python 中导入它。但是,如果我使用 poetry 运行命令中的 python,那么 cython 确实不可用。
我想我缺少构建的某些配置,或者poetry add 的一些额外选项。关于 cython 的这种使用,文档并不是特别清楚——据我所知,这都是关于在我正在编写的包中使用 cython 的,这不是我想要的。
【问题讨论】:
标签: python cython python-packaging python-poetry