pip failed with error code 1 while installing pyzmail

非 Y 不嫁゛ 提交于 2019-12-13 04:26:21

问题


I'm trying to send Gmail through python3. I can use the email and smptlib, but I wanted to try out pyzmail.

However, when I try to install pyzmail, I get this:

$ pip3 install pyzmail
Collecting pyzmail
  Using cached https://files.pythonhosted.org/packages/23/9a/c8709821fa15cec44f825fba884284b261a06d8a0033a16f4c35470eb26a/pyzmail-1.0.3.tar.gz
Collecting distribute (from pyzmail)
  Using cached https://files.pythonhosted.org/packages/5f/ad/1fde06877a8d7d5c9b60eff7de2d452f639916ae1d48f0b8f97bf97e570a/distribute-0.7.3.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/setuptools/__init__.py", line 2, in <module>
    from setuptools.extension import Extension, Library
  File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/setuptools/extension.py", line 5, in <module>
    from setuptools.dist import _get_unpatched
  File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/setuptools/dist.py", line 7, in <module>
    from setuptools.command.install import install
  File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/setuptools/command/__init__.py", line 8, in <module>
    from setuptools.command import install_scripts
  File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/setuptools/command/install_scripts.py", line 3, in <module>
    from pkg_resources import Distribution, PathMetadata, ensure_directory
  File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/pkg_resources.py", line 1518, in <module>
    register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/

I tested installing a different pip module but everything seemed to be in order.

I also tried easy_install but it installed for python 2.7, and not 3.

I think it might be something about my setuptools, but I don't know what needs to be done.


回答1:


The pyzmail packages seems to be inactive now as the last commit and the last release were made 4 years ago. It does not seem to be updated for Python 3.6+.

There was an issue posted on the package's github page with the same error as yours: https://github.com/aspineux/pyzmail/issues/15. Someone posted a patch as a workaround but the best solution is to use pyzmail36 instead:

Tagging @cfenollosa @GheloAce in case you're still using this library and are looking for a more maintainable way forward.

This repository unfortunately seems inactive, so I created a new package on PyPI that includes all the fixes to make pyzmail pip-installable on Python 3.6.

The name of the new package is pyzmail36. You can just update your requirements.txt file to list pyzmail36 instead of pyzmail and all of the rest of your code shouldn't need to change.

So just try with:

pip3 install pyzmail36



回答2:


There are several ways to install pyzmail such as:

  1. Try to use " pip install pyzmail36" by installing Python 3.6 first on your device.
  2. Try to update the setup-tools by typing "pip install setuptools==20.1.1" and then install pyzmail.
  3. Try to search for easy_install on Python 3.x, I have found several links for that.

Good luck.



来源:https://stackoverflow.com/questions/57144887/pip-failed-with-error-code-1-while-installing-pyzmail

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!