Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

PyDictionary安装的时候遇到以下报错

User
Collecting PyDictionary
  Using cached PyDictionary-2.0.1-py3-none-any.whl (6.1 kB)      
Requirement already satisfied: bs4 in d:\programdata\anaconda3\envs\graduation\lib\site-packages (from PyDictionary) (0.0.2)      
Requirement already satisfied: click in d:\programdata\anaconda3\envs\graduation\lib\site-packages (from PyDictionary) (8.1.7)    
Collecting goslate (from PyDictionary)
  Using cached goslate-1.5.4.tar.gz (14 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: requests in d:\programdata\anaconda3\envs\graduation\lib\site-packages (from PyDictionary) (2.31.0)
Requirement already satisfied: beautifulsoup4 in d:\programdata\anaconda3\envs\graduation\lib\site-packages (from bs4->PyDictionary) (4.12.3)
Requirement already satisfied: colorama in d:\programdata\anaconda3\envs\graduation\lib\site-packages (from click->PyDictionary) (0.4.6)
Collecting futures (from goslate->PyDictionary)
  Using cached futures-3.0.5.tar.gz (25 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      Traceback (most recent call last):
        File "", line 2, in 
        File "", line 14, in      
        File "D:\ProgramData\anaconda3\envs\graduation\lib\site-packages\setuptools\__init__.py", line 266, in 
          monkey.patch_all()
        File "D:\ProgramData\anaconda3\envs\graduation\lib\site-packages\setuptools\monkey.py", line 98, in patch_all
          patch_for_msvc_specialized_compiler()
        File "D:\ProgramData\anaconda3\envs\graduation\lib\site-packages\setuptools\monkey.py", line 165, in patch_for_msvc_specialized_compiler
          patch_func(*msvc14('_get_vc_env'))
        File "D:\ProgramData\anaconda3\envs\graduation\lib\site-packages\setuptools\monkey.py", line 155, in patch_params
          mod = import_module(mod_name)
        File "D:\ProgramData\anaconda3\envs\graduation\lib\importlib\__init__.py", line 126, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
        File "D:\ProgramData\anaconda3\envs\graduation\lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 20, in 
          import unittest.mock as mock
        File "D:\ProgramData\anaconda3\envs\graduation\lib\unittest\mock.py", line 26, in 
          import asyncio
        File "D:\ProgramData\anaconda3\envs\graduation\lib\asyncio\__init__.py", line 8, in 
          from .base_events import *
        File "D:\ProgramData\anaconda3\envs\graduation\lib\asyncio\base_events.py", line 18, in 
          import concurrent.futures
        File "C:\Users\Victoria\AppData\Local\Temp\pip-install-78s4sozh\futures_a965d2a5e294420e9ecad5b16a93c70d\concurrent\futures\__init__.py", line 8, in 
          from concurrent.futures._base import (FIRST_COMPLETED, 
        File "C:\Users\Victoria\AppData\Local\Temp\pip-install-78s4sozh\futures_a965d2a5e294420e9ecad5b16a93c70d\concurrent\futures\_base.py", line 357
          raise type(self._exception), self._exception, self._traceback
                                     ^
      SyntaxError: invalid syntax
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details. 

分析原因

PyDictionary依赖于goslate,但Python3不支持,因此会导致错误。

解决办法

先从存储库安装goslate

pip install -e git+https://github.com/yeahwhat-mc/goslate#egg=goslate
pip install PyDictionary

你可能感兴趣的:(常见报错,python,人工智能,python,conda)