Error importing formdiagram function


I’ve been using COMPAS 0.3.0 version and now updated to 0.5.2 version (working in pyCharm). The following worked fine in the previous version.

from compas_tna.diagrams import formdiagram

Now it gives the following error.

File “C:/Users/isuru/PycharmProjects/TNA/venv/test1”, line 8, in
from compas_tna.diagrams import formdiagram
File “C:\compas_tna\src\compas_tna\”, line 20, in
from .formdiagram import *
File “C:\compas_tna\src\compas_tna\diagrams\”, line 17, in
from compas.datastructures.mesh.mesh import TPL
ImportError: No module named mesh


you seem to have an old version of compas_tna.

from compas.datastructures.mesh.mesh import TPL

should be

from compas.datastructures.mesh._mesh import TPL

the correct procedure for using compas_tna is to install it from a local clone of the repo that you keep relatively up to date…

first, clone compas_tna from

then, from the compas_tna root folder issue the following commands from the Anaconda Prompt:

pip install -r requirements-dev.txt

make sure that the correct conda environment is active (judging from some of your previous screenshots that would be “base”).

compas_tna will now be available in your Python environment.

to install for Rhino, do

python -m compas_rhino.uninstall -v 5.0
python -m compas_rhino.install -v 5.0 compas compas_rhino compas_tna 

admittedly, the docs are currently lagging a bit behind because of the high development pace. i will update them later this week…

1 Like