执行pip3,提示:zsh: /usr/local/bin/pip3: bad interpreter: /Library/Developer/CommandLineTools/usr/bin/python3: no such file or directory
问题:
原因:python路径不正确
方法:
➜ which python3 /usr/local/bin/python ➜ bin cd /usr/local/bin ➜ bin vim pip3
修改第一行为which python3的结果
#!/Library/Developer/CommandLineTools/usr/bin/python3 # -*- coding: utf-8 -*- import re import sys from pip._internal.cli.main import main if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit(main())
如下:
#!/usr/bin/python3 # -*- coding: utf-8 -*- import re import sys from pip._internal.cli.main import main if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit(main())
再次执行pip3命令,无报错。
标签:__,bin,pip3,sys,报错,usr,main,macbook From: https://www.cnblogs.com/jxba/p/18108459