After installing below python packages
pip install Jinja2
pip install PyYAML
pip install MarkupSafe
While executing yaml2uvmf.py I got the below error
File “yaml2uvmf.py”, line 59, in
from uvmf_yaml import *
ModuleNotFoundError: **No module named ‘uvmf_yaml’
**
Anybody knows how to resolve it?
In reply to Abuzar Gaffari:
The uvmf_yaml module is packaged with the UVMF install and should be automatically picked up by the script. There are a lot of potential variables that could cause this, including the version of UVMF in use, OS in use, as well as the version of Python in use.
Filing a Siemens support ticket would probably be the best course of action to get this resolved properly.
Short term, adding $UVMF_HOME/templates/python to the $PYTHONPATH environment variable may help resolve this, although it should not be necessary.
In reply to jcraft:
Adding $UVMF_HOME/templates/python to the $PYTHONPATH environment variable worked for me. Thanks Jcraft!
In reply to Abuzar Gaffari:
Could you elaborate this a bit. I am having the same issue.
I’m using Ubuntu 22.04.1 LTS
I set the pythonpath, using
export PYTHONPATH=$(home/…/templates/python)
but it shows an, AttributeError: module ‘collections’ has no attribute ‘mapping’
This specific error can occur if you are using a newer Python3 version that deprecated certain types of imports. Easiest short term solution is to move to an older Python version (something older than 3.10).
If able to update Python packages, it may be possible to resolve this by upgrading the packages in use on your system via “pip install <package_name> --upgrade”. The most likely culprit is the Jinja2 package, but it isn’t entirely clear which package is triggering the error based on your post.
In reply to jcraft:
I managed to solve this by running python 3.09 instead of python 3.10, yes it was an issue for newer python version.
The attribute “mapping” has now been moved to “collections.abc” from “collections” so changing all these instances would also have worked. But seemed a lot more tedious.