Parsing expressions problem | "ImportError: Clang is not installed, cannot parse C code"
15 views
Skip to first unread message
Audrius-St
unread,
Apr 19, 2022, 3:20:34 PM4/19/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sympy
Hello,
I am attempting to parse C code into Python using SymPyExpression but am receiving the error message "ImportError: Clang is not installed, cannot parse C code"
However, I'm quite certain that I have Clang installed
$ conda list clang # Name Version Build Channel clang 13.0.1 ha770c72_0 conda-forge clang-13 13.0.1 default_hc23dcda_0 conda-forge libclang-cpp13 13.0.1 default_hc23dcda_0 conda-forge
Code fragment:
src_X = """
inline double advanceX(
double const& x,
double const& px,
double const& y,
double const& py,
double const& t)
// The C code output from FORM starts array indices at 1 not 0. Go figure.
std::array<double, 33 + 1> w;
w[1]=1./3.*y;
w[2]=139./33. + 19./2.*y;
w[2]=w[2]*w[1];
. . .
double x_t=w[1] + x;
return x_t;
"""
def main():
p = SymPyExpression(src_X, 'c')
p.convert_to_python()
print('p:', p)
if __name__ == "__main__":
main()
System:
Python 3.9.12
Sympy 1.10.1
VS Code 1.66.2
Ubuntu 20.04 on WSLg 1.0.33
Is there some parameter in VS Code that I need to set? Puzzled.
Another unrelated issue. Just now, when I attempt to go to https://docs.sympy.org/ I receive the message
404
There isn't a GitHub Pages site here.
Aaron Meurer
unread,
Apr 19, 2022, 3:23:38 PM4/19/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sy...@googlegroups.com
The error message should be improved there. You need clang-python.