把我的pip和python安装搞砸了

把我的pip和python安装搞砸了,python,pip,Python,Pip,与LinuxMint合作,我昨天用pip安装了一个包 user@mycomp ~ $ pip install bitmex-ws The program 'pip' is currently not installed. You can install it by typing: sudo apt install python-pip 好的,安装pip jason@speedylinux ~ $ sudo apt install python-pip 而且看起来完全没问题。再试一次 jaso

与LinuxMint合作,我昨天用pip安装了一个包

user@mycomp ~ $ pip install bitmex-ws
The program 'pip' is currently not installed. You can install it by typing:
sudo apt install python-pip
好的,安装pip

jason@speedylinux ~ $ sudo apt install python-pip
而且看起来完全没问题。再试一次

jason@speedylinux ~ $ pip install bitmex-ws
Collecting bitmex-ws
Downloading https://files.pythonhosted.org/packages/f0/5c/6ea7f43b49cf46b0d1552abd6ab89aae4f74641ebca2d836c52737300ea1/bitmex-ws-0.3.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named setuptools
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.
成功

jason@speedylinux ~ $ python get-pip.py
/tmp/tmpM7KfNh/pip.zip/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
Collecting pip
  Using cached https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 18.0
    Uninstalling pip-18.0:
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/bin/pip3'
Consider using the `--user` option or check the permissions.
这看起来很奇怪。 所以我做了不明智的决定(不要跑)

这显然不是个好主意。当时我不知道

返回

    The directory '/home/jason/.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/jason/.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 4.5MB/s 
Installing collected packages: pip
  Found existing installation: pip 18.0
    Uninstalling pip-18.0:
      Successfully uninstalled pip-18.0
Successfully installed pip-18.0
现在是一团糟。 不知道从这里怎么走。我的最终目标是安装bitmex软件包。 下面是一些命令的结果

jason@speedylinux ~ $ python -m pip

/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)

Usage:   
  /usr/bin/python -m pip <command> [options]

Commands:
  install                     Install packages.
  download ... etc

jason@speedylinux ~ $ pip
bash: /usr/bin/pip: No such file or directory
jason@speedylinux ~ $ which python
/usr/bin/python
jason@speedylinux ~ $ which python3
/usr/bin/python3
jason@speedylinux ~ $ which pip
/home/jason/.local/bin/pip
jason@speedylinux ~ $ pip
bash: /usr/bin/pip: No such file or directory
jason@speedylinux ~ $ pip install bitmex-ws
bash: /usr/bin/pip: No such file or directory
jason@speedylinux~$python-mpip
/usr/local/lib/python2.7/dist-packages/pip/_-vendor/requests/_-init_.py:83:RequestsDependencyWarning:cryptography的旧版本([1,2,3])可能会导致速度减慢。
warning.warn(警告、请求依赖警告)
用法:
/usr/bin/python-mpip[选项]
命令:
安装软件包。
下载。。。等
jason@speedylinux约$pip
bash:/usr/bin/pip:没有这样的文件或目录
jason@speedylinux~$哪条蟒蛇
/usr/bin/python
jason@speedylinux~$哪条蟒蛇3
/usr/bin/python3
jason@speedylinux哪一点
/home/jason/.local/bin/pip
jason@speedylinux约$pip
bash:/usr/bin/pip:没有这样的文件或目录
jason@speedylinux~$pip安装bitmex ws
bash:/usr/bin/pip:没有这样的文件或目录

任何备受赞赏的帮助

python-pip
都是一个
aptitude
安装包,正如您所看到的,它没有明确链接到python发行版。我要做的是卸载当前的python安装,并使用首选版本重新安装

python get pip.py
应该只在没有本机安装
pip
的版本(即,不是python 3.x)下运行。如果您正在运行python3.x,只需从
tar.gz
或二进制文件重新安装即可。然后,确保python安装是您的linux机器所指向的


<>通常当<代码> PIP安装< /COD> ING包时,您将希望<代码> Python -M PIP安装…< /代码>以确保您不使用<代码> APT<代码>安装<代码> PIP

< P>此外,我认为您应该考虑以下内容,如果您在Linux

sudo apt update

sudo apt upgrade

显然,您已经混合了Python版本,并安装了一个pip for python3和python2版本。应该是一个更安全的地方吗?我正在使用LinuxMint,我听说一些关键的系统功能在某处依赖于python…?如果您正在使用另一个python安装,是的。对于本机构建,如果您想将其作为答案发布,请编写完整的答案。如果你想完成别人的答案,请考虑在这个答案下面加一个注释。
    The directory '/home/jason/.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/jason/.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 4.5MB/s 
Installing collected packages: pip
  Found existing installation: pip 18.0
    Uninstalling pip-18.0:
      Successfully uninstalled pip-18.0
Successfully installed pip-18.0
jason@speedylinux ~ $ python -m pip

/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)

Usage:   
  /usr/bin/python -m pip <command> [options]

Commands:
  install                     Install packages.
  download ... etc

jason@speedylinux ~ $ pip
bash: /usr/bin/pip: No such file or directory
jason@speedylinux ~ $ which python
/usr/bin/python
jason@speedylinux ~ $ which python3
/usr/bin/python3
jason@speedylinux ~ $ which pip
/home/jason/.local/bin/pip
jason@speedylinux ~ $ pip
bash: /usr/bin/pip: No such file or directory
jason@speedylinux ~ $ pip install bitmex-ws
bash: /usr/bin/pip: No such file or directory
sudo apt update

sudo apt upgrade