为什么安装不了python3 get pip_python3 pip无法安装任何包也无法更新pip ubuntu

我试过了sudo apt-get install python3

sudo apt-get install idle

sudo apt-get install python3-pip

然后我尝试用pip安装模块,我尝试了几个非工作。pip install send2trash

Collecting send2trash

Downloading https://files.pythonhosted.org/packages/13/2e/ea40de0304bb1dc4eb309de90aeec39871b9b7c4bd30f1a3cdcb3496f5c0/Send2Trash-1.5.0.tar.gz

Building wheels for collected packages: send2trash

Running setup.py bdist_wheel for send2trash ... done

Stored in directory: /home/joe/.cache/pip/wheels/f1/ca/e5/bdd5eae705cf50a483257e6ff9dd34911dda3570f0e1340dda

Successfully built send2trash

Installing collected packages: send2trash

Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/Send2Trash-1.5.0.dist-info'

Consider using the `--user` option or check the permissions.

You are using pip version 10.0.1, however version 18.0 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.

所以我尝试升级pip ......sudo pip install --upgrade pip

Traceback (most recent call last):

File "/usr/bin/pip", line 9, in

from pip import main

ImportError: cannot import name main

显然,我的计算机上有一些旧的python 2.7。我没有使用它。如果解决方案涉及卸载它,我可以。提前致谢。

在我阅读一些说明时,也尝试了sudo pip3。这就是我现在得到的......sudo pip3 install beautifulSoup

[sudo] password for joe:

The directory '/home/joe/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

The directory '/home/joe/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Collecting beautifulSoup

Downloading https://files.pythonhosted.org/packages/1e/ee/295988deca1a5a7accd783d0dfe14524867e31abb05b6c0eeceee49c759d/BeautifulSoup-3.2.1.tar.gz

Complete output from command python setup.py egg_info:

Traceback (most recent call last):

File "", line 1, in

File "/tmp/pip-build-p5xsk9e4/beautifulSoup/setup.py", line 22

print "Unit tests have failed!"

^

SyntaxError: Missing parentheses in call to 'print'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-p5xsk9e4/beautifulSoup/

You are using pip version 8.1.1, however version 18.0 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.

消息说/home/joe/.cache/pip/http不归当前用户所有。那是不正确的。我的电脑对我说谎。这条整条路径一直是我所拥有的,用户乔。

这是用sudo pip运行的...sudo pip install beautifulSoup

Traceback (most recent call last):

File "/usr/bin/pip", line 9, in

from pip import main

ImportError: cannot import name main

还有伤口......sudo python3 -m pip install --upgrade pip

The directory '/home/joe/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

The directory '/home/joe/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Collecting pip

Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB)

100% |████████████████████████████████| 1.3MB 553kB/s

Installing collected packages: pip

Found existing installation: pip 8.1.1

Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr

Successfully installed pip-8.1.1

You are using pip version 8.1.1, however version 18.0 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.

这似乎有效。但后来我跑了sudo pip3和sudo pip ......sudo pip3 install beautifulSoup

Traceback (most recent call last):

File "/usr/local/bin/pip3", line 7, in

from pip._internal import main

ImportError: No module named 'pip._internal'

sudo pip install beautifulSoup

Traceback (most recent call last):

File "/usr/local/bin/pip", line 7, in

from pip._internal import main

ImportError: No module named 'pip._internal'

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值