gpt4 book ai didi

azure - 无法安装 Azure 包并出现 pip : ruamel. yaml 错误

转载 作者:行者123 更新时间:2023-12-05 04:41:08 27 4
gpt4 key购买 nike

我在 Arch Linux 上的新 python 3.9.7 虚拟环境中安装以下软件包时遇到问题。

我的requirements.txt文件:

joblib
python-dotenv
azure-cli==2.29.2
azureml-core

重现步骤:

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

这是最后一个命令输出的相关部分,尝试安装ruamel.yaml时出错:

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>

可以找到完整的日志文件 here

请注意行Using Legacy 'setup.py install' for ruamel.yaml,因为未安装包“wheel”。。如果我首先安装 wheel 软件包,安装软件包时会出现相同的错误。

手动安装 ruamel.yaml 工作正常,但 azure 软件包仍然无法安装。

编辑:逐一安装每个软件包可以安装所有内容,不会出现错误。为什么?

将步骤 3 更改为 pip install -U pipwheel ruamel.yaml 不会改变任何内容。

最佳答案

ruamel.yaml documentation指出应该使用以下方式安装它:

pip install ruamel.yaml

所以使用遗留的[python] setup.py install不应该使用。

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

Collecting ruamel.yaml<=0.17.16,>=0.17.10
Using cached ruamel.yaml-0.17.16-py3-none-any.whl (109 kB)

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)不支持 2020 年 10 月首次发布的 Python 3.9。

因此,当您逐步安装每个包时,您将获得最新版本或 ruamel.yaml。为什么某些软件包尝试安装时无法进行逐步安装 ruamel.yaml==0.15.89因为依赖关系不清楚。

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

当我使用你的requirements.txt时我也遇到同样的错误。

当我使用你的requirements.txt时在Python 3.7 venv (以便可以安装旧的 ruamel.yaml 轮)安装工作。从中您可以看到包 azureml-core==1.14.0安装而不是 azureml-core==1.36.0.post2

关于azure - 无法安装 Azure 包并出现 pip : ruamel. yaml 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70136750/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com