ImportError: X, using plot_data() or other functions in compas_fea


#1

If you are using compas_fea and find that using a function like rhino.plot_data() is giving an error that looks like:

ImportError: No module named compas.package

This is due to compas (or similarly compas_fea) not being on your system path. Note that, some functions, especially those in compas.utilities.functions will use the XFunc method of compas to get access to your CPython distribution, this is independent of adding any src folders within Rhino’s IronPython script editor.

To add compas and compas_fea to your system path do the following:

  1. Go to Advanced System Settings on Windows, and then click Environment Variables:

env_var

  1. Make a variable called PYTHONPATH, and then make sure both your compas and compas_fea src folders are put in.