首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法安装带有pip的Azure软件包: ruamel.yaml错误

无法安装带有pip的Azure软件包: ruamel.yaml错误
EN

Stack Overflow用户
提问于 2021-11-27 16:37:37
回答 1查看 974关注 0票数 3

在Arch上的一个新python3.9.7虚拟环境中安装以下软件包有困难。

我的requirements.txt文件:

代码语言:javascript
复制
joblib
python-dotenv
azure-cli==2.29.2
azureml-core

复制步骤:

  1. python3 -m venv venv
  2. source venv/bin/activate
  3. pip install -U pip
  4. pip install -r requirements.txt

下面是最后一个命令输出的相关部分,它在试图安装ruamel.yaml时出错

代码语言:javascript
复制
Using legacy 'setup.py install' for ruamel.yaml, since package 'wheel' is not installed.
Installing collected packages: pycparser, urllib3, idna, chardet, cffi, certifi, six, requests, PyJWT, oauthlib, cryptography, requests-oauthlib, python-dateutil, isodate, azure-nspkg, wrapt, tabulate, pyyaml, PySocks, pyopenssl, PyNaCl, pygments, portalocker, msrest, msal, MarkupSafe, jmespath, colorama, bcrypt, azure-mgmt-nspkg, azure-core, argcomplete, applicationinsights, adal, websocket-client, vsts, pyparsing, pyasn1, psutil, pkginfo, pathlib2, paramiko, msrestazure, msal-extensions, knack, jinja2, jeepney, invoke, humanfriendly, deprecated, backports.weakref, azure-mgmt-datalake-nspkg, azure-mgmt-core, azure-common, azure-cli-telemetry, xmltodict, sshtunnel, semver, SecretStorage, scp, ruamel.yaml, pytz, PyGithub, pathspec, packaging, ndg-httpsclient, jsonpickle, jsondiff, javaproperties, fabric, docker, distro, contextlib2, backports.tempfile, azure-synapse-spark, azure-synapse-managedprivateendpoints, azure-synapse-artifacts, azure-synapse-accesscontrol, azure-storage-common, azure-multiapi-storage, azure-mgmt-web, azure-mgmt-trafficmanager, azure-mgmt-synapse, azure-mgmt-storage, azure-mgmt-sqlvirtualmachine, azure-mgmt-sql, azure-mgmt-signalr, azure-mgmt-servicefabricmanagedclusters, azure-mgmt-servicefabric, azure-mgmt-servicebus, azure-mgmt-security, azure-mgmt-search, azure-mgmt-resource, azure-mgmt-reservations, azure-mgmt-relay, azure-mgmt-redis, azure-mgmt-redhatopenshift, azure-mgmt-recoveryservicesbackup, azure-mgmt-recoveryservices, azure-mgmt-rdbms, azure-mgmt-privatedns, azure-mgmt-policyinsights, azure-mgmt-network, azure-mgmt-netapp, azure-mgmt-msi, azure-mgmt-monitor, azure-mgmt-media, azure-mgmt-marketplaceordering, azure-mgmt-maps, azure-mgmt-managementgroups, azure-mgmt-managedservices, azure-mgmt-loganalytics, azure-mgmt-kusto, azure-mgmt-keyvault, azure-mgmt-iothubprovisioningservices, azure-mgmt-iothub, azure-mgmt-iotcentral, azure-mgmt-imagebuilder, azure-mgmt-hdinsight, azure-mgmt-extendedlocation, azure-mgmt-eventhub, azure-mgmt-eventgrid, azure-mgmt-dns, azure-mgmt-devtestlabs, azure-mgmt-deploymentmanager, azure-mgmt-datamigration, azure-mgmt-datalake-store, azure-mgmt-datalake-analytics, azure-mgmt-databoxedge, azure-mgmt-cosmosdb, azure-mgmt-containerservice, azure-mgmt-containerregistry, azure-mgmt-containerinstance, azure-mgmt-consumption, azure-mgmt-compute, azure-mgmt-cognitiveservices, azure-mgmt-cdn, azure-mgmt-botservice, azure-mgmt-billing, azure-mgmt-batchai, azure-mgmt-batch, azure-mgmt-authorization, azure-mgmt-applicationinsights, azure-mgmt-appconfiguration, azure-mgmt-apimanagement, azure-mgmt-advisor, azure-loganalytics, azure-keyvault-keys, azure-keyvault-administration, azure-keyvault, azure-identity, azure-graphrbac, azure-functions-devops-build, azure-datalake-store, azure-cosmos, azure-cli-core, azure-batch, azure-appconfiguration, antlr4-python3-runtime, python-dotenv, joblib, azureml-core, azure-cli
    Running setup.py install for ruamel.yaml: started
    Running setup.py install for ruamel.yaml: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /home/zjeffer/Documents/school/howest-mct/semester5/mlops/labo/project/mlops-project/venv/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ouy4o2zq/ruamel-yaml_763ae0866f7e4425a0965a00130752b0/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ouy4o2zq/ruamel-yaml_763ae0866f7e4425a0965a00130752b0/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-8y_97owt/install-record.txt --single-version-externally-managed --compile --install-headers /home/zjeffer/Documents/school/howest-mct/semester5/mlops/labo/project/mlops-project/venv/include/site/python3.9/ruamel.yaml
         cwd: /tmp/pip-install-ouy4o2zq/ruamel-yaml_763ae0866f7e4425a0965a00130752b0/
    Complete output (649 lines):
    sys.argv ['/tmp/pip-install-ouy4o2zq/ruamel-yaml_763ae0866f7e4425a0965a00130752b0/setup.py', 'install', '--record', '/tmp/pip-record-8y_97owt/install-record.txt', '--single-version-externally-managed', '--compile', '--install-headers', '/home/zjeffer/Documents/school/howest-mct/semester5/mlops/labo/project/mlops-project/venv/include/site/python3.9/ruamel.yaml']
    test compiling test_ruamel_yaml
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.9
    creating build/lib.linux-x86_64-3.9/ruamel
    copying .ruamel/__init__.py -> build/lib.linux-x86_64-3.9/ruamel
    creating build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./main.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./util.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./tokens.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./scalarfloat.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./scanner.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./comments.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./loader.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./serializer.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./resolver.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./nodes.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./dumper.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./configobjwalker.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./timestamp.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./error.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./reader.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./cyaml.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./parser.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./__init__.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./representer.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./events.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./scalarbool.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./composer.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./scalarint.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./emitter.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./anchor.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./compat.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./constructor.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./scalarstring.py -> build/lib.linux-x86_64-3.9/ruamel/yaml
    copying ./LICENSE -> build/lib.linux-x86_64-3.9/ruamel/yaml
    running build_ext
    building '_ruamel_yaml' extension
    creating build/temp.linux-x86_64-3.9
    creating build/temp.linux-x86_64-3.9/ext
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fno-semantic-interposition -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -I/home/zjeffer/Documents/school/howest-mct/semester5/mlops/labo/project/mlops-project/venv/include -I/usr/include/python3.9 -c ext/_ruamel_yaml.c -o build/temp.linux-x86_64-3.9/ext/_ruamel_yaml.o
    In file included from ext/_ruamel_yaml.c:523:
    ext/_ruamel_yaml.h:10: warning: "PyString_CheckExact" redefined

