Error installing pyvmomi

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
jorgeaaq
Posts: 25
Joined: Mon Jul 25, 2016 9:39 pm
Location: Mexico
Contact:

Error installing pyvmomi

Post by jorgeaaq »

I just install nagiosxi

when try to monitor VMWARE using the new plugin, got an error installing pyvmomi python module

OS: CentOS Stream release 9
OS: Linux nagiosxi 5.14.0-480.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 12 20:45:27 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

This works ok
----------------------------------
python3 -m pip install --upgrade pip
Requirement already satisfied: pip in /usr/local/lib/python3.9/site-packages (24.2)

python3 -m pip install --upgrade setuptools wheel
Requirement already satisfied: setuptools in /usr/local/lib/python3.9/site-packages (72.1.0)
Requirement already satisfied: wheel in /usr/local/lib/python3.9/site-packages (0.44.0)
-------------------------------------

This does not work
-----------------------------

python3 -m pip install --upgrade pyvmomi

The error.....


Collecting pyVmomi
Using cached pyvmomi-8.0.3.0.1.tar.gz (1.2 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [47 lines of output]
/usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py:268: UserWarning: Unknown distribution option: 'test_suite'
warnings.warn(msg)
/usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py:268: UserWarning: Unknown distribution option: 'tests_require'
warnings.warn(msg)
running egg_info
creating /tmp/pip-pip-egg-info-7egm9k6h/pyvmomi.egg-info
writing /tmp/pip-pip-egg-info-7egm9k6h/pyvmomi.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-7egm9k6h/pyvmomi.egg-info/dependency_links.txt
writing requirements to /tmp/pip-pip-egg-info-7egm9k6h/pyvmomi.egg-info/requires.txt
writing top-level names to /tmp/pip-pip-egg-info-7egm9k6h/pyvmomi.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-7egm9k6h/pyvmomi.egg-info/SOURCES.txt'
reading manifest file '/tmp/pip-pip-egg-info-7egm9k6h/pyvmomi.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'py.typed'
warning: no files found matching '*' under directory 'sample'
adding license file 'LICENSE.txt'
adding license file 'NOTICE.txt'
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-qrfzps_2/pyvmomi_eb551e3266b44268b27be8d1df5a64d9/setup.py", line 46, in <module>
setup(
File "/usr/local/lib/python3.9/site-packages/setuptools/__init__.py", line 108, in setup
return distutils.core.setup(**attrs)
File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 184, in setup
return run_commands(dist)
File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
dist.run_commands()
File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 970, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python3.9/site-packages/setuptools/dist.py", line 945, in run_command
super().run_command(command)
File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 989, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 310, in run
self.find_sources()
File "/usr/local/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 318, in find_sources
mm.run()
File "/usr/local/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 544, in run
self.prune_file_list()
File "/usr/local/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 610, in prune_file_list
base_dir = self.distribution.get_fullname()
File "/usr/local/lib/python3.9/site-packages/setuptools/_core_metadata.py", line 266, in get_fullname
return _distribution_fullname(self.get_name(), self.get_version())
File "/usr/local/lib/python3.9/site-packages/setuptools/_core_metadata.py", line 284, in _distribution_fullname
canonicalize_version(version, strip_trailing_zero=False),
TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'
[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.



ANY IDEAS HOW RESOLVE THIS?

thanks in advance
Jorge Arenas
kg2857
Posts: 499
Joined: Wed Apr 12, 2023 5:48 pm

Re: Error installing pyvmomi

Post by kg2857 »

Might want to search the internet for python, pip and the error message.
This isn't a nagios issue.
rcoxe
Posts: 1
Joined: Fri Apr 15, 2022 10:13 am

Re: Error installing pyvmomi

Post by rcoxe »

Needed to reinstall nagioxi to move from centos 7 to centos 9
Fresh install of the nagioxi ova virtual machine.
Restored the backup of the centos 7 version of nagiosxi. Could not install pyvmomi per your post

My fix/workaround was to install pyvmomi using yum.
yum install python3-pyvmomi
version 7.0.3 was installed

[root@localhost pip]# yum info python-pyvmomi
Last metadata expiration check: 0:08:49 ago on Thu 08 Aug 2024 08:52:33 AM CDT.
Error: No matching Packages to list
[root@localhost pip]# yum info python3-pyvmomi
Last metadata expiration check: 0:09:23 ago on Thu 08 Aug 2024 08:52:33 AM CDT.
Installed Packages
Name : python3-pyvmomi
Version : 7.0.3
Release : 6.el9
Architecture : noarch
Size : 2.8 M
Source : python-pyvmomi-7.0.3-6.el9.src.rpm
Repository : @System
From repo : epel
Summary : vSphere SDK for Python3
URL : https://github.com/vmware/pyvmomi
License : Apache-2.0
Description : pyVmomi is the Python SDK for the vSphere API that allows you to manage
: ESX, ESXi, and vCenter.

All of my vmware checks worked after updating the plug-ins using this document
https://answerhub.nagios.com/support/s/ ... are-Wizard
bbahn
Posts: 385
Joined: Thu Jan 12, 2023 5:42 pm

Re: Error installing pyvmomi

Post by bbahn »

Hello @rcoxe,

Glad to hear you found a successful work-around. Since you found a solution, I will lock this thread.
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
cnorell
Developer
Posts: 141
Joined: Mon Nov 27, 2017 3:08 pm

Re: Error installing pyvmomi

Post by cnorell »

I'm going to reopen this thread, only because @rcoxe was not the original poster.

@jorgeaaq, did the fix that worked for @rcoxe work for you? Seems like a good solution.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jorgeaaq
Posts: 25
Joined: Mon Jul 25, 2016 9:39 pm
Location: Mexico
Contact:

Re: Error installing pyvmomi

Post by jorgeaaq »

Hi

I found the solution for rcoxe viable but, that option give me a very old version of the module pyvmomi, but is the only RPM version provided and is ok

Now, I post the question here because, I follow the commands that nagios xi web interface show as prerequisites and expect some kind of testing from nagios xi before post the commands in the interface

Now, my solution to make work the guide and commands of nagios xi web was:


I found that there is a problem was the version of setuptools

when the setup of pyvmovi calls setup.py

"pyvmomi_eb551e3266b44268b27be8d1df5a64d9/setup.py"

the setuptools version 72.1 returns two values from /setuptools/_core_metadata.py

"canonicalize_version(version, strip_trailing_zero=False)"

and the pyvmovi setup.py only expect 1 value "version" and not expect "strip_trailing_zero=False"

I am checking on some sites and found that some changes in setuptools above 70 have some incompatibilities with several projects

I just change the function canonicalize_version to return one value, "version" and remove the second

"canonicalize_version(version)"

after that, the installation works and the app is working

obviously, this is only works in this case... I am going to put a request in the site of the project pyvmovi with this incompatibility with setuptools above 70 so they can develop a more comprehensive and complete solution

for the moment with versions

pyvmomi-8.0.3.0.1 with setuptools-72.1.0

this change make the installation possible

Note: I return the original line of two values in _core_metadata.py because the 2 values could be expected on other apps

Jorge Arenas
cnorell
Developer
Posts: 141
Joined: Mon Nov 27, 2017 3:08 pm

Re: Error installing pyvmomi

Post by cnorell »

jorgeaaq,

Good, I'm glad to hear you found a solution, and thank you for the write up; it may help others in the future.

Just to be absolutely clear - did you have to do anything on the Nagios XI side? If there is something we can improve, I'd like to do so.

Best Regards,

Cory Norell
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jorgeaaq
Posts: 25
Joined: Mon Jul 25, 2016 9:39 pm
Location: Mexico
Contact:

Re: Error installing pyvmomi

Post by jorgeaaq »

cnorell

in strict sense , there is nothing wrong in nagiosxi ...

but maybe, as long as the problem in the pyvmomi module is not corrected with the new version of setuptools, I see three possible solutions

1.- the least recommended, would be to remove the new nagios xi wizard and plugin, as long as the situation is not corrected

2.- another more appropriate option is to change the instructions so that the wizard dependencies are not installed through PIP but with RPM as suggested by rcoxe, they are outdated but functional versions

3.- change the instructions to force pip to install a lower version of setuptools that is compatible with the pyvmomi module... I am not an expert in this but in pip install you can define the specific version of setuptools and in that way the latest version is not installed, but the version that is compatible with the module pyvmomi

I mention this because even though we know that the module is not part of nagios xi, people see the instructions on screen of nagios xi app, when they run the wizard and execute them as mentioned there... and at this moment (August 2024) those instructions do not work and do not allow the use of the wizard/plugin

that are my ideas

Jorge Arenas
cnorell
Developer
Posts: 141
Joined: Mon Nov 27, 2017 3:08 pm

Re: Error installing pyvmomi

Post by cnorell »

jorgeaaq,

Thank you for the feedback. I'll open an issue internally to improve the instructions / user experience surrounding pyvmomi and the VMWare plugin/wizard.

Best Regards,

Cory Norell
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
sgardil
Posts: 355
Joined: Wed Aug 09, 2023 9:58 am

Re: Error installing pyvmomi

Post by sgardil »

jorgeaaq wrote: Fri Aug 09, 2024 11:50 am cnorell

in strict sense , there is nothing wrong in nagiosxi ...

but maybe, as long as the problem in the pyvmomi module is not corrected with the new version of setuptools, I see three possible solutions

1.- the least recommended, would be to remove the new nagios xi wizard and plugin, as long as the situation is not corrected

2.- another more appropriate option is to change the instructions so that the wizard dependencies are not installed through PIP but with RPM as suggested by rcoxe, they are outdated but functional versions

3.- change the instructions to force pip to install a lower version of setuptools that is compatible with the pyvmomi module... I am not an expert in this but in pip install you can define the specific version of setuptools and in that way the latest version is not installed, but the version that is compatible with the module pyvmomi

I mention this because even though we know that the module is not part of nagios xi, people see the instructions on screen of nagios xi app, when they run the wizard and execute them as mentioned there... and at this moment (August 2024) those instructions do not work and do not allow the use of the wizard/plugin

that are my ideas

Jorge Arenas
Thanks for the input. It seems to be an issue where pip isnt finding the package correctly however installing via yum or dnf like mentioned above seems to work. We took your advice and in an up coming release there is additions to the instructions mentioning if pip is failing to install the package via yum or dnf.
Post Reply