页次: 1
由于工作原因,我想使用archlinux来批量打印excel和word文件,网上是有教程的
需要
pip install pypiwin32
,但是我们的archlinux没有找到合适的版本,
提示如下
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pypiwin32
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d0/1b/2f292bbd742e369a100c91faa0483172cd91a1a422a6692055ac920946c5/pypiwin32-223-py3-none-any.whl (1.7 kB)
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/13/e8/4f38eb30c4dae36634a53c5b2cd73b517ea3607e10d00f61f2494449cec0/pypiwin32-223.tar.gz (622 bytes)
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/2b/ca/5c086c18de8f70222787b3e824e755b68d99272531522e77bb381d4f60c8/pypiwin32-219.zip (4.8 MB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3z0of6bq/pypiwin32_efe12eb03639479e9f70fbcc0927a98a/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3z0of6bq/pypiwin32_efe12eb03639479e9f70fbcc0927a98a/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-r0i2uapt
cwd: /tmp/pip-install-3z0of6bq/pypiwin32_efe12eb03639479e9f70fbcc0927a98a/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-3z0of6bq/pypiwin32_efe12eb03639479e9f70fbcc0927a98a/setup.py", line 121
print "Building pywin32", pywin32_version
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Building pywin32", pywin32_version)?
----------------------------------------
WARNING: Discarding https://pypi.tuna.tsinghua.edu.cn/packages/2b/ca/5c086c18de8f70222787b3e824e755b68d99272531522e77bb381d4f60c8/pypiwin32-219.zip#sha256=06d478295c89dbdd4187e1ac099bb8eab93c29e298bded4e2fbc77009287fa44 (from https://pypi.tuna.tsinghua.edu.cn/simple/pypiwin32/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement pywin32>=223 (from pypiwin32)
ERROR: No matching distribution found for pywin32>=223
怎么破?
最近编辑记录 deyen (2021-03-08 18:18:46)
离线
如果你的打印服务是 cups 的话,可以用 pycups
离线
如果你的打印服务是 cups 的话,可以用 pycups
怎么用?可以写两句简单的代码吗?
离线
import cups
# 连接 cups 服务
conn = cups.Connection()
# 查看 cups 中已经配置了的打印机
conn.getPrinters()
# 打印某个文件,打印机名可以在 getPrinters() 的返回内容中看到
conn.printFile("<打印机名>", "<文件名>", "<打印任务的标题,随便写>", {<额外的键值对参数,没有的话传空 dict 即可>})
离线
页次: 1