【发布时间】:2016-01-12 15:06:39
【问题描述】:
【问题讨论】:
-
你为什么不试试呢?
-
请回答并至少用python27完成安装。 2016 我们被困住了
-
@YumYumYum 您可以使用pytwain 模块为python 安装twain 模块。
标签: python twain python-2to3
【问题讨论】:
标签: python twain python-2to3
使用past 模块,该模块提供了一个实验性翻译包,以帮助在 Python 3 环境中导入和使用旧的 Python 2 模块。
所以用 pip 安装你的包
pip3 install twain --no-compile # to ignore SyntaxErrors
并使用下一个代码在您的python3 代码中导入 twain:
from past import autotranslate
autotranslate(['twain'])
import twain
# use twain .......
【讨论】:
pip3 install twain --no-compile 时,我收到一条消息:Downloading/unpacking twain Could not find any downloads that satisfy the requirement twain Cleaning up... No distributions at all found for twain Storing debug log for failure in C:\Users\PB\pip\pip.log 这是什么意思?
您可以使用.whl 方法为Python 3 安装twain。
首先,您需要下载.whl 文件:twainmodule - Python Extension Packages for Windows。选择与您的 Python 3 版本匹配的那个(例如:我下载了twain‑1.0.4‑cp38‑cp38‑win32.whl)。
重要提示,我特地选择了以win32.whl结尾的文件,因为我在使用64位版本时遇到了麻烦。例如,我使用的扫描仪仅支持 32 位 Twain。
然后,安装wheel 和pip install wheel。
使用pip install /path/to/twain‑1.0.4‑cpXX‑cpXX‑XX.whl安装twain
【讨论】: