Mac 10.14.4
我正在尝试安装itertools(Python3)以使用zip_longest出现以下错误。
ERROR: Could not find a version that satisfies the requirement itertools (from versions: none)
ERROR: No matching distribution found for itertools
brew install itertools
pip install itertools
$ pip install itertools
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting itertools
ERROR: Could not find a version that satisfies the requirement itertools (from versions: none)
ERROR: No matching distribution found for itertools
我想使用itertools中的zip_longest
请问有人可以帮助我理解此错误以及如何解决吗?
$python example.py
Traceback (most recent call last):
File "example.py", line 5, in <module>
from dejavu import dejavu
File "/usr/local/Cellar/mysql/8.0.16/Dejavu/dejavu/__init__.py", line 1, in <module>
from dejavu.database import get_database, database
File "/usr/local/Cellar/mysql/8.0.16/Dejavu/dejavu/database.py", line 176, in <module>
import dejavu.database_sql
File "/usr/local/Cellar/mysql/8.0.16/Dejavu/dejavu/database_sql.py", line 2, in <module>
from itertools import zip_longest
ImportError: cannot import name zip_longest
(base) Krackle-MBP-2:dejavu krackle$ brew update python3
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
No changes to formulae.
Error: python3 3.7.3 already installed