unable to import libxml2mod from the python script
-
18-09-2019 - |
Question
File "/usr/local/lib/python2.5/site-packages/libxml2.py", line 1, in <module>
import libxml2mod
ImportError: /usr/local/lib/python2.5/site-packages/libxml2mod.so:
undefined symbol:xmlTextReaderSetup
>>> import libxml2mod
>>> import libxml2
>>>
on Python Prompt it works fine !!
can anyone has idea why my program is not working from .py file as import is working perfect from python prompt.
Solution
I can only suggest that your paths are different for some reason. Either that, or you are not using the same python interpreter in both cases.
I have experienced this when I happen to have a couple of interpreters, and the wrong one is either default, or specified in the #! section of the script.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow