Looks like broken python installation. Try creating a new anaconda environment and installing all packages that you can using conda instead of pip, whenever possible, to ensure binary compatibililty.
It is possible to find which package causes the problem if you run the line using debugger (e.g., with PyCharm) and step into the function.
It is recommended to use virtual machine or Docker image then. Looks like some kind of binary incompatibility with some OS library.
Obviously, this is just python code with complete source code available that fails using some system package while reading xml files into basic python data structures. conda update anaconda may not help if you made a new environment.
The problem is solved now, I reinstalled numpy and matplotlib. changing their order and with both pip and conda. At last one of the combination worked. Now they are compatible. Thnaks for your suggestion.