为什么呢????导入有些库正常,导入tensorflow和seaborn就报错。。哪个大神给解决下!!!谢谢!!!
import tensorflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/huangweiwei/.local/lib/python3.5/site-packages/tensorflow/init.py", line 21, in <module>
import distutils as _distutils
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
File "<frozen importlib._bootstrap>", line 577, in module_from_spec
File "/home/huangweiwei/.local/lib/python3.5/site-packages/_distutils_hack/init.py", line 82, in create_module
return importlib.import_module('._distutils', 'setuptools')
File "/usr/lib/python3.5/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 981, in _gcd_import
File "<frozen importlib._bootstrap>", line 931, in _sanity_check
SystemError: Parent module 'setuptools' not loaded, cannot perform relative import
import seaborn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/huangweiwei/.local/lib/python3.5/site-packages/seaborn/init.py", line 2, in <module>
import matplotlib as mpl
File "/home/huangweiwei/.local/lib/python3.5/site-packages/matplotlib/init.py", line 120, in <module>
import distutils.version
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
File "<frozen importlib._bootstrap>", line 577, in module_from_spec
File "/home/huangweiwei/.local/lib/python3.5/site-packages/_distutils_hack/init.py", line 82, in create_module
return importlib.import_module('._distutils', 'setuptools')
File "/usr/lib/python3.5/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 981, in _gcd_import
File "<frozen importlib._bootstrap>", line 931, in _sanity_check
SystemError: Parent module 'setuptools' not loaded, cannot perform relative import
今天发布的setuptools 50.0.0的问题。
pip3 install "setuptools!=50.0" --force-reinstall
卸载掉就可以了