首页 > 解决方案 > 使用 pip 安装 pyejabberd 时出现错误

问题描述

我正在尝试安装 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.

标签: pythonpython-3.xpipejabberd

解决方案


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


推荐阅读