You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/Users/xxx/work_code/python-lessons/main.py", line 9, in<module>
import office
File "/Users/xxx/work_code/python-lessons/venv/lib/python3.8/site-packages/office/__init__.py", line 1, in<module>
from . import word
File "/Users/xxx/work_code/python-lessons/venv/lib/python3.8/site-packages/office/word.py", line 12, in<module>
from win32com.client import constants, gencache
ModuleNotFoundError: No module named 'win32com'
再次安装缺少的 win32
pip install pypiwin32
安装 win32 报错
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting pypiwin32
Using cached https://mirrors.aliyun.com/pypi/packages/d0/1b/2f292bbd742e369a100c91faa0483172cd91a1a422a6692055ac920946c5/pypiwin32-223-py3-none-any.whl (1.7 kB)
Using cached https://mirrors.aliyun.com/pypi/packages/2b/ca/5c086c18de8f70222787b3e824e755b68d99272531522e77bb381d4f60c8/pypiwin32-219.zip (4.8 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in<module>
File "<pip-setuptools-caller>", line 34, in<module>
File "/private/var/folders/2p/c0c3rrys09b8c8y0rrkscn8r0000gn/T/pip-install-b18sn648/pypiwin32_0e47d8d13683441e9c213f629f92a95f/setup.py", line 121
print "Building pywin32", pywin32_version
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Building pywin32", pywin32_version)?
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
The text was updated successfully, but these errors were encountered:
安装后
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple python-office -U
执行
office.excel.fake2excel(columns=['name', 'text'], rows=20)
报错
win32
The text was updated successfully, but these errors were encountered: