使用 pip 安装 pyejabberd 时出现错误

I'm getting an error when installing pyejabberd with pip

我正在尝试安装 pyejabberd (https://pypi.org/project/pyejabberd/),但在使用 py -3 -m pip install pyejabberd 时收到错误消息。

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

下面的完整错误:

Collecting pyejabberd
  Using cached https://files.pythonhosted.org/packages/15/f4/658ade66dbaf4db6484ba81f6c1015b6ff653debcee3310c52e3d0a17641/pyejabberd-0.2.11-py2.py3-none-any.whl
Collecting enum34==1.1.2 (from pyejabberd)
  Using cached https://files.pythonhosted.org/packages/6f/e9/08fd439384b7e3d613e75a6c8236b8e64d90c47d23413493b38d4229a9a5/enum34-1.1.2.tar.gz
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\USER\AppData\Local\Programs\Python\Python37-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\USER\AppData\Local\Temp\pip-install-_217wclq\enum34\setup.py'"'"'; __file__='"'"'C:\Users\USER\AppData\Local\Temp\pip-install-_217wclq\enum34\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 pip-egg-info
         cwd: C:\Users\USER\AppData\Local\Temp\pip-install-_217wclq\enum34\
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\USER\AppData\Local\Programs\Python\Python37-32\lib\site-packages\setuptools\__init__.py", line 6, in <module>
        import distutils.core
      File "C:\Users\USER\AppData\Local\Programs\Python\Python37-32\lib\distutils\core.py", line 16, in <module>
        from distutils.dist import Distribution
      File "C:\Users\USER\AppData\Local\Programs\Python\Python37-32\lib\distutils\dist.py", line 9, in <module>
        import re
      File "C:\Users\USER\AppData\Local\Programs\Python\Python37-32\lib\re.py", line 143, in <module>
        class RegexFlag(enum.IntFlag):
    AttributeError: module 'enum' has no attribute 'IntFlag'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

首先使用 python -V 确保您当前安装的 Python 版本。您必须检查 "pyejabberd" 文档,它与 python 2.6、2.7、3.3、3.4 版本兼容。