首页 新闻 搜索 专区 学院

python导库报错:SystemError: Parent module 'setuptools' not loaded, cannot perform relative import

0
悬赏园豆:60 [已解决问题] 解决于 2020-08-31 21:22

为什么呢????导入有些库正常,导入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

UVQQQQ的主页 UVQQQQ | 初学一级 | 园豆:19
提问于:2020-08-31 20:52
< >
分享
最佳答案
0

今天发布的setuptools 50.0.0的问题。
pip3 install "setuptools!=50.0" --force-reinstall

UVQQQQ | 初学一级 |园豆:19 | 2020-08-31 21:21
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册