简体   繁体   English

从 requirements.txt 中安装 Wheel

[英]Wheel installation from within requirements.txt

I'm trying to configure my requirements.txt which is the following:我正在尝试配置我的requirements.txt如下:

wheel
apache-airflow

I created python3.8 -m venv ~/test-env and tried to do the installation.我创建了python3.8 -m venv ~/test-env并尝试进行安装。 The problem is问题是

python -m pip install -r requirements.txt

produces tons of messages产生大量信息

error: invalid command 'bdist_wheel'                                                                                                                                                                                            

----------------------------------------                                                                                                                                                                                        
Failed building wheel for thrift        

I made sure that wheel is installed when doing requirements.txt installation:我确保在安装requirements.txt时安装了wheel

Collecting wheel (from -r requirements.txt (line 1))                                                                                                                                                                              
Using cached https://files.pythonhosted.org/packages/00/83/b4a77d044e78ad1a45610eb88f745be2fd2c6d658f9798a15e384b7d57c9/wheel-0.33.6-py2.py3-none-any.

But if I install it separately但是如果我单独安装它

python -m pip install wheel
python -m pip install -r requirements

it works fine and the python -m pip -r requirements finishes with no error messages.它工作正常并且python -m pip -r requirements完成时没有错误消息。

So isn't it possible to put wheel installation into requirements.txt ?那么是不是可以将wheel安装到requirements.txt中? What is the proper way to deal with it when installing into venv ?安装到venv时处理它的正确方法是什么? To install it before requirements.txt installation?requirements.txt安装之前安装它?

I believe this happens with older versions of pip .我相信旧版本的pip会发生这种情况。 For example in my quick tests it happens with pip 9.0.1 which is delivered by default with Python 3.6 's ensurepip standard library, but doesn't happen once pip is updated to 19.2.3 which as far as I know should be bundled with Python 3.8 .例如,在我的快速测试中,它发生在pip 9.0.1上,它默认与Python 3.6ensurepip标准库一起提供,但是一旦pip更新到19.2.3就不会发生,据我所知应该与蟒蛇 3.8 You seem to be using Python 3.8 so I'm confused by the fact that you encounter this error.您似乎正在使用 Python 3.8,所以我对您遇到此错误这一事实感到困惑。 Anyway this error, shouldn't effectively block the actual installation of the requirements.无论如何这个错误,不应该有效地阻止实际安装的要求。

If possible I'd recommend updating pip:如果可能的话,我建议更新 pip:

python -m pip install --upgrade pip

before installing the requirements:安装要求之前:

python -m pip install --requirement requirements.txt

Installing wheel (or updating pip ) from within the requirements file is not useful in this case.在这种情况下,从需求文件中安装wheel (或更新pip )是没有用的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM