0

I have python 3.10 code running from some time, and now, it started getting me errors while importing the libraries, without any modification in the code.

For example, from this line:

 from azure.keyvault.secrets import SecretClient

I get this error;

    from azure.keyvault.secrets import SecretClient
ImportError: cannot import name 'SecretClient' from partially initialized module 'azure.keyvault.secrets' (most likely due to a circular import) (C:\Users\myself\AppData\Local\Programs\Python\Python310\lib\site-packages\azure\keyvault\secrets\__init__.py)

The library was installed using:

pip install azure-keyvault

Any idea what could be the problem? I tried uninstalling and installing the library again, but I still get the errors...

Thanks Gus

Gus Sabina
  • 189
  • 1
  • 13
  • Does this answer your question? https://stackoverflow.com/a/60677039/5217293 – K. Shores Oct 26 '22 at 18:13
  • 1
    Absolutely! I read many answers but I overlooked this one... The key is "This can happen when there's a local file with the same name as an imported module – Python sees the local file and thinks it's the module." So changing my script file name, solved the problem.... Thanks! – Gus Sabina Oct 26 '22 at 21:55

1 Answers1

0

azure-keyvault is deprecated.

Please uninstall azure-keyvault and use pip install azure-keyvault-secrets.

(I work in MS in the SDK team)

Xiang Yan
  • 194
  • 6