由于win32print,无法在Windows机器上安装zebra python软件包

时间:2016-10-20 16:01:19

标签: python pywin32 zebra

使用安装了python 3.5.2的Windows 10计算机(64位),我正在尝试使用 pip install zebra 安装zebra软件包,但得到以下错误 收集斑马   使用缓存的zebra-0.0.5.tar.gz 收集win32print(来自斑马)   无法找到满足要求win32print(来自zebra)的版本(来自版本:) 找不到win32print(来自zebra)的匹配分布

我已经成功安装了来自https://sourceforge.net/projects/pywin32/files/pywin32/Build%20220/ pywin32 的最新版本(220)并重新启动了机器和命令shell,但收到了同样的错误。

我看到一个类似的问题没有得到回答Zebra Printer Python Package in Pycharm,我希望有人能够解决这个问题,并能为我提供一些指导。谢谢

1 个答案:

答案 0 :(得分:1)

The zebra module depends on a module called win32print on Windows for the installation to complete. Since the win32print module is no longer available anywhere it gives you error.

Possible Solution 1:

  • Switch to linux as it does not require the win32print module on linux

Possible Solution 2:

  • Install pywin32 / pypiwin32 (which you have already done). Install any one of the modules and use it.

  • Download zebra 0.0.5 source code from here

  • Extract it and edit the setup.py file and more specifically the line 23 which says install_requires='pywin32/pypiwin32':

    if sys.platform.lower().startswith('win'): install_requires = 'pywin32/pypiwin32' else: install_requires = None

  • Now, edit the zebra.py file and change all references from win32print to pywin32/pypiwin32.

NOTE: I haven't tried this solution as I don't have a zebra printer. I hope this would help you.