当前位置:   article > 正文

成功解决ImportError: cannot import name ‘InvalidSchemeCombination‘ from ‘pip._internal.exceptions‘_importerror: cannot import name 'invalidschemecomb

importerror: cannot import name 'invalidschemecombination' from 'pip._intern

成功解决ImportError: cannot import name 'InvalidSchemeCombination' from 'pip._internal.exceptions' 

目录

解决问题

解决思路

解决方法

T1、重新安装pip

T2、改为conda下载对应的包


解决问题

  1. Traceback (most recent call last):
  2. File "E:\ProgramData\Anaconda3\Scripts\pip-script.py", line 6, in <module>
  3. from pip._internal.cli.main import main
  4. File "E:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\cli\main.py", line 8, in <module>
  5. from pip._internal.cli.autocompletion import autocomplete
  6. File "E:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\cli\autocompletion.py", line 9, in <module>
  7. from pip._internal.cli.main_parser import create_main_parser
  8. File "E:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\cli\main_parser.py", line 7, in <module>
  9. from pip._internal.cli import cmdoptions
  10. File "E:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 22, in <module>
  11. from pip._internal.cli.progress_bars import BAR_TYPES
  12. File "E:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\cli\progress_bars.py", line 9, in <module>
  13. from pip._internal.utils.logging import get_indentation
  14. File "E:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\utils\logging.py", line 14, in <module>
  15. from pip._internal.utils.misc import ensure_dir
  16. File "E:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\utils\misc.py", line 29, in <module>
  17. from pip._internal.locations import get_major_minor_version, site_packages, user_site
  18. File "E:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\locations\__init__.py", line 14, in <module>
  19. from . import _distutils, _sysconfig
  20. File "E:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\locations\_sysconfig.py", line 8, in <module>
  21. from pip._internal.exceptions import InvalidSchemeCombination, UserInstallationInvalid
  22. ImportError: cannot import name 'InvalidSchemeCombination' from 'pip._internal.exceptions' (E:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\exceptions.py)

解决思路

导入错误:无法从“pip.\u internal.exceptions”(E:\ProgramData\Anaconda3\lib\site packages\pip\\u internal\exceptions.py)导入名称“invalidSchemeComposition”

解决方法

pip命令出现了问题,解决方法有两个

T1、重新安装pip

参考文章https://stackoverflow.com/questions/67446140/importerror-cannot-import-name-invalidschemecombination-from-pip-internal-ehttps://stackoverflow.com/questions/67446140/importerror-cannot-import-name-invalidschemecombination-from-pip-internal-e

第一步,定位到pip命令所在的程序文件路径,删除该文件夹下的pip相关的文件夹

第二步,使用conda强制删除环境中pip

conda remove --force pip

第三步,使用conda重新安装pip

conda install -c anaconda pip

 

T2、改为conda下载对应的包

conda install pyserial

哈哈,大功告成!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/313111
推荐阅读
相关标签
  

闽ICP备14008679号