我全新安装了 Ubuntu 16.04.6,在安装了一些 Python 包(如下所列)并输入 Python3 后import pandas
,出现此错误:
myBashPrompt:~$ python3
Python 3.5.2 (default, Oct 8 2019, 13:06:37)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/anon/.local/lib/python3.5/site-packages/pandas/__init__.py", line 55, in <module>
from pandas.core.api import (
File "/home/anon/.local/lib/python3.5/site-packages/pandas/core/api.py", line 5, in <module>
from pandas.core.arrays.integer import (
File "/home/anon/.local/lib/python3.5/site-packages/pandas/core/arrays/__init__.py", line 1, in <module>
from .array_ import array # noqa: F401
File "/home/anon/.local/lib/python3.5/site-packages/pandas/core/arrays/array_.py", line 7, in <module>
from pandas.core.dtypes.common import (
File "/home/anon/.local/lib/python3.5/site-packages/pandas/core/dtypes/common.py", line 11, in <module>
from pandas.core.dtypes.dtypes import (
File "/home/anon/.local/lib/python3.5/site-packages/pandas/core/dtypes/dtypes.py", line 53, in <module>
class Registry:
File "/home/anon/.local/lib/python3.5/site-packages/pandas/core/dtypes/dtypes.py", line 84, in Registry
self, dtype: Union[Type[ExtensionDtype], str]
File "/usr/lib/python3.5/typing.py", line 552, in __getitem__
dict(self.__dict__), parameters, _root=True)
File "/usr/lib/python3.5/typing.py", line 512, in __new__
for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
File "/usr/lib/python3.5/typing.py", line 512, in <genexpr>
for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
File "/usr/lib/python3.5/typing.py", line 1077, in __subclasscheck__
if super().__subclasscheck__(cls):
File "/usr/lib/python3.5/abc.py", line 225, in __subclasscheck__
for scls in cls.__subclasses__():
TypeError: descriptor '__subclasses__' of 'type' object needs an argument
我该如何修复或避免此错误?
上次发布此帖时,我以为是因为我升级了 Ubuntu。升级不是问题。这些是我安装的其他软件包。
pip3 install pygame
pip3 install pymunk
pip3 install numpy
pip3 install matplotlib==3.0.3 #installed older version because new version requires python3.6
pip3 install scipy
pip3 install PyQt5
sudo pip3 install pyqtgraph
sudo apt-get install openmpi-bin
pip3 install cntk
pip3 install h5py
sudo pip3 install keras
pip3 install visvis --user
pip3 install seaborn --user
pip3 install pandas