Python3 pip3 install broken on Ubuntu
I installed python3 and pip3 successfully on my Ubuntu16.04, but pip3 install is broken. How can I fix this problem? The error information of pip3 install
is as follows:
# pip3 install xlwt
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.requests'
Output of sudo -H pip3 install --upgrade pip
sudo -H pip3 install --upgrade pip
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.requests'
Output of which pip3
and pip3 --version
:
# which pip3
/usr/bin/pip3
# pip3 --version
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.requests'
P.S. Python2 pip runs successfully. Output of "which pip" and "pip --version":
# which pip
/usr/bin/pip
# pip --version
pip 1.5.4 from /usr/local/lib/python2.7/dist-packages/pip-1.5.4-py2.7.egg (python 2.7)
And python and python3 installation information:
# which python
/usr/bin/python
# which python3
/usr/bin/python3
# python -V
Python 2.7.14
# python3 -V
Python 3.6.3
16.04 python python3 python-2.7 pip
add a comment |
I installed python3 and pip3 successfully on my Ubuntu16.04, but pip3 install is broken. How can I fix this problem? The error information of pip3 install
is as follows:
# pip3 install xlwt
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.requests'
Output of sudo -H pip3 install --upgrade pip
sudo -H pip3 install --upgrade pip
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.requests'
Output of which pip3
and pip3 --version
:
# which pip3
/usr/bin/pip3
# pip3 --version
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.requests'
P.S. Python2 pip runs successfully. Output of "which pip" and "pip --version":
# which pip
/usr/bin/pip
# pip --version
pip 1.5.4 from /usr/local/lib/python2.7/dist-packages/pip-1.5.4-py2.7.egg (python 2.7)
And python and python3 installation information:
# which python
/usr/bin/python
# which python3
/usr/bin/python3
# python -V
Python 2.7.14
# python3 -V
Python 3.6.3
16.04 python python3 python-2.7 pip
You said 16.04 in your post but used the 14.04 tag. Which version is correct?
– edwinksl
Oct 26 '17 at 11:21
1
16.04 is correct. I couldn't find the 16.04 tag just now. Sorry.
– mlpy
Oct 26 '17 at 11:28
add a comment |
I installed python3 and pip3 successfully on my Ubuntu16.04, but pip3 install is broken. How can I fix this problem? The error information of pip3 install
is as follows:
# pip3 install xlwt
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.requests'
Output of sudo -H pip3 install --upgrade pip
sudo -H pip3 install --upgrade pip
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.requests'
Output of which pip3
and pip3 --version
:
# which pip3
/usr/bin/pip3
# pip3 --version
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.requests'
P.S. Python2 pip runs successfully. Output of "which pip" and "pip --version":
# which pip
/usr/bin/pip
# pip --version
pip 1.5.4 from /usr/local/lib/python2.7/dist-packages/pip-1.5.4-py2.7.egg (python 2.7)
And python and python3 installation information:
# which python
/usr/bin/python
# which python3
/usr/bin/python3
# python -V
Python 2.7.14
# python3 -V
Python 3.6.3
16.04 python python3 python-2.7 pip
I installed python3 and pip3 successfully on my Ubuntu16.04, but pip3 install is broken. How can I fix this problem? The error information of pip3 install
is as follows:
# pip3 install xlwt
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.requests'
Output of sudo -H pip3 install --upgrade pip
sudo -H pip3 install --upgrade pip
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.requests'
Output of which pip3
and pip3 --version
:
# which pip3
/usr/bin/pip3
# pip3 --version
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.requests'
P.S. Python2 pip runs successfully. Output of "which pip" and "pip --version":
# which pip
/usr/bin/pip
# pip --version
pip 1.5.4 from /usr/local/lib/python2.7/dist-packages/pip-1.5.4-py2.7.egg (python 2.7)
And python and python3 installation information:
# which python
/usr/bin/python
# which python3
/usr/bin/python3
# python -V
Python 2.7.14
# python3 -V
Python 3.6.3
16.04 python python3 python-2.7 pip
16.04 python python3 python-2.7 pip
edited Oct 26 '17 at 15:40
karel
58k12128146
58k12128146
asked Oct 26 '17 at 11:18
mlpymlpy
28226
28226
You said 16.04 in your post but used the 14.04 tag. Which version is correct?
– edwinksl
Oct 26 '17 at 11:21
1
16.04 is correct. I couldn't find the 16.04 tag just now. Sorry.
– mlpy
Oct 26 '17 at 11:28
add a comment |
You said 16.04 in your post but used the 14.04 tag. Which version is correct?
– edwinksl
Oct 26 '17 at 11:21
1
16.04 is correct. I couldn't find the 16.04 tag just now. Sorry.
– mlpy
Oct 26 '17 at 11:28
You said 16.04 in your post but used the 14.04 tag. Which version is correct?
– edwinksl
Oct 26 '17 at 11:21
You said 16.04 in your post but used the 14.04 tag. Which version is correct?
– edwinksl
Oct 26 '17 at 11:21
1
1
16.04 is correct. I couldn't find the 16.04 tag just now. Sorry.
– mlpy
Oct 26 '17 at 11:28
16.04 is correct. I couldn't find the 16.04 tag just now. Sorry.
– mlpy
Oct 26 '17 at 11:28
add a comment |
4 Answers
4
active
oldest
votes
There is something wrong with your pip3 so remove it and reinstall it. Open the terminal and type:
sudo apt purge python3-pip
sudo rm -rf '/usr/lib/python3/dist-packages/pip'
sudo apt install python3-pip
cd
cd .local/lib/python3/site-packages
sudo rm -rf pip*
cd
cd .local/lib/python3.5/site-packages
sudo rm -rf pip*
sudo pip3 install xlwt
1
I tried but still the same error: imgur.com/a/nAdqU .
– mlpy
Oct 26 '17 at 15:21
I tried the new solution but still the same error.
– mlpy
Oct 27 '17 at 5:44
I am having the same issue too. When I dosudo apt install python3-pip
, I get the following error:The following packages have unmet dependencies: python3-pip : Depends: python-pip-whl (= 8.1.1-2) but 8.1.1-2ubuntu0.4 is to be installed Recommends: build-essential but it is not going to be installed Recommends: python3-dev (>= 3.2) but it is not going to be installed Recommends: python3-wheel but it is not going to be installed E: Unable to correct problems, you have held broken packages.
– Kristada673
Jan 16 '18 at 8:07
@Kristada673 Try reading the answers to this question: askubuntu.com/questions/363200/…. DragonLord's answer worked for me.
– karel
Jan 16 '18 at 8:10
1
thanks, this worked for me.
– Nikhil VJ
2 days ago
add a comment |
This is what I've found helpful:
sudo rm -rf /usr/local/lib/python3.5/dist-packages
- Never run
pip3
withinsudo
.
While that maybe fixes things, can you please expand your answer ? Why to remove this directory (maybe add a caveat about thepython3.5
path), why never to run it with sudo, and so on..
– Robert Riedl
Jan 22 '18 at 15:17
I am not quite an expert on this - I just wanted to share what had worked for me.
– Jan Lachnitt
Jan 29 '18 at 23:19
I really can't recommend this approach.
– Mr. T
Feb 25 '18 at 4:39
add a comment |
Installing python3-pip package create a python script in file /usr/bin/pip3. In order to run, main() function need to be imported from module pip (from pip import main
).
This method path is only available for packaged pip version (9.0.1 in my case).
After running pip3 install --upgrade pip
, pip version become 18.1, and main() has been moved in pip._internal
.
Use the command python3 -m pip --version
to see if your case correspond to the same situation (pip3 is also available with this method when /usr/bin/pip3 is broken).
If so, in file /usr/bin/pip3, replace line 9:
from pip import main
with:
from pip._internal import main
The issue will be fixed.
(Tested on Ubuntu 18.04 distribution)
add a comment |
Had same issue, installing openssl fixed it for me
But openssl already install on my Ubuntu: imgur.com/a/60kIM . Maybe it's caused by another reason.
– mlpy
Oct 26 '17 at 12:56
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f969463%2fpython3-pip3-install-broken-on-ubuntu%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
There is something wrong with your pip3 so remove it and reinstall it. Open the terminal and type:
sudo apt purge python3-pip
sudo rm -rf '/usr/lib/python3/dist-packages/pip'
sudo apt install python3-pip
cd
cd .local/lib/python3/site-packages
sudo rm -rf pip*
cd
cd .local/lib/python3.5/site-packages
sudo rm -rf pip*
sudo pip3 install xlwt
1
I tried but still the same error: imgur.com/a/nAdqU .
– mlpy
Oct 26 '17 at 15:21
I tried the new solution but still the same error.
– mlpy
Oct 27 '17 at 5:44
I am having the same issue too. When I dosudo apt install python3-pip
, I get the following error:The following packages have unmet dependencies: python3-pip : Depends: python-pip-whl (= 8.1.1-2) but 8.1.1-2ubuntu0.4 is to be installed Recommends: build-essential but it is not going to be installed Recommends: python3-dev (>= 3.2) but it is not going to be installed Recommends: python3-wheel but it is not going to be installed E: Unable to correct problems, you have held broken packages.
– Kristada673
Jan 16 '18 at 8:07
@Kristada673 Try reading the answers to this question: askubuntu.com/questions/363200/…. DragonLord's answer worked for me.
– karel
Jan 16 '18 at 8:10
1
thanks, this worked for me.
– Nikhil VJ
2 days ago
add a comment |
There is something wrong with your pip3 so remove it and reinstall it. Open the terminal and type:
sudo apt purge python3-pip
sudo rm -rf '/usr/lib/python3/dist-packages/pip'
sudo apt install python3-pip
cd
cd .local/lib/python3/site-packages
sudo rm -rf pip*
cd
cd .local/lib/python3.5/site-packages
sudo rm -rf pip*
sudo pip3 install xlwt
1
I tried but still the same error: imgur.com/a/nAdqU .
– mlpy
Oct 26 '17 at 15:21
I tried the new solution but still the same error.
– mlpy
Oct 27 '17 at 5:44
I am having the same issue too. When I dosudo apt install python3-pip
, I get the following error:The following packages have unmet dependencies: python3-pip : Depends: python-pip-whl (= 8.1.1-2) but 8.1.1-2ubuntu0.4 is to be installed Recommends: build-essential but it is not going to be installed Recommends: python3-dev (>= 3.2) but it is not going to be installed Recommends: python3-wheel but it is not going to be installed E: Unable to correct problems, you have held broken packages.
– Kristada673
Jan 16 '18 at 8:07
@Kristada673 Try reading the answers to this question: askubuntu.com/questions/363200/…. DragonLord's answer worked for me.
– karel
Jan 16 '18 at 8:10
1
thanks, this worked for me.
– Nikhil VJ
2 days ago
add a comment |
There is something wrong with your pip3 so remove it and reinstall it. Open the terminal and type:
sudo apt purge python3-pip
sudo rm -rf '/usr/lib/python3/dist-packages/pip'
sudo apt install python3-pip
cd
cd .local/lib/python3/site-packages
sudo rm -rf pip*
cd
cd .local/lib/python3.5/site-packages
sudo rm -rf pip*
sudo pip3 install xlwt
There is something wrong with your pip3 so remove it and reinstall it. Open the terminal and type:
sudo apt purge python3-pip
sudo rm -rf '/usr/lib/python3/dist-packages/pip'
sudo apt install python3-pip
cd
cd .local/lib/python3/site-packages
sudo rm -rf pip*
cd
cd .local/lib/python3.5/site-packages
sudo rm -rf pip*
sudo pip3 install xlwt
edited Oct 27 '17 at 6:07
answered Oct 26 '17 at 11:52
karelkarel
58k12128146
58k12128146
1
I tried but still the same error: imgur.com/a/nAdqU .
– mlpy
Oct 26 '17 at 15:21
I tried the new solution but still the same error.
– mlpy
Oct 27 '17 at 5:44
I am having the same issue too. When I dosudo apt install python3-pip
, I get the following error:The following packages have unmet dependencies: python3-pip : Depends: python-pip-whl (= 8.1.1-2) but 8.1.1-2ubuntu0.4 is to be installed Recommends: build-essential but it is not going to be installed Recommends: python3-dev (>= 3.2) but it is not going to be installed Recommends: python3-wheel but it is not going to be installed E: Unable to correct problems, you have held broken packages.
– Kristada673
Jan 16 '18 at 8:07
@Kristada673 Try reading the answers to this question: askubuntu.com/questions/363200/…. DragonLord's answer worked for me.
– karel
Jan 16 '18 at 8:10
1
thanks, this worked for me.
– Nikhil VJ
2 days ago
add a comment |
1
I tried but still the same error: imgur.com/a/nAdqU .
– mlpy
Oct 26 '17 at 15:21
I tried the new solution but still the same error.
– mlpy
Oct 27 '17 at 5:44
I am having the same issue too. When I dosudo apt install python3-pip
, I get the following error:The following packages have unmet dependencies: python3-pip : Depends: python-pip-whl (= 8.1.1-2) but 8.1.1-2ubuntu0.4 is to be installed Recommends: build-essential but it is not going to be installed Recommends: python3-dev (>= 3.2) but it is not going to be installed Recommends: python3-wheel but it is not going to be installed E: Unable to correct problems, you have held broken packages.
– Kristada673
Jan 16 '18 at 8:07
@Kristada673 Try reading the answers to this question: askubuntu.com/questions/363200/…. DragonLord's answer worked for me.
– karel
Jan 16 '18 at 8:10
1
thanks, this worked for me.
– Nikhil VJ
2 days ago
1
1
I tried but still the same error: imgur.com/a/nAdqU .
– mlpy
Oct 26 '17 at 15:21
I tried but still the same error: imgur.com/a/nAdqU .
– mlpy
Oct 26 '17 at 15:21
I tried the new solution but still the same error.
– mlpy
Oct 27 '17 at 5:44
I tried the new solution but still the same error.
– mlpy
Oct 27 '17 at 5:44
I am having the same issue too. When I do
sudo apt install python3-pip
, I get the following error: The following packages have unmet dependencies: python3-pip : Depends: python-pip-whl (= 8.1.1-2) but 8.1.1-2ubuntu0.4 is to be installed Recommends: build-essential but it is not going to be installed Recommends: python3-dev (>= 3.2) but it is not going to be installed Recommends: python3-wheel but it is not going to be installed E: Unable to correct problems, you have held broken packages.
– Kristada673
Jan 16 '18 at 8:07
I am having the same issue too. When I do
sudo apt install python3-pip
, I get the following error: The following packages have unmet dependencies: python3-pip : Depends: python-pip-whl (= 8.1.1-2) but 8.1.1-2ubuntu0.4 is to be installed Recommends: build-essential but it is not going to be installed Recommends: python3-dev (>= 3.2) but it is not going to be installed Recommends: python3-wheel but it is not going to be installed E: Unable to correct problems, you have held broken packages.
– Kristada673
Jan 16 '18 at 8:07
@Kristada673 Try reading the answers to this question: askubuntu.com/questions/363200/…. DragonLord's answer worked for me.
– karel
Jan 16 '18 at 8:10
@Kristada673 Try reading the answers to this question: askubuntu.com/questions/363200/…. DragonLord's answer worked for me.
– karel
Jan 16 '18 at 8:10
1
1
thanks, this worked for me.
– Nikhil VJ
2 days ago
thanks, this worked for me.
– Nikhil VJ
2 days ago
add a comment |
This is what I've found helpful:
sudo rm -rf /usr/local/lib/python3.5/dist-packages
- Never run
pip3
withinsudo
.
While that maybe fixes things, can you please expand your answer ? Why to remove this directory (maybe add a caveat about thepython3.5
path), why never to run it with sudo, and so on..
– Robert Riedl
Jan 22 '18 at 15:17
I am not quite an expert on this - I just wanted to share what had worked for me.
– Jan Lachnitt
Jan 29 '18 at 23:19
I really can't recommend this approach.
– Mr. T
Feb 25 '18 at 4:39
add a comment |
This is what I've found helpful:
sudo rm -rf /usr/local/lib/python3.5/dist-packages
- Never run
pip3
withinsudo
.
While that maybe fixes things, can you please expand your answer ? Why to remove this directory (maybe add a caveat about thepython3.5
path), why never to run it with sudo, and so on..
– Robert Riedl
Jan 22 '18 at 15:17
I am not quite an expert on this - I just wanted to share what had worked for me.
– Jan Lachnitt
Jan 29 '18 at 23:19
I really can't recommend this approach.
– Mr. T
Feb 25 '18 at 4:39
add a comment |
This is what I've found helpful:
sudo rm -rf /usr/local/lib/python3.5/dist-packages
- Never run
pip3
withinsudo
.
This is what I've found helpful:
sudo rm -rf /usr/local/lib/python3.5/dist-packages
- Never run
pip3
withinsudo
.
answered Jan 22 '18 at 14:26
Jan LachnittJan Lachnitt
111
111
While that maybe fixes things, can you please expand your answer ? Why to remove this directory (maybe add a caveat about thepython3.5
path), why never to run it with sudo, and so on..
– Robert Riedl
Jan 22 '18 at 15:17
I am not quite an expert on this - I just wanted to share what had worked for me.
– Jan Lachnitt
Jan 29 '18 at 23:19
I really can't recommend this approach.
– Mr. T
Feb 25 '18 at 4:39
add a comment |
While that maybe fixes things, can you please expand your answer ? Why to remove this directory (maybe add a caveat about thepython3.5
path), why never to run it with sudo, and so on..
– Robert Riedl
Jan 22 '18 at 15:17
I am not quite an expert on this - I just wanted to share what had worked for me.
– Jan Lachnitt
Jan 29 '18 at 23:19
I really can't recommend this approach.
– Mr. T
Feb 25 '18 at 4:39
While that maybe fixes things, can you please expand your answer ? Why to remove this directory (maybe add a caveat about the
python3.5
path), why never to run it with sudo, and so on..– Robert Riedl
Jan 22 '18 at 15:17
While that maybe fixes things, can you please expand your answer ? Why to remove this directory (maybe add a caveat about the
python3.5
path), why never to run it with sudo, and so on..– Robert Riedl
Jan 22 '18 at 15:17
I am not quite an expert on this - I just wanted to share what had worked for me.
– Jan Lachnitt
Jan 29 '18 at 23:19
I am not quite an expert on this - I just wanted to share what had worked for me.
– Jan Lachnitt
Jan 29 '18 at 23:19
I really can't recommend this approach.
– Mr. T
Feb 25 '18 at 4:39
I really can't recommend this approach.
– Mr. T
Feb 25 '18 at 4:39
add a comment |
Installing python3-pip package create a python script in file /usr/bin/pip3. In order to run, main() function need to be imported from module pip (from pip import main
).
This method path is only available for packaged pip version (9.0.1 in my case).
After running pip3 install --upgrade pip
, pip version become 18.1, and main() has been moved in pip._internal
.
Use the command python3 -m pip --version
to see if your case correspond to the same situation (pip3 is also available with this method when /usr/bin/pip3 is broken).
If so, in file /usr/bin/pip3, replace line 9:
from pip import main
with:
from pip._internal import main
The issue will be fixed.
(Tested on Ubuntu 18.04 distribution)
add a comment |
Installing python3-pip package create a python script in file /usr/bin/pip3. In order to run, main() function need to be imported from module pip (from pip import main
).
This method path is only available for packaged pip version (9.0.1 in my case).
After running pip3 install --upgrade pip
, pip version become 18.1, and main() has been moved in pip._internal
.
Use the command python3 -m pip --version
to see if your case correspond to the same situation (pip3 is also available with this method when /usr/bin/pip3 is broken).
If so, in file /usr/bin/pip3, replace line 9:
from pip import main
with:
from pip._internal import main
The issue will be fixed.
(Tested on Ubuntu 18.04 distribution)
add a comment |
Installing python3-pip package create a python script in file /usr/bin/pip3. In order to run, main() function need to be imported from module pip (from pip import main
).
This method path is only available for packaged pip version (9.0.1 in my case).
After running pip3 install --upgrade pip
, pip version become 18.1, and main() has been moved in pip._internal
.
Use the command python3 -m pip --version
to see if your case correspond to the same situation (pip3 is also available with this method when /usr/bin/pip3 is broken).
If so, in file /usr/bin/pip3, replace line 9:
from pip import main
with:
from pip._internal import main
The issue will be fixed.
(Tested on Ubuntu 18.04 distribution)
Installing python3-pip package create a python script in file /usr/bin/pip3. In order to run, main() function need to be imported from module pip (from pip import main
).
This method path is only available for packaged pip version (9.0.1 in my case).
After running pip3 install --upgrade pip
, pip version become 18.1, and main() has been moved in pip._internal
.
Use the command python3 -m pip --version
to see if your case correspond to the same situation (pip3 is also available with this method when /usr/bin/pip3 is broken).
If so, in file /usr/bin/pip3, replace line 9:
from pip import main
with:
from pip._internal import main
The issue will be fixed.
(Tested on Ubuntu 18.04 distribution)
answered Jan 2 at 17:03
Vincent H.Vincent H.
112
112
add a comment |
add a comment |
Had same issue, installing openssl fixed it for me
But openssl already install on my Ubuntu: imgur.com/a/60kIM . Maybe it's caused by another reason.
– mlpy
Oct 26 '17 at 12:56
add a comment |
Had same issue, installing openssl fixed it for me
But openssl already install on my Ubuntu: imgur.com/a/60kIM . Maybe it's caused by another reason.
– mlpy
Oct 26 '17 at 12:56
add a comment |
Had same issue, installing openssl fixed it for me
Had same issue, installing openssl fixed it for me
answered Oct 26 '17 at 11:56
getupandgogetupandgo
11
11
But openssl already install on my Ubuntu: imgur.com/a/60kIM . Maybe it's caused by another reason.
– mlpy
Oct 26 '17 at 12:56
add a comment |
But openssl already install on my Ubuntu: imgur.com/a/60kIM . Maybe it's caused by another reason.
– mlpy
Oct 26 '17 at 12:56
But openssl already install on my Ubuntu: imgur.com/a/60kIM . Maybe it's caused by another reason.
– mlpy
Oct 26 '17 at 12:56
But openssl already install on my Ubuntu: imgur.com/a/60kIM . Maybe it's caused by another reason.
– mlpy
Oct 26 '17 at 12:56
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f969463%2fpython3-pip3-install-broken-on-ubuntu%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You said 16.04 in your post but used the 14.04 tag. Which version is correct?
– edwinksl
Oct 26 '17 at 11:21
1
16.04 is correct. I couldn't find the 16.04 tag just now. Sorry.
– mlpy
Oct 26 '17 at 11:28