简体   繁体   English

错误:PyDictionary 不会安装在 Python 3.10.2 上

[英]Error: PyDictionary would not install on Python 3.10.2

I use pycharm ide for coding, But when I tried installing PyDictionary module it gave this error on console:我使用 pycharm ide 进行编码,但是当我尝试安装 PyDictionary 模块时,它在控制台上出现此错误:

PyCharm 截图

The system is running windows10 with Python version 3.10.2 with latest pip and setuptool.系统正在运行带有 Python 版本 3.10.2 的 windows10,带有最新的 pip 和 setuptool。 All necessary path variables are set and other modules import and install without issues.设置了所有必要的路径变量,其他模块导入和安装没有问题。 This case is happening only with python 3.10.2这种情况只发生在 python 3.10.2

Collecting PyDictionary
  Using cached PyDictionary-2.0.1-py3-none-any.whl (6.1 kB)
Collecting goslate
  Using cached goslate-1.5.2.tar.gz (16 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting bs4
  Using cached bs4-0.0.1.tar.gz (1.1 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting click
  Using cached click-8.0.4-py3-none-any.whl (97 kB)
Requirement already satisfied: requests in c:\users\sysadmin\appdata\local\programs\python\python310\lib\site-packages (from PyDictionary) (2.27.1)
Collecting beautifulsoup4
  Using cached beautifulsoup4-4.10.0-py3-none-any.whl (97 kB)
Collecting colorama
  Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting futures
  Using cached futures-3.0.5.tar.gz (25 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status '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 "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 14, in <module>
    File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 244, in <module>
      monkey.patch_all()
    File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\monkey.py", line 99, in patch_all
      patch_for_msvc_specialized_compiler()
    File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\monkey.py", line 169, in patch_for_msvc_specialized_compiler
      patch_func(*msvc14('_get_vc_env'))
    File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\monkey.py", line 149, in patch_params
      mod = import_module(mod_name)
    File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 20, in <module>
      import unittest.mock
    File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\unittest\mock.py", line 26, in <module>
      import asyncio
    File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\asyncio\__init__.py", line 8, in <module>
      from .base_events import *
    File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 18, in <module>
      import concurrent.futures
    File "C:\Users\sysadmin\AppData\Local\Temp\pip-install-ucxsouan\futures_c24a44afb56f439e8f819b7a8a5ff59d\concurrent\futures\__init__.py", line 8, in <module>
      from concurrent.futures._base import (FIRST_COMPLETED,
    File "C:\Users\sysadmin\AppData\Local\Temp\pip-install-ucxsouan\futures_c24a44afb56f439e8f819b7a8a5ff59d\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.

I tried the same on windows command shell with admin privileges.我在具有管理员权限的 windows 命令 shell 上尝试了相同的操作。 But same.但是一样。 Anyone has the same issue?有人有同样的问题吗?

对我来说,升级setuptools解决了它。

python3 -m pip install --upgrade pip setuptools

Try going with wordhoard or py-dictionary尝试使用 wordhoard 或 py-dictionary

pip install wordhoard
pip install Py-Dictionary

and you can perform the operations.并且您可以执行操作。 Below I have found the synonym of the word下面我找到了这个词的同义词

inp_word = "name"
dict = Dictionary(inp_word,50)
#Py-dictionary
for i in dict.synonyms():
    syn_words.append(i)

#wordhoard
for i in Synonyms(inp_word).find_synonyms():
    syn_words.append(i)

print(set(syn_words))

Mostly both will have same results but I don't want to leave out things so only I am using combinedly大多数情况下两者都会有相同的结果,但我不想遗漏一些东西,所以只有我结合使用

PyDictionary depends on goslate which is dependant on futures , since futures is not supported by Python 3 it causes error. PyDictionary 依赖于goslate ,而 goslate 又依赖于futures ,因为Python 3不支持 futures 会导致错误。 One way of preventing this is to install goslate directly from the GitHub Repository, here is the link .防止这种情况的一种方法是直接从 GitHub 存储库安装goslate ,这里是链接 But you will not get the latest version.但是你不会得到最新版本。

First install goslate from GitHub Repository:首先从 GitHub 存储库安装goslate

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

Then install PyDictionary :然后安装PyDictionary

pip install PyDictionary

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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