See for instance https://www.quora.com/How-do-I-solve-this-error-in-PyCharm-MACOS-Xcrun-error-invalid-active-developer-path-Library-developer-CommandLineTools-missing-xcrun-at-Library-developer-CommandlineTools-usr-bin-xcrun
or Two reoccurring problems while running FEniCS - #11 by azerad