007yxc
V2EX  ›  Python

新手请教关于 pyproject.toml 的问题

By 007yxc at 2023 年 7 月 29 日 · 2744 次点击

菜鸟在自学 Python ,Github 的开源学习项目,想在本地跑一下。

安装包的时候一直会提示错误

pip install -r requirements.txt

错误提示如下

Could not build wheels for lxml, Pillow, which is required to install pyproject.toml-based projects

折腾了好久 pyproject.toml-based projects 该如何安装, 有相关资料可以参考吗?

第 1 条附言  ·  2023 年 7 月 31 日
9 条回复
gitpushf
   1
gitpushf  
   2023 年 7 月 29 日
看用的是 poetry 还是其他了,你直接把 Github 项目链接发出来不就有人回复你了
julyclyde
   2
julyclyde  
   2023 年 7 月 29 日
你先装个 wheel 再执行那个
u823tg
   3
u823tg  
   2023 年 7 月 29 日
不发项目没发看啊。 包管理都用的 pyproject.toml 你得确定是哪个。
还有就是 windwos 下你得下载下 c++的工具链。 或者就得麻烦点找打包好的
007yxc
   4
007yxc  
OP
   2023 年 7 月 31 日
007yxc
   5
007yxc  
OP
   2023 年 7 月 31 日
项目地址我发在上面啦
@gitpushf
u823tg
   6
u823tg  
   2023 年 7 月 31 日
@007yxc #4 你运行 pip install lxml 可以装不,应该不行。 应该是没类似 windows 的 vc++那一套工具链。mac 下应该是 xcode 那一套。
007yxc
   7
007yxc  
OP
   2023 年 7 月 31 日
@u823tg lxml 安装成功了。
```
Using cached lxml-4.9.3-cp311-cp311-macosx_11_0_universal2.whl (8.6 MB)
Installing collected packages: lxml
Successfully installed lxml-4.9.3
```

我网上也尝试找了虚拟环境搭建的文章看了,但还是失败,所以有点没头绪了。
u823tg
   8
u823tg  
   2023 年 8 月 1 日
@007yxc #7 那就是 Pillow pip install 下看报错什么。 我 Windows linux 都试了下就一个小问题 requests 依赖 urlib3 的版本问题。

与虚拟环境没啥关系, 主要是 lxml 和 pillow 这类库有 c/c++代码 得要编译环境
007yxc
   9
007yxc  
OP
   2023 年 8 月 2 日
@u823tg 单独安装 Pillow 也成功了,只是 pip install -r requirements.txt 时候 告知 lxml 和 pillow 失败。 我都打算放弃了
推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
© 2026 V2EX · 27ms · 3.9.8.5