DMTF / Redfishtool

A Python34 program that implements a command line tool for accessing the Redfish API.
Other
224 stars 68 forks source link

While running redfishtool, i am getting No module named redfishtoollib but installed all necessary packages #101

Closed Ganesan149 closed 2 months ago

Ganesan149 commented 1 year ago

lab@lab-Precision-5510-lab3:~/ganesan/Redfish-Usecase-Checkers$ redfishtool Traceback (most recent call last): File "/usr/local/bin/redfishtool", line 14, in from redfishtoollib import main ImportError: No module named redfishtoollib

While running redfishtool i am getting No module named redfishtoollib

mraineri commented 1 year ago

What's the output of the following?

pip3 show redfishtool -f
Ganesan149 commented 1 year ago

lab@lab-Precision-5510-lab3:~/ganesan/Redfish-Usecase-Checkers$ pip3 show redfishtool -f

Name: redfishtool

Version: 1.1.5

Summary: Redfishtool package and command-line client

Home-page: https://github.com/DMTF/Redfishtool

Author: DMTF, https://www.dmtf.org/standards/feedback

Author-email:

License: BSD 3-clause "New" or "Revised License"

Location: /usr/local/lib/python3.6/dist-packages

Requires: python-dateutil, requests

Required-by:

Files:

../../../bin/pycache/redfishtool.cpython-36.pyc

../../../bin/redfishtool

../../../bin/redfishtool.py

redfishtool-1.1.5.dist-info/DESCRIPTION.rst

redfishtool-1.1.5.dist-info/INSTALLER

redfishtool-1.1.5.dist-info/METADATA

redfishtool-1.1.5.dist-info/RECORD

redfishtool-1.1.5.dist-info/REQUESTED

redfishtool-1.1.5.dist-info/WHEEL

redfishtool-1.1.5.dist-info/metadata.json

redfishtool-1.1.5.dist-info/top_level.txt

redfishtoollib/AccountService.py

redfishtoollib/Chassis.py

redfishtoollib/Managers.py

redfishtoollib/ServiceRoot.py

redfishtoollib/SessionService.py

redfishtoollib/Systems.py

redfishtoollib/init.py

redfishtoollib/pycache/AccountService.cpython-36.pyc

redfishtoollib/pycache/Chassis.cpython-36.pyc

redfishtoollib/pycache/Managers.cpython-36.pyc

redfishtoollib/pycache/ServiceRoot.cpython-36.pyc

redfishtoollib/pycache/SessionService.cpython-36.pyc

redfishtoollib/pycache/Systems.cpython-36.pyc

redfishtoollib/pycache/init.cpython-36.pyc

redfishtoollib/pycache/raw.cpython-36.pyc

redfishtoollib/pycache/redfishtoolMain.cpython-36.pyc

redfishtoollib/pycache/redfishtoolTransport.cpython-36.pyc

redfishtoollib/raw.py

redfishtoollib/redfishtoolMain.py

redfishtoollib/redfishtoolTransport.py

lab@lab-Precision-5510-lab3:~/ganesan/Redfish-Usecase-Checkers$

mraineri commented 1 year ago

What about the output of the following?

which python
which python3
python --version
python3 --version
ls /usr/local/lib/python3.*/dist-packages/redfishtool*
Ganesan149 commented 1 year ago

lab@lab-Precision-5510-lab3:~/ganesan/Redfish-Usecase-Checkers$ which python

/usr/bin/python

lab@lab-Precision-5510-lab3:~/ganesan/Redfish-Usecase-Checkers$ which python3

/usr/bin/python3

lab@lab-Precision-5510-lab3:~/ganesan/Redfish-Usecase-Checkers$ python --version

Python 2.7.17

lab@lab-Precision-5510-lab3:~/ganesan/Redfish-Usecase-Checkers$ python3 --version

Python 3.6.9

lab@lab-Precision-5510-lab3:~/ganesan/Redfish-Usecase-Checkers$ ls /usr/local/lib/python3.6/dist-packages/redfishtool*

/usr/local/lib/python3.6/dist-packages/redfishtool-1.1.5.dist-info:

DESCRIPTION.rst INSTALLER METADATA metadata.json RECORD REQUESTED top_level.txt WHEEL

/usr/local/lib/python3.6/dist-packages/redfishtoollib:

AccountService.py init.py pycache redfishtoolMain.py ServiceRoot.py Systems.py

Chassis.py Managers.py raw.py redfishtoolTransport.py SessionService.py

mraineri commented 1 year ago

Hopefully this is the last one. I'm suspecting the script is running under Python2 when you're executing it.

Can you show me the output of:

cat /usr/local/bin/redfishtool
Ganesan149 commented 1 year ago

yes shebang line is pointing to python2 not python3.

lab@lab-Precision-5510-lab3:~/ganesan/Redfish-Usecase-Checkers$ cat /usr/local/bin/redfishtool

!/usr/bin/python

Copyright Notice:

Copyright 2016, 2020 DMTF. All rights reserved.

License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfishtool/blob/master/LICENSE.md

redfishtool: scripts/redfishtool

#

contents:

-CLI wrapper: calls main() routine in redfishtool package

#

Note: structure supports a future lib interface to the routines

where the libWrapper is the interface

#

from redfishtoollib import main

import sys

if name == "main":

main(sys.argv)
Ganesan149 commented 1 year ago

@mraineri

Is there any update for this issue.

mraineri commented 1 year ago

Can you try reinstalling the tool with:

pip3 install -U redfishtool

As far as I can tell the tool might have been installed in the 3.X directory using the 2.0 version of pip.

mraineri commented 1 year ago

It would also be good to know how you installed it in the first place. Was this through a Debian package? pip?

mraineri commented 2 months ago

No updates; closing...