GNU/Linux >> Belajar Linux >  >> Linux

Perintah, pip install --upgrade pip, instal semua versi pip

Saya menjawab pertanyaan saya sendiri.

Untuk menemukan penyebab masalah, saya membuat dan menguji virtualenv baru di dalam instance pohon kacang.

Pertama, pip install --upgrade setuptools , pip install --upgrade pip berfungsi dengan baik. Tetapi setelah memutakhirkan pip ke yang terbaru (2020.3.2), pip install --upgrade setuptools membuat masalah yang sama. Dan Ketika saya menurunkan pip ke 2020.3.1 menggunakan pip install --upgrade pip==2020.3.1 , itu memecahkan masalah!

Jadi akar penyebabnya adalah pip2020.3.2. Tampaknya pip 2020.3.2 belum dirilis (https://pypi.org/project/pip/20.3.2/). Saya tidak yakin mengapa rilis yang ditarik dipasang.

Saya mengujinya di Linux/2.9.16(python 3.6), MacOS11.0.1(python 3.6, 3.9) dan mendapatkan hasil yang sama.

Bagaimanapun, semoga ini membantu orang lain yang mengalami masalah serupa.

Di bawah ini adalah proses pemecahan masalah.

[[email protected] ~]$ python3 -m venv test-env
[[email protected] ~]$ source ./test-env/bin/activate
(test-env) [[email protected] ~]$ pip --version
pip 18.1 from /home/ec2-user/test-env/lib64/python3.6/dist-packages/pip (python 3.6)
(test-env) [[email protected] ~]$ pip install --upgrade setuptools
Collecting setuptools
  Using cached https://files.pythonhosted.org/packages/3d/f2/1489d3b6c72d68bf79cd0fba6b6c7497df4ebf7d40970e2d7eceb8d0ea9c/setuptools-51.0.0-py3-none-any.whl
Installing collected packages: setuptools
  Found existing installation: setuptools 40.6.2
    Uninstalling setuptools-40.6.2:
      Successfully uninstalled setuptools-40.6.2
Successfully installed setuptools-51.0.0
You are using pip version 18.1, however version 20.3.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(test-env) [[email protected] ~]$ pip install --upgrade pip
Collecting pip
  Using cached https://files.pythonhosted.org/packages/3d/0c/01014c0442830eb38d6baef0932fdcb389279ce74295350ecb9fe09e048a/pip-20.3.2-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 18.1
    Uninstalling pip-18.1:
      Successfully uninstalled pip-18.1
Successfully installed pip-20.3.2
(test-env) [[email protected] ~]$ pip install --upgrade setuptools
Requirement already satisfied: setuptools in ./test-env/lib/python3.6/dist-packages (51.0.0)
Collecting setuptools
  Using cached setuptools-51.0.0-py3-none-any.whl (785 kB)
  Using cached setuptools-51.0.0.zip (2.1 MB)
  Using cached setuptools-50.3.2-py3-none-any.whl (785 kB)
  Using cached setuptools-50.3.2.zip (2.1 MB)
  Using cached setuptools-50.3.1-py3-none-any.whl (785 kB)
  Using cached setuptools-50.3.1.zip (2.1 MB)
  Using cached setuptools-50.3.0-py3-none-any.whl (785 kB)
  Using cached setuptools-50.3.0.zip (2.2 MB)
  Using cached setuptools-50.2.0-py3-none-any.whl (784 kB)
  Using cached setuptools-50.2.0.zip (2.2 MB)
  Using cached setuptools-50.1.0-py3-none-any.whl (784 kB)
  Using cached setuptools-50.1.0.zip (2.2 MB)
  Using cached setuptools-50.0.3-py3-none-any.whl (784 kB)
  Using cached setuptools-50.0.3.zip (2.2 MB)
^CERROR: Operation cancelled by user
(test-env) [[email protected] ~]$ pip --version
pip 20.3.2 from /home/ec2-user/test-env/lib64/python3.6/dist-packages/pip (python 3.6)
(test-env) [[email protected] ~]$ pip install --upgrade pip==20.3.1
Collecting pip==20.3.1
  Using cached pip-20.3.1-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.3.2
    Uninstalling pip-20.3.2:
      Successfully uninstalled pip-20.3.2
Successfully installed pip-20.3.1
(test-env) [[email protected] ~]$ pip install --upgrade setuptools
Requirement already satisfied: setuptools in ./test-env/lib/python3.6/dist-packages (51.0.0)
(test-env) [[email protected] ~]$

Linux
  1. Cara menginstal perangkat lunak dari baris perintah Linux

  2. Cara Menginstal dan Menggunakan Perintah Ping di Linux

  3. Temukan versi WordPress dari baris perintah

  1. Tox menginstal versi pip yang salah ke lingkungan virtualnya

  2. Apakah mungkin memainkan Quake versi Steam di Ubuntu?

  3. Di mana PHP dapat dieksekusi di Ubuntu?

  1. Cara Menginstal versi OpenSSL terbaru dari Sumber di Linux

  2. Tujuan Perintah 'instal'?

  3. pip tidak dapat menemukan versi yang memenuhi persyaratan django==2.2.1