所以我运行了python -m pip install PyDictionary
,得到了这样的输出:
Collecting PyDictionary
Using cached PyDictionary-2.0.1-py3-none-any.whl (6.1 kB)
Requirement already satisfied: requests in d:\python\lib\site-packages (from PyDictionary) (2.27.1)
Collecting goslate
Using cached goslate-1.5.2.tar.gz (16 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: click in d:\python\lib\site-packages (from PyDictionary) (8.1.3)
Collecting bs4
Using cached bs4-0.0.1.tar.gz (1.1 kB)
Preparing metadata (setup.py) ... done
Collecting beautifulsoup4
Using cached beautifulsoup4-4.11.1-py3-none-any.whl (128 kB)
Requirement already satisfied: colorama in d:\python\lib\site-packages (from click->PyDictionary) (0.4.4)
Collecting futures
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 "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 14, in <module>
File "D:\Python\lib\site-packages\setuptools\__init__.py", line 189, in <module>
monkey.patch_all()
File "D:\Python\lib\site-packages\setuptools\monkey.py", line 99, in patch_all
patch_for_msvc_specialized_compiler()
File "D:\Python\lib\site-packages\setuptools\monkey.py", line 169, in patch_for_msvc_specialized_compiler
patch_func(*msvc14('_get_vc_env'))
File "D:\Python\lib\site-packages\setuptools\monkey.py", line 149, in patch_params
mod = import_module(mod_name)
File "D:\Python\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "D:\Python\lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 20, in <module>
import unittest.mock
File "D:\Python\lib\unittest\mock.py", line 26, in <module>
import asyncio
File "D:\Python\lib\asyncio\__init__.py", line 8, in <module>
from .base_events import *
File "D:\Python\lib\asyncio\base_events.py", line 18, in <module>
import concurrent.futures
File "C:\Users\localuser\AppData\Local\Temp\pip-install-vsl457j6\futures_9b56e18f578949cd955c2218e6840e1e\concurrent\futures\__init__.py", line 8, in <module>
from concurrent.futures._base import (FIRST_COMPLETED,
File "C:\Users\localuser\AppData\Local\Temp\pip-install-vsl457j6\futures_9b56e18f578949cd955c2218e6840e1e\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.
我如何修复它,以便可以下载PyDictionary。我正在使用python 3.10.4。我已经将Python保存到了硬盘D上:但是它不会给pip带来任何其他问题。我能看到的主要问题是,进口期货有问题,但从我的研究中我发现,期货已经下载到python 3,但当我试图卸载时,它说跳过期货在没有安装,所以,也许这就是问题,但我不知道如何解决它。有人有什么想法吗?
发布于 2022-05-07 12:52:06
这似乎是这个软件包的一个已知问题。当出现这样的问题时,最好是检查项目的官方GitHub存储库,并查看开放的问题。
https://github.com/geekpradd/PyDictionary/issues/52#issuecomment-1105459595
,我对这个回购没有任何特权。但是我做了一些调试--我认为这里的实际问题是
goslate
依赖于未来,而futures >=3.0.0
根本无法在python3上安装。pypi页面调用它,因为在代码库中使用Python 2语法,所以它不能在Python 3上工作。Python 3用户不应该尝试安装它,因为包已经包含在标准库中。-- https://pypi.org/project/futures/我可以通过在安装PyDictionary:
之前安装futures <3.0.0
来解决这个问题
发布于 2022-06-02 10:22:52
尝试这种方法,但是它只给出了很少的结果。这个库使用dictionary.com
pip install Py-Dictionary
from pydictionary import Dictionary
dict = Dictionary("lastname")
将其存储在变量中的某个地方
meanings_list = dict.meanings()
synonyms_list = dict.synonyms()
antonyms_list = dict.antonyms()
打印这个
dict.print_meanings()
dict.print_synonyms()
dict.print_antonyms()
https://stackoverflow.com/questions/72152614
复制相似问题