Python Forum
ModuleNotFoundError: No module named 'omsdk.sdkproto' - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: ModuleNotFoundError: No module named 'omsdk.sdkproto' (/thread-38487.html)



ModuleNotFoundError: No module named 'omsdk.sdkproto' - donvito7 - Oct-19-2022

Can anyone help me to fix this?

I am getting the error like in the subject line.

Traceback (most recent call last):
File "/usr/local/nagios/dell/scripts/dellemc_device_check.py", line 26, in <module>
from omsdk.sdkproto import SNMPOptions
ModuleNotFoundError: No module named 'omsdk.sdkproto'

Any idea?


RE: ModuleNotFoundError: No module named 'omsdk.sdkproto' - Axel_Erfurt - Oct-19-2022

pip install omsdk


RE: ModuleNotFoundError: No module named 'omsdk.sdkproto' - donvito7 - Oct-20-2022

I did that already:

pip install omsdk

Requirement already satisfied: omsdk in /home/user/.local/lib/python3.8/site-packages (1.2.490)
Requirement already satisfied: PyYAML>=3.12 in /usr/lib/python3/dist-packages (from omsdk) (5.3.1)
Requirement already satisfied: pysnmp-mibs>=0 in /home/user/.local/lib/python3.8/site-packages (from omsdk) (0.1.6)
Requirement already satisfied: requests>=2.12.3 in /usr/lib/python3/dist-packages (from omsdk) (2.22.0)
Requirement already satisfied: ipaddress>=0 in /home/user/.local/lib/python3.8/site-packages (from omsdk) (1.0.23)
Requirement already satisfied: future>=0.16.0 in /home/user/.local/lib/python3.8/site-packages (from omsdk) (0.18.2)
Requirement already satisfied: pysnmp>=4.3.0 in /home/user/.local/lib/python3.8/site-packages (from pysnmp-mibs>=0->omsdk) (4.4.12)
Requirement already satisfied: pysmi in /home/user/.local/lib/python3.8/site-packages (from pysnmp>=4.3.0->pysnmp-mibs>=0->omsdk) (0.3.4)
Requirement already satisfied: pycryptodomex in /home/user/.local/lib/python3.8/site-packages (from pysnmp>=4.3.0->pysnmp-mibs>=0->omsdk) (3.15.0)
Requirement already satisfied: pyasn1>=0.2.3 in /usr/lib/python3/dist-packages (from pysnmp>=4.3.0->pysnmp-mibs>=0->omsdk) (0.4.2)
Requirement already satisfied: ply in /home/user/.local/lib/python3.8/site-packages (from pysmi->pysnmp>=4.3.0->pysnmp-mibs>=0->omsdk) (3.11)


RE: ModuleNotFoundError: No module named 'omsdk.sdkproto' - snippsat - Oct-20-2022

I can do quick test in virtual enviromt(it's build into Python in you do not know trough venv)
Do this from command line.
which python
# Or which python 3 if you use that
Make sure it point to your version.
/home/user/.local/lib/python3.8
Start interpreter.
λ python
Python 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import omsdk
>>>
>>> dir(omsdk)
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'main']  
>>> omsdk.main()
Welcome to Dell OpenManage SDK

# File shall point to your python3.8/site-packages
>>> omsdk.__file__
'G:\\div_code\\image_env\\lib\\site-packages\\omsdk\\__init__.py'

# Test import 
>>> from omsdk.sdkproto import SNMPOptions
>>>
>>> dir(omsdk)
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'http', 'main', 'sdkcenum', 'sdkcreds', 'sdkentitymib', 'sdkprint', 'sdkproto', 'sdkprotobase', 'sdkprotopref', 'sdksnmp', 'sdkunits', 'simulator', 'version']

 dir(omsdk.sdkproto)
['CredentialsEnum', 'EntityCompEnum', 'EntityComponentTree', 'EntityMibConvertor', 'EntitySNMPViews', 'Enum', 'EnumWrapper', 'PCONSOLE', 'PREDFISH', 'PREST', 'PSNMP', 'PWSMAN', 'PY2', 'PY3', 'PrettyPrint', 'ProtoPreference', 'ProtocolCredentialsFactory', 'ProtocolEnum', 'ProtocolFactory', 'ProtocolFactoryIterator', 'ProtocolOptions', 'ProtocolOptionsFactory', 'ProtocolWrapper', 'RedfishOptions', 'RedfishProtocol', 'RestOptions', 'RestProtocol', 'SNMPOptions', 'SNMPProtocol', 'Simulation', 'Simulator', 'TypeHelper', 'UnitsFactory', 'WSMANOptions', 'WsManOptions', 'WsManProtocol', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'chain', 'copy', 'datetime', 'json', 'logger', 'logging', 'os', 're', 'sys']
Common problem make sure you have not name a file omsdk.py or any other name that shadow the import from omsdk.


RE: ModuleNotFoundError: No module named 'omsdk.sdkproto' - deanhystad - Oct-20-2022

I don't think this is a virtual environment or wrong python problem. If there is no oemsdk package installed, the error would be:
Error:
ModuleNotFoundError: No module named 'omsdk'
That it says
Error:
ModuleNotFoundError: No module named 'omsdk.sdkproto'
points to there being an omsdk somewhere but no omsdk.sdkproto. Did you make a file that is named omsdk.py? I would try import omsdk all by itself and see what happens.