j.t
December 12, 2023, 11:48pm
1
Hi everyone,
I am trying to use matplotlib and the Tkinter backend to visualise lidar data on a 2D cartesian graph.
However I am running into the issue:
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'
I have installed tkinter onto my machine I am pretty sure but am still getting this issue. Would anyone have pointers on how to fix this? Thank you.
Hi,
did you install tkinter into your Isaac Sim python environment?
Here is the documentration for that: Python Environment Installation — Omniverse IsaacSim latest documentation (nvidia.com)
toni.nv
December 13, 2023, 5:09pm
3
Hi @j.t
Here you can find some steps to install and use some of the matploltib backends
TkAgg
Install:
sudo apt-get install python3-tk
Matplotlib configuration:
# to get the _tkinter path run the following command in a terminal:
# python3.10 -c "import _tkinter; print(_tkinter.__file__)"
# and append the parent folder to sys.path
import sys
sys.path.append("/usr/lib/python3.10/lib-dynload")
import matplotlib
matplotlib.use("TkAgg")
GTK4Agg / GTK4Cairo
Install:
sudo apt-get install libcairo2-dev libgirepository1.0-dev
./python.sh -m pip install --upgrade pip
./python.sh -m pip install pycairo PyGObject
Matplotlib configuration:
import matplotlib
matplotlib.use("GTK4Agg") # or GTK4Cairo
j.t
December 19, 2023, 12:05am
4
Hi!
Thank you for your help. However, I am still getting this error:
ImportError: /usr/lib/python2.7/lib-dynload/_tkinter.so: undefined symbol: Py_Py3kWarningFlag
toni.nv
December 19, 2023, 12:22am
5
Hi @j.t
Your log shows a version for Python2.7. Make sure you are installing the version for Python 3.10 (current Kit Python version is 3.10).
j.t
December 19, 2023, 1:52am
7
Hi Toni,
I am running Isaac Sim on a ubuntu machine. Does the sim use its own python environment or the python installed onto the machine?
Thank you,
Jeff
toni.nv
December 19, 2023, 3:26am
8
Hi @j.t
All Omniverse applications, including Issac Sim, have their own Python environment (located in the kit/python
folder). You can read more about it in the following link: Python Environment Installation — Omniverse IsaacSim latest documentation
system
Closed
January 10, 2024, 5:13pm
10
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.