ModuleNotFoundError:没有名为“mimetypes”的模块

问题描述 投票:0回答:2

每当我输入类似命令时,都会弹出以下错误

conda info -e
conda update condo
或者
conda create env -n 123
在终端中。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  ...
    from ..gateways.connection.download import download
  File "/Users/liguolun/opt/anaconda3/lib/python3.8/site-packages/conda/gateways/connection/__init__.py", line 39, in <module>
    from pip._vendor.requests import ConnectionError, HTTPError, Session
  File "/Users/liguolun/opt/anaconda3/lib/python3.8/site-packages/pip/_vendor/requests/__init__.py", line 43, in <module>
    from pip._vendor import urllib3
  File "/Users/liguolun/opt/anaconda3/lib/python3.8/site-packages/pip/_vendor/urllib3/__init__.py", line 7, in <module>
    from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
  File "/Users/liguolun/opt/anaconda3/lib/python3.8/site-packages/pip/_vendor/urllib3/connectionpool.py", line 38, in <module>
    from .request import RequestMethods
  File "/Users/liguolun/opt/anaconda3/lib/python3.8/site-packages/pip/_vendor/urllib3/request.py", line 3, in <module>
    from .filepost import encode_multipart_formdata
  File "/Users/liguolun/opt/anaconda3/lib/python3.8/site-packages/pip/_vendor/urllib3/filepost.py", line 10, in <module>
    from .fields import RequestField
  File "/Users/liguolun/opt/anaconda3/lib/python3.8/site-packages/pip/_vendor/urllib3/fields.py", line 3, in <module>
    import mimetypes
ModuleNotFoundError: No module named 'mimetypes'

如何修复?

python python-3.x anaconda conda
2个回答
1
投票

尝试在命令提示符中使用命令:

pip install mimetypes
并重新打开文件。
希望它有效!


0
投票

在文件顶部导入 mimetypes

© www.soinside.com 2019 - 2024. All rights reserved.