如何安装python的azure.storage.blob库?

发布于 2025-01-22 18:43:39 字数 1797 浏览 2 评论 0原文

从azure.storage.blob库导入blobserviceclient和blobclient时,我有问题。我知道我的问题与版本发生冲突有关。我能够使用PIP安装库,但后来我显示了第一个问题(1/)。当我尝试使用conda安装库(管理版本)时,我会有第二个错误(2/)。

注意: a)我试图在其他问题中提到的那样安装/卸载库。 b)我试图更改Python版本,我测试了Python 3.7,Python 3.8和Python 3.10,没有任何成功。

非常感谢您的帮助!

Blandine


------------------------ 1/使用PIP安装库时的错误消息

----------------------------------------------------- C:\ Windows \ System32> Python Python 3.8.8(默认,4月13日2021,15:08:03)[MSC V.1916 64 BIT(AMD64)] :: Anaconda,Inc。win32

警告: 这个python的口译员处于康达环境中,但是环境有 未被激活。库可能无法加载。激活这个环境 请参阅 https://conda.io/activation

“许可”以获取更多信息。

azure-storage-blob Trackback(最近的最新电话): 文件“”,第1行,在 名称:未定义的名称“ azure” 来自azure.storage.blob导入blobserviceclient Trackback(最近的最新电话): 文件“”,第1行,在 Importerror:无法从'azure.storage.blob'导入名称'BlobServiceClient'(c:\ users \ dbl1dy \ anaconda3 \ lib \ lib \ lib \ site-packages \ azure \ azure \ azure \ azure \ store /p>


- ----------------------- 2/与Conda安装库时的错误消息

---------------------------------------------强>(Python37)C:\ Windows \ System32> conda安装Azure 收集软件包元数据(current_repodata.json):完成 解决环境:初始冷冻解决方案失败。用灵活的求解重试。 解决环境:current_repodata.json的repodata失败,将使用下一个repodata源重试。 收集包装元数据(Repodata.json):完成 解决环境:初始冷冻解决方案失败。用灵活的求解重试。 解决环境: - 发现冲突!寻找不兼容的软件包。 这可能需要几分钟。按CTRL-C中止。
失败的

不满意:发现以下规格 与您的环境中现有的Python安装不兼容:

规格:

  • Azure-> [version ='> = 2.7,< 2.8.0a0 |> = 3.5,< 3.6.0a0 |> = 3.6,< 3.7.0a0a0'

python

]链的最左侧是您要的版本。 当python出现在右边时,这表明左边的东西是某种程度上 您不适合您的Python版本。请注意,康达不会 除非您明确指定,否则将Python版本更改为其他次要版本 那。

I have issues while importing BlobServiceClient and BlobClient from azure.storage.blob library. I understood that my issue was related whith a conflict on versions. I am able to install the library with pip but then I have the first issue shown (1/). And when I try to install the library with conda (to manage the versions) I have the second error (2/).

Notes :
A) I tried to install/uninstall the library as mentionned in the other questions.
B) I tried to change the python version, I tested python 3.7, python 3.8 and python 3.10 without any success.

Thank you very much for your help !

Blandine


------------------- 1/ Error message when having installed the librairy with pip ----------------

C:\WINDOWS\system32>python
Python 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation

Type "help", "copyright", "credits" or "license" for more information.

azure-storage-blob
Traceback (most recent call last):
File "", line 1, in
NameError: name 'azure' is not defined
from azure.storage.blob import BlobServiceClient
Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name 'BlobServiceClient' from 'azure.storage.blob' (C:\Users\DBL1DY\Anaconda3\lib\site-packages\azure\storage\blob_init_.py)


------------------- 2/ Error message when installing the library with conda ---------------------

(python37) C:\WINDOWS\system32>conda install azure
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  • azure -> python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0']

Your python: python=3.7

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北陌 2025-01-29 18:43:39

规格:•azure-&gt;
Python [version ='&gt; = 2.7,&lt; 2.8.0a0 |&gt; = 3.5,&lt; 3.6.0a0 |&gt; = 3.6,&lt; 3.7.0a0a0']
Python:Python = 3.7

如以上错误中清楚地提到的,Python版本应小于3.7

请尝试Python版本3.63.5 代码> 2.8 或2.7

Specifications: • azure ->
python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0'] Your
python: python=3.7

As clearly mentioned in the above error, Python version should be less than 3.7

Please try Python version 3.6 or 3.5 or 2.8 or 2.7

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文