AttributeError: module '_distutils_hack' has no attribute 'add_shim'
时间: 2023-08-02 08:12:01 浏览: 383
引用\[1\]:在执行LooseVersion = distutils.version.LooseVersion 的时候,出现AttributeError:module 'distutils' has no attribute 'version'的错误。这个错误的原因是distutils模块中没有version属性。\[1\]引用\[2\]:解决这个问题的第一步是使用pip命令卸载setuptools,而不是使用conda命令。因为使用conda命令卸载时,会自动分析与setuptools相关的库并全部删除,导致整个环境需要重新配置。\[2\]
问题:AttributeError: module '_distutils_hack' has no attribute 'add_shim'的原因是什么?
回答: AttributeError: module '_distutils_hack' has no attribute 'add_shim'的错误是由于_distutils_hack模块中没有add_shim属性引起的。
#### 引用[.reference_title]
- *1* [AttributeError:module ‘distutils‘ has no attribute ‘version](https://blog.csdn.net/qq_36944952/article/details/124683408)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [AttributeError: module ‘distutils‘ has no attribute ‘version](https://blog.csdn.net/hahhahahhaja/article/details/128003170)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文