<a whole bunch of compiling errors & warnings>

完整的日志文件可以找到这里

注意行Using legacy 'setup.py install' for ruamel.yaml, since package 'wheel' is not installed.。如果我第一次安装wheel包,安装包时也会出现相同的错误。

手动安装ruamel.yaml很好,但蓝包仍然无法安装。

编辑:一个接一个地安装每个包,不会出现任何错误。为什么?

将步骤3改为pip install -U pip wheel ruamel.yaml并不会改变任何事情。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-11-27 16:53:17

ruamel.yaml 文档声明应该使用以下方法安装它:

代码语言:javascript
复制
pip install ruamel.yaml

因此,不应该使用遗留的[python] setup.py install

您的完整日志表明它试图安装两个版本的ruamel.yaml:

代码语言:javascript
复制
Collecting ruamel.yaml<=0.17.16,>=0.17.10
Using cached ruamel.yaml-0.17.16-py3-none-any.whl (109 kB)

代码语言:javascript
复制
Collecting ruamel.yaml<=0.15.89,>=0.15.35
Using cached ruamel.yaml-0.15.89.tar.gz (306 kB)

除了安装两个版本可能出现的问题外,第二个版本不会成功,因为0.15 ruamel.yaml系列(最后一个在2019年7月上传到PyPI上)不支持Python3.9在2020年10月首次发布。

因此,当您一步一步地安装每个包时,您将得到最新版本或ruamel.yaml。为什么一步一步的安装并没有尝试将ruamel.yaml==0.15.89作为依赖项来安装,目前还不清楚。

当我安装requirements.txt中列出的四个包时,ruamel.yaml不会安装,但是pipdeptree表示azureml-core==1.36.0.post2可能存在冲突的依赖关系。

当我使用您的requirements.txt时,我会得到相同的错误。

当我在Python3.7 requirements.txt中使用您的venv时(以便可以安装旧的ruamel.yaml轮毂),安装就可以工作了。由此可以看出,包azureml-core==1.14.0是安装的,而不是azureml-core==1.36.0.post2

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70136750

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档