vsphere-automation-sdk-python
vsphere-automation-sdk-python copied to clipboard
Deprecation warnings from setuptools
Describe the bug
vmware/vapi/vsphere/__init__.py:5
/root/.pyenv/versions/3.11.2/lib/python3.11/site-packages/vmware/vapi/vsphere/__init__.py:5: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('vmware.vapi.vsphere')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
pkg_resources.declare_namespace(__name__)
Reproduction steps
- Install latest SDK:
pip install --upgrade git+https://github.com/vmware/vsphere-automation-sdk-python.git - Run code that uses the SDK.
Expected behavior
No warnings.
Additional context
No response
Hi @sodul As of setuptools v67.3.0 the use of "pkg_resources.declare_namespace" method raises deprecation warning. Our Python SDK uses setuptools v62.0.0 as mentioned in requirements.txt We highly recommend following our installation guide - https://github.com/vmware/vsphere-automation-sdk-python#quick-start-guide
@aagrawal3 we have other dependencies that cannot install with setuptools v62.0.0. Our workaround is to install the sdk first and then our stack on top and ignore what the SDK claims in its requirements.
This is still a forward compatibility bug and I believe the SDK should be fixed to work with newer versions of setuptools.
@aagrawal3 I have the same problem. Even I rollback my python to 3.6.x, it also tells me the setuptools have an error, and can't collect it from pip official site. When I manually download it to install, it tells me that "future feature annotations is not defined".