What Do I Do If the Message "Import Error:cannot import name main" Is Displayed When the pip3/pip3.5 -V Command Is Run after pip3/pip3.5 Upgrade?
Symptom
After pip3/pip3.5 upgrade, the Python library functions are changed. Therefore, the "Import Error:cannot import name main" error occurs upon a pip3/pip3.5 command.
Solution 1
Run the following upgrade command:
- For Python 3:
python3 -m pip install --upgrade pip --user
- For Python 3.5:
python3.5 -m pip install --upgrade pip --user
If the fault persists, follow Solution 2.
Solution 2
For Python 3:
Open vim /usr/bin/pip3.
Modify the code as shown in Figure 1.
The solution for Python 3.5 is the same as that for Python 3.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot