反正有没有在python 3中安装twain模块 [英] Is there anyway to install twain module in python 3

查看:342
本文介绍了反正有没有在python 3中安装twain模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Python 3中安装 Python TWAIN模块,但在文档中却说:

I want to install the Python TWAIN module in Python 3. But in the docs it says:

支持Python 2.1至2.5版本.

Python versions 2.1 through 2.5 are supported.

我可以使用2to3进行转换吗?

Can I convert it using 2to3?

推荐答案

使用过去模块提供了实验性的翻译包,可帮助您在Python 3环境中导入和使用旧的Python 2模块.

Use past module which provides an experimental translation package to help with importing and using old Python 2 modules in a Python 3 environment.

因此请使用pip安装软件包

So install your package with pip

pip3 install twain --no-compile   # to ignore SyntaxErrors

并使用下一个代码将twain导入您的python3代码中:

And use next code to import twain in your python3 code :

from past import autotranslate
autotranslate(['twain'])

import twain


# use twain ....... 

这篇关于反正有没有在python 3中安装twain模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