简体   繁体   中英

python error when import (using xlwings lib)

Below is the error message when I import:

>>> from xlwings import workbook, range
Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    from xlwings import workbook, range
  File "C:\Users\user\AppData\Local\Programs\Python\Python35\lib\site-packages\xlwings\__init__.py", line 20, in <module>
    from . import _xlwindows as xlplatform
  File "C:\Users\user\AppData\Local\Programs\Python\Python35\lib\site-packages\xlwings\_xlwindows.py", line 10, in <module>
    import win32api
ImportError: No module named 'win32api'

I have tried Python 3.5 and 2.7.10 but both have no luck.

Make sure you have win32api package installed. Install it using

pip install win32api

You need to install pywin32 .
just download and install from http://sourceforge.net/projects/pywin32/

Please state which environment you using.Windows or Mac? It have dependency:

Windows

pywin32, comtypes

Mac

psutil, appscript

More, please refer xlwings README doc:

https://github.com/ZoomerAnalytics/xlwings

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM