I have gone through similar questions but I still cant resolve the problem I have install the package and success but when I run my script it will always return no module name error.
I suspect something todo with the python path where the module may not in python path This is my code
from toscaparser.tosca_template import ToscaTemplate
path_to_yaml_file = 'cvx.yaml'
template = ToscaTemplate(path_to_yaml_file)
print(template.inputs)
error
from tosca_parser import ToscaTemplate
ModuleNotFoundError: No module named 'tosca_parser'
My python
python
Python 3.8.10 (default, Nov 14 2022, 12:59:47)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload',
'/home/cube1/.local/lib/python3.8/site-packages', '/usr/local/lib/python3.8/dist-
packages', '/usr/local/lib/python3.8/dist-packages/pytosca-0.2.1-py3.8.egg',
'/usr/lib/python3/dist-packages']
Package is success install using pip
Requirement already satisfied: attrs>=16.3.0 in /usr/lib/python3/dist-packages (from
cmd2>=1.0.0->cliff!=2.9.0,>=2.8.0->tosca-parser) (19.3.0)
Pip version
pip --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
Run echo $PYTHONPATH only return blank line I did run the script in tosca-parser dir and it work. Thus, something is not right with tosca parser module and python path outside the dir. Need some help and advise how can I fix this. Thank you