linux下pip3更新後,install包出現main不能導入的狀況:linux
bear@bear:~/eclipse-workspace/Python-toolbox$ pip3 install pycryptodomex Traceback (most recent call last): File "/usr/bin/pip3", line 9, in <module> from pip import main ImportError: cannot import name 'main'
緣由爲pip更新爲10.0.0後庫裏面的函數有所變更形成這個問題。
解決方案:vim
vim /usr/bin/pip3
# 更改前 from pip import main if __name__ == '__main__': sys.exit(main()) # 更改後 from pip import __main__ if __name__ == '__main__': sys.exit(__main__._main())
done !dom