infiniflow / ragflow

RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine based on deep document understanding.
https://ragflow.io
Apache License 2.0
24.62k stars 2.39k forks source link

[Question]: pip install azure failed #2769

Open yangboz opened 1 month ago

yangboz commented 1 month ago

Describe your problem

Starting with v5.0.0, the 'azure' meta-package is deprecated and cannot be installed anymore. Please install the service specific packages prefixed by azure needed for your application.

  The complete list of available packages can be found at:
  https://aka.ms/azsdk/python/all

  Here's a non-exhaustive list of common packages:

  -  azure-mgmt-compute (https://pypi.python.org/pypi/azure-mgmt-compute) : Management of Virtual Machines, etc.
  -  azure-mgmt-storage (https://pypi.python.org/pypi/azure-mgmt-storage) : Management of storage accounts.
  -  azure-mgmt-resource (https://pypi.python.org/pypi/azure-mgmt-resource) : Generic package about Azure Resource Management (ARM)
  -  azure-keyvault-secrets (https://pypi.python.org/pypi/azure-keyvault-secrets) : Access to secrets in Key Vault
  -  azure-storage-blob (https://pypi.python.org/pypi/azure-storage-blob) : Access to blobs in storage accounts

  A more comprehensive discussion of the rationale for this decision can be found in the following issue:
  https://github.com/Azure/azure-sdk-for-python/issues/10646

  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

any idea? thanks.

KevinHuSh commented 1 month ago

image What about installing by poetry? poetry install --sync --no-root;

yangboz commented 1 month ago

tried but it thrown errors as following:

Current Python version (3.11.0) is not allowed by the project (>=3.12,<3.13).
Please change python executable via the "env use" command.
yangboz commented 1 month ago

even using py312 , pip3 install azure ,though it throwing errors as following:

super().run_setup(setup_script=setup_script)
        File "/private/var/folders/qx/4xlthzrn7qd91s31fn7pmb4m0000gp/T/pip-build-env-atyornk_/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 318, in run_setup
          exec(code, locals())
        File "<string>", line 60, in <module>
      RuntimeError:

      Starting with v5.0.0, the 'azure' meta-package is deprecated and cannot be installed anymore.
      Please install the service specific packages prefixed by `azure` needed for your application.

      The complete list of available packages can be found at:
      https://aka.ms/azsdk/python/all

      Here's a non-exhaustive list of common packages:

      -  azure-mgmt-compute (https://pypi.python.org/pypi/azure-mgmt-compute) : Management of Virtual Machines, etc.
      -  azure-mgmt-storage (https://pypi.python.org/pypi/azure-mgmt-storage) : Management of storage accounts.
      -  azure-mgmt-resource (https://pypi.python.org/pypi/azure-mgmt-resource) : Generic package about Azure Resource Management (ARM)
      -  azure-keyvault-secrets (https://pypi.python.org/pypi/azure-keyvault-secrets) : Access to secrets in Key Vault
      -  azure-storage-blob (https://pypi.python.org/pypi/azure-storage-blob) : Access to blobs in storage accounts

      A more comprehensive discussion of the rationale for this decision can be found in the following issue:
      https://github.com/Azure/azure-sdk-for-python/issues/10646
yangboz commented 1 month ago

head to git clone https://github.com/Azure/azure-sdk-for-python.git to manually install it to see what it will happen.

KevinHuSh commented 1 month ago

I guess the solution might be on stackoverflow.

yangboz commented 1 month ago

─ azure 1.0.2 would require │ │ └─ python >=3.5,<3.6.0a0 , which can be installed; │ ├─ azure 1.0.2 would require │ │ └─ python >=3.6,<3.7.0a0 , which can be installed; │ ├─ azure [0.10.0|0.10.2|0.11.0|0.11.1] would require │ │ └─ python 3.3 , which can be installed; │ └─ azure 1.0.2 would require │ └─ python 3.6 , which can be installed; └─ pin-1 is not installable because it requires └─ python 3.12.* , which conflicts with any installable versions previously reported.

Pins seem to be involved in the conflict. Currently pinned specs:

yangboz commented 1 month ago

and after pip install azure==4.0.0 or https://stackoverflow.com/questions/66465277/installing-azure-in-python it throws:

from azure.storage.blob import ContainerClient ImportError: cannot import name 'ContainerClient' from 'azure.storage.blob' (/Users/yangboz/anaconda3/envs/ragflow/lib/python3.11/site-packages/azure/storage/blob/init.py)

yangboz commented 1 month ago

and azure-mgmt-storage, azure-storage-file-datalake, psycopg2-binary,boto3, yfinance,pywencai... got

File "/Users/yangboz/git/ragflow/api/apps/__init__.py", line 84, in register_page
    spec.loader.exec_module(page)
  File "/Users/yangboz/git/ragflow/api/apps/document_app.py", line 216
    doc_item['thumbnail'] = f'/v1/document/image/{kb_id}-{doc_item['thumbnail']}'
                                                                    ^^^^^^^^^
SyntaxError: f-string: unmatched '['
yangboz commented 1 month ago

it should be doc_item['thumbnail'] = f"/v1/document/image/{kb_id}-{doc_item['thumbnail']}"