【问题标题】:Unable to install pyzmail - "Command "python setup.py egg_info" failed with error code 1"无法安装 pyzmail -“命令“python setup.py egg_info”失败,错误代码为 1”
【发布时间】:2016-08-13 12:39:31
【问题描述】:

我正在尝试为 Python 3.4 安装 pyzmail。我正在使用 Visual Studio Community Edition (Windows),但也尝试使用命令行安装并获得以下转储:

 ----- Installing 'pyzmail' -----
Collecting pyzmail
  Using cached pyzmail-1.0.3.tar.gz
Collecting distribute (from pyzmail)
  Using cached distribute-0.7.3.zip
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info\distribute.egg-info
    writing requirements to pip-egg-info\distribute.egg-info\requires.txt
    writing top-level names to pip-egg-info\distribute.egg-info\top_level.txt
    writing dependency_links to pip-egg-info\distribute.egg-info\dependency_links.txt
    writing pip-egg-info\distribute.egg-info\PKG-INFO
    Traceback (most recent call last):
      File "C:\Users\user\AppData\Local\Temp\pip-build-v5zvr2p3\distribute\pkg_resources.py", line 2680, in _dep_map
        return self.__dep_map
      File "C:\Users\user\AppData\Local\Temp\pip-build-v5zvr2p3\distribute\pkg_resources.py", line 2525, in __getattr__
        raise AttributeError(attr)
    AttributeError: _DistInfoDistribution__dep_map

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\user\AppData\Local\Temp\pip-build-v5zvr2p3\distribute\setup.py", line 58, in <module>
        setuptools.setup(**setup_params)
      File "C:\Python34\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\user\AppData\Local\Temp\pip-build-v5zvr2p3\distribute\setuptools\command\egg_info.py", line 177, in run
        writer = ep.load(installer=installer)
      File "C:\Users\user\AppData\Local\Temp\pip-build-v5zvr2p3\distribute\pkg_resources.py", line 2241, in load
        if require: self.require(env, installer)
      File "C:\Users\user\AppData\Local\Temp\pip-build-v5zvr2p3\distribute\pkg_resources.py", line 2254, in require
        working_set.resolve(self.dist.requires(self.extras),env,installer)))
      File "C:\Users\user\AppData\Local\Temp\pip-build-v5zvr2p3\distribute\pkg_resources.py", line 2471, in requires
        dm = self._dep_map
      File "C:\Users\user\AppData\Local\Temp\pip-build-v5zvr2p3\distribute\pkg_resources.py", line 2682, in _dep_map
        self.__dep_map = self._compute_dependencies()
      File "C:\Users\user\AppData\Local\Temp\pip-build-v5zvr2p3\distribute\pkg_resources.py", line 2699, in _compute_dependencies
        from _markerlib import compile as compile_marker
    ImportError: No module named '_markerlib'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\user\AppData\Local\Temp\pip-build-v5zvr2p3\distribute\
----- Failed to install 'pyzmail' -----

谷歌搜索后,我检查了我是否安装了 ez_setup 和 setuptools 模块,我确实安装了。任何帮助将不胜感激!

【问题讨论】:

    标签: python visual-studio python-3.x


    【解决方案1】:

    我已经能够重现您的问题,而且您是对的,使用 pip install pyzmail 不会很好(pyzmail 的安装程序有问题)所以我尝试了这个:

    easy_install pyzmail
    

    它成功了,那么我可以毫无问题地导入pyzmail。

    【讨论】:

      【解决方案2】:

      您也可以尝试安装 pyzmail36 fork,它为 Python 3.6 及更高版本安装相同的模块:Windows 上的pip install pyzmail36 和 Linux 和 macOS 上的pip3 install pyzmail36。

      【讨论】:

      • 感谢您抽出宝贵时间回复。我在阅读你的书“用 Python 自动化无聊的东西”时写了这个问题,这太棒了 - 感谢你让我开始编程!
      【解决方案3】:

      你可以试试easy_install pyzmail

      这在 2020 年对我有用。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-12-18
        • 2017-02-20
        • 2014-02-26
        相关资源
        最近更新 更多