How can I solve it? ImportError: cannot import name 'Log' from 'distutils.log'

Traceback (most recent call last):
File β€œ/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 556, in _run_script
exec(code, module.dict)
File β€œ/app/projetostreamlitamericanas/app.py”, line 6, in
import sklearn
File β€œ/home/appuser/venv/lib/python3.9/site-packages/sklearn/init.py”, line 82, in
from .base import clone
File β€œ/home/appuser/venv/lib/python3.9/site-packages/sklearn/base.py”, line 17, in
from .utils import _IS_32BIT
File β€œ/home/appuser/venv/lib/python3.9/site-packages/sklearn/utils/init.py”, line 29, in
from .fixes import parse_version, threadpool_info
File β€œ/home/appuser/venv/lib/python3.9/site-packages/sklearn/utils/fixes.py”, line 19, in
import scipy.stats
File β€œ/home/appuser/venv/lib/python3.9/site-packages/scipy/stats/init.py”, line 467, in
from ._stats_py import *
File β€œ/home/appuser/venv/lib/python3.9/site-packages/scipy/stats/_stats_py.py”, line 37, in
from numpy.testing import suppress_warnings
File β€œ/home/appuser/venv/lib/python3.9/site-packages/numpy/testing/init.py”, line 12, in
from ._private import extbuild, decorators as dec
File β€œ/home/appuser/venv/lib/python3.9/site-packages/numpy/testing/_private/extbuild.py”, line 11, in
from numpy.distutils.ccompiler import new_compiler
File β€œ/home/appuser/venv/lib/python3.9/site-packages/numpy/distutils/init.py”, line 24, in
from . import ccompiler
File β€œ/home/appuser/venv/lib/python3.9/site-packages/numpy/distutils/ccompiler.py”, line 20, in
from numpy.distutils import log
File β€œ/home/appuser/venv/lib/python3.9/site-packages/numpy/distutils/log.py”, line 4, in
from distutils.log import Log as old_Log
ImportError: cannot import name β€˜Log’ from β€˜distutils.log’ (/home/appuser/venv/lib/python3.9/site-packages/setuptools/_distutils/log.py)

Hi there,

Thanks for sharing your question with the community! Check out our guidelines on how to post an effective question here – in particular, please edit your post to include a code snippet so we can reproduce the issue.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.