Error message
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in
from pip import main
ImportError: cannot import name 'main'
I already tried to reinstall pip from apt but it didn't solve the problem
In the end, I found something
type in terminal
nano /usr/bin/pipthat will open pip file like this
import sys
from pip import main
if __name__ == '__main__':
sys.exit(main())
1. Change "from pip import main" to "from pip import __main__"
2. Change "sys.exit(main())" to "sys.exit(__main__._main())"
The result is like this
import sysexit nano and save
from pip import __main__
if __name__ == '__main__':
sys.exit(__main__._main())
and you can use your pip again
No comments:
Post a Comment