简体   繁体   中英

Can't install email module in Python 3.8

I'm using Python 3.8 and pip 19.3.1 on Windows 10 and when I try to pip install email I get an error:

    ERROR: Command errored out with exit status 1:
     command: 'c:\users\User\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-8nsypvg1\\email\\setup.py'"'"'; __file__='"'"'C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-8nsypvg1\\email\\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 'C:\Users\User\AppData\Local\Temp\pip-install-8nsypvg1\email\pip-egg-info'
         cwd: C:\Users\User\AppData\Local\Temp\pip-install-8nsypvg1\email\
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\User\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 18, in <module>
        import setuptools.version
      File "c:\users\User\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\version.py", line 1, in <module>
        import pkg_resources
      File "c:\users\User\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 36, in <module>
        import email.parser
      File "C:\Users\User\AppData\Local\Temp\pip-install-8nsypvg1\email\email\parser.py", line 10, in <module>
        from cStringIO import StringIO
    ModuleNotFoundError: No module named 'cStringIO'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output

How do I get this module installed?

The email module was distributed for pythons 2.3 and 2.4. Starting with 2.5, it was included in the standard python distribution. You're looking for https://docs.python.org/3/library/email.html

Module 'email' is deprecated and no longer being updated. It was last updated on Jul 19, 2011. Latest version of python at that time was Python 2.7

So, it doesn't support Python 3.8. What you can do is install it in Python 2.7

Use the following command to install version 6.0.0 in Python 2.7

pip install email==6.0.0a1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM