Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to install by poetry. #326

Closed
aragorn1025 opened this issue Jul 25, 2022 · 9 comments
Closed

Fail to install by poetry. #326

aragorn1025 opened this issue Jul 25, 2022 · 9 comments

Comments

@aragorn1025
Copy link

Describe the bug

I have tried to add and install vsphere-automation-sdk-python by using poetry.

poetry add "git+https://github.com/vmware/vsphere-automation-sdk-python.git"

However, the following error was raised:

Creating virtualenv mavis in /Users/user/Documents/project/.venv

Updating dependencies
Resolving dependencies... (37.0s)

  RuntimeError

  Unable to retrieve the package version for None

  at ~/.poetry/lib/poetry/inspection/info.py:143 in to_package
      139│         name = name or self.name
      140│
      141│         if not self.version:
      142│             # The version could not be determined, so we raise an error since it is mandatory.
    → 143│             raise RuntimeError(
      144│                 "Unable to retrieve the package version for {}".format(name)
      145│             )
      146│
      147│         package = Package(

As a result, I checked the requirements.txt and find out that if I add vapi-client-bindings==3.9.0, I get the same error message.

  ValueError

  Could not find a matching version of package vapi-client-bindings

  at ~/.poetry/lib/poetry/console/commands/init.py:367 in _find_best_version_for_package
      363│         )
      364│
      365│         if not package:
      366│             # TODO: find similar
    → 367│             raise ValueError(
      368│                 "Could not find a matching version of package {}".format(name)
      369│             )
      370│
      371│         return package.pretty_name, selector.find_recommended_require_version(package)

Reproduction steps

- Run poetry add.
  
  poetry add "git+https://github.com/vmware/vsphere-automation-sdk-python.git"

Expected behavior

Expected to install successful without error raised.

Additional context

No response

@aagrawal3
Copy link
Contributor

Installation using Poetry is currently not tested/supported.

@ttanigaki
Copy link

@aragorn1025

I hit the same issue. I can avoid it by the following command

poetry run pip install -U pip setuptools
poetry run pip install --upgrade git+https://github.com/vmware/vsphere-automation-sdk-python.git

@wonderphil
Copy link

Any chance of getting this to be supported??

@jobingeo
Copy link
Contributor

Any chance of getting this to be supported??

Sorry! Not in immediate future. I'm closing this issue as not planned.

Can you please try the workaround mentioned by @ttanigaki and see if it helps?

@jobingeo
Copy link
Contributor

Closing this, as there is no near term plan to fix this issue.

@aragorn1025
Copy link
Author

aragorn1025 commented Aug 24, 2022

@ttanigaki
Thank you for the solution.

@jobingeo
There's another question about requirements.txt. I saw there's a dependent module that can't be downloaded. (I guess this cause error for poetry add.)

vapi-client-bindings == 3.9.0

I search this module and found out that I can only get the newer one. (link here)

vapi-client-bindings == 7.0.0

Will this have any effect?

@jobingeo
Copy link
Contributor

I search this module and found out that I can only get the newer one. (link here)

vapi-client-bindings == 7.0.0

Will this have any effect?

The vapi-client-bindings lib you see in pypi repo is a dummy one. We just reserved it in PyPi for the future onboarding of SDK libs. For now, please don't rely on these libs from PyPi. Please use these libs locally following the SDK installation instruction here.
From above error stack/comments, It seems this could have a potential impact here.

@arthurzenika
Copy link

Maybe this can be useful for other poetry users.

For me, with poetry 1.3 I can do poetry add https://github.com/vmware/vsphere-automation-sdk-python/archive/refs/tags/v8.0.0.1.tar.gz which works.

For poetry 1.1 I have to do add all the dependencies using poetry add https://github.com/vmware/vsphere-automation-sdk-python/archive/refs/tags/v8.0.0.1.tar.gz https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/nsx-policy-python-sdk/nsx_policy_python_sdk-4.0.1.0.0-py2.py3-none-any.whl https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/nsx-python-sdk/nsx_python_sdk-4.0.1.0.0-py2.py3-none-any.whl https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/nsx-vmc-aws-integration-python-sdk/nsx_vmc_aws_integration_python_sdk-4.0.1.0.0-py2.py3-none-any.whl https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/nsx-vmc-policy-python-sdk/nsx_vmc_policy_python_sdk-4.0.1.0.0-py2.py3-none-any.whl https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/vapi-client-bindings/vapi_client_bindings-4.0.0-py2.py3-none-any.whl https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/vapi-common-client/vapi_common_client-2.37.0-py2.py3-none-any.whl https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/vapi-runtime/vapi_runtime-2.37.0-py2.py3-none-any.whl https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/vmc-client-bindings/vmc_client_bindings-1.61.0-py2.py3-none-any.whl https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/vmc-draas-client-bindings/vmc_draas_client_bindings-1.20.0-py2.py3-none-any.whl

In my pyproject.toml I get :

[tool.poetry.dependencies]
# vsphere-automation-sdk work around
vsphere-automation-sdk = {url = "https://github.com/vmware/vsphere-automation-sdk-python/archive/refs/tags/v8.0.0.1.tar.gz"}
vmc-draas-client-bindings = {url = "https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/vmc-draas-client-bindings/vmc_draas_client_bindings-1.20.0-py2.py3-none-any.whl"}
vapi-runtime = {url = "https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/vapi-runtime/vapi_runtime-2.37.0-py2.py3-none-any.whl"}
vapi-common-client = {url = "https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/vapi-common-client/vapi_common_client-2.37.0-py2.py3-none-any.whl"}
nsx-policy-python-sdk = {url = "https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/nsx-policy-python-sdk/nsx_policy_python_sdk-4.0.1.0.0-py2.py3-none-any.whl"}
nsx-python-sdk = {url = "https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/nsx-python-sdk/nsx_python_sdk-4.0.1.0.0-py2.py3-none-any.whl"}
nsx-vmc-aws-integration-python-sdk = {url = "https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/nsx-vmc-aws-integration-python-sdk/nsx_vmc_aws_integration_python_sdk-4.0.1.0.0-py2.py3-none-any.whl"}
nsx-vmc-policy-python-sdk = {url = "https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/nsx-vmc-policy-python-sdk/nsx_vmc_policy_python_sdk-4.0.1.0.0-py2.py3-none-any.whl"}
vapi-client-bindings = {url = "https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/vapi-client-bindings/vapi_client_bindings-4.0.0-py2.py3-none-any.whl"}
vmc-client-bindings = {url = "https://github.com/vmware/vsphere-automation-sdk-python/raw/master/lib/vmc-client-bindings/vmc_client_bindings-1.61.0-py2.py3-none-any.whl"}

@AnatomicJC
Copy link

For those interested, I added a script in this related issue to generate this dependency list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants