Saturday, 15 September 2012

python-docx cannot be imported to python -



python-docx cannot be imported to python -

i'm trying install python-docx typed in cmd

easy_install python-docx

and got:

searching python-docx best match: python-docx 0.7.4 processing python_docx-0.7.4-py2.6.egg python-docx 0.7.4 active version in easy-install.pth using c:\python26\lib\site-packages\python_docx-0.7.4-py2.6.egg processing dependencies python-docx finished processing dependencies python-docx

but when open python , type:

import docx

i got:

file "c:\python26\lib\site-packages\docx-0.2.4-py2.6.egg\docx.py", line 17, in < module> lxml import etree importerror: dll load failed: specified procedure not found.

how can solve import error? missing?

this symptom can arise when have both legacy version , new version of python-docx installed. recommend uninstall both , install python-docx using pip. in general recommend avoiding utilize of easy_install anymore.

the legacy versions (v0.2.x) have install-package name 'docx'. new version uses name 'python-docx' (although both import 'docx' 1 time installed). if installed pip doing uninstall/reinstall this:

$ pip freeze ... docx ... python-docx ... $ pip uninstall docx ... $ pip uninstall python-docx ... $ pip install python-docx ...

it sounds used easy_install originally, might need uninstall manually, although seek first , see if pip done you. if not, quick search on python easy_install uninstall lead useful resources. might involve visiting "c:\python26\lib\site-packages\" , removing files or directories start 'docx' or 'python-docx'.

this should farther along. if still gives problem after doing this, allow me know new symptoms. should able install pretty transparently on uncorrupted python installation if utilize pip.

python docx python-2.6 easy-install python-docx

No comments:

Post a Comment