ERROR: Cannot uninstall ‘PyYAML‘.(仅供参考)

ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.()

$ pip install -U -r requirements.txt
Requirement already up-to-date: Cython in /home/dell/anaconda3/lib/python3.7/site-packages (from -r requirements.txt (line 2)) (0.29.21)
Collecting matplotlib>=3.2.2
  Using cached matplotlib-3.3.1-cp37-cp37m-manylinux1_x86_64.whl (11.6 MB)
Requirement already up-to-date: numpy>=1.18.5 in /home/dell/anaconda3/lib/python3.7/site-packages (from -r requirements.txt (line 4)) (1.19.2)
Requirement already up-to-date: opencv-python>=4.1.2 in /home/dell/anaconda3/lib/python3.7/site-packages (from -r requirements.txt (line 5)) (4.4.0.42)
Requirement already up-to-date: pillow in /home/dell/anaconda3/lib/python3.7/site-packages (from -r requirements.txt (line 6)) (7.2.0)
Processing /home/dell/.cache/pip/wheels/5e/03/1e/e1e954795d6f35dfc7b637fe2277bff021303bd9570ecea653/PyYAML-5.3.1-cp37-cp37m-linux_x86_64.whl
Collecting scipy>=1.4.1
  Using cached scipy-1.5.2-cp37-cp37m-manylinux1_x86_64.whl (25.9 MB)
Collecting tensorboard>=2.2
  Using cached tensorboard-2.3.0-py3-none-any.whl (6.8 MB)
Collecting torch>=1.6.0
  Using cached torch-1.6.0-cp37-cp37m-manylinux1_x86_64.whl (748.8 MB)
Collecting torchvision>=0.7.0
  Using cached torchvision-0.7.0-cp37-cp37m-manylinux1_x86_64.whl (5.9 MB)
Collecting tqdm>=4.41.0
  Using cached tqdm-4.48.2-py2.py3-none-any.whl (68 kB)
Requirement already satisfied, skipping upgrade: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /home/dell/anaconda3/lib/python3.7/site-packages (from matplotlib>=3.2.2->-r requirements.txt (line 3)) (2.4.0)
Requirement already satisfied, skipping upgrade: cycler>=0.10 in /home/dell/anaconda3/lib/python3.7/site-packages (from matplotlib>=3.2.2->-r requirements.txt (line 3)) (0.10.0)
Requirement already satisfied, skipping upgrade: certifi>=2020.06.20 in /home/dell/anaconda3/lib/python3.7/site-packages (from matplotlib>=3.2.2->-r requirements.txt (line 3)) (2020.6.20)
Requirement already satisfied, skipping upgrade: python-dateutil>=2.1 in /home/dell/anaconda3/lib/python3.7/site-packages (from matplotlib>=3.2.2->-r requirements.txt (line 3)) (2.8.0)
Requirement already satisfied, skipping upgrade: kiwisolver>=1.0.1 in /home/dell/anaconda3/lib/python3.7/site-packages (from matplotlib>=3.2.2->-r requirements.txt (line 3)) (1.1.0)
Requirement already satisfied, skipping upgrade: six>=1.10.0 in /home/dell/anaconda3/lib/python3.7/site-packages (from tensorboard>=2.2->-r requirements.txt (line 10)) (1.12.0)
Collecting google-auth<2,>=1.6.3
  Using cached google_auth-1.21.1-py2.py3-none-any.whl (93 kB)
Requirement already satisfied, skipping upgrade: setuptools>=41.0.0 in /home/dell/anaconda3/lib/python3.7/site-packages (from tensorboard>=2.2->-r requirements.txt (line 10)) (41.0.1)
Requirement already satisfied, skipping upgrade: werkzeug>=0.11.15 in /home/dell/anaconda3/lib/python3.7/site-packages (from tensorboard>=2.2->-r requirements.txt (line 10)) (0.15.4)
Collecting grpcio>=1.24.3
  Using cached grpcio-1.32.0-cp37-cp37m-manylinux2014_x86_64.whl (3.8 MB)
Collecting google-auth-oauthlib<0.5,>=0.4.1
  Using cached google_auth_oauthlib-0.4.1-py2.py3-none-any.whl (18 kB)
Collecting protobuf>=3.6.0
  Using cached protobuf-3.13.0-cp37-cp37m-manylinux1_x86_64.whl (1.3 MB)
Collecting tensorboard-plugin-wit>=1.6.0
  Using cached tensorboard_plugin_wit-1.7.0-py3-none-any.whl (779 kB)
Requirement already satisfied, skipping upgrade: wheel>=0.26; python_version >= "3" in /home/dell/anaconda3/lib/python3.7/site-packages (from tensorboard>=2.2->-r requirements.txt (line 10)) (0.33.4)
Collecting markdown>=2.6.8
  Using cached Markdown-3.2.2-py3-none-any.whl (88 kB)
Requirement already satisfied, skipping upgrade: requests<3,>=2.21.0 in /home/dell/anaconda3/lib/python3.7/site-packages (from tensorboard>=2.2->-r requirements.txt (line 10)) (2.22.0)
Collecting absl-py>=0.4
  Using cached absl_py-0.10.0-py3-none-any.whl (127 kB)
Requirement already satisfied, skipping upgrade: future in /home/dell/anaconda3/lib/python3.7/site-packages (from torch>=1.6.0->-r requirements.txt (line 11)) (0.17.1)
Collecting rsa<5,>=3.1.4; python_version >= "3.5"
  Using cached rsa-4.6-py3-none-any.whl (47 kB)
Collecting cachetools<5.0,>=2.0.0
  Using cached cachetools-4.1.1-py3-none-any.whl (10 kB)
Collecting pyasn1-modules>=0.2.1
  Using cached pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
Collecting requests-oauthlib>=0.7.0
  Using cached requests_oauthlib-1.3.0-py2.py3-none-any.whl (23 kB)
Requirement already satisfied, skipping upgrade: importlib-metadata; python_version < "3.8" in /home/dell/anaconda3/lib/python3.7/site-packages (from markdown>=2.6.8->tensorboard>=2.2->-r requirements.txt (line 10)) (0.17)
Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in /home/dell/anaconda3/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard>=2.2->-r requirements.txt (line 10)) (3.0.4)
Requirement already satisfied, skipping upgrade: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /home/dell/anaconda3/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard>=2.2->-r requirements.txt (line 10)) (1.24.2)
Requirement already satisfied, skipping upgrade: idna<2.9,>=2.5 in /home/dell/anaconda3/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard>=2.2->-r requirements.txt (line 10)) (2.8)
Collecting pyasn1>=0.1.3
  Using cached pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
Collecting oauthlib>=3.0.0
  Using cached oauthlib-3.1.0-py2.py3-none-any.whl (147 kB)
Requirement already satisfied, skipping upgrade: zipp>=0.5 in /home/dell/anaconda3/lib/python3.7/site-packages (from importlib-metadata; python_version < "3.8"->markdown>=2.6.8->tensorboard>=2.2->-r requirements.txt (line 10)) (0.5.1)
Installing collected packages: matplotlib, PyYAML, scipy, pyasn1, rsa, cachetools, pyasn1-modules, google-auth, grpcio, oauthlib, requests-oauthlib, google-auth-oauthlib, protobuf, tensorboard-plugin-wit, markdown, absl-py, tensorboard, torch, torchvision, tqdm
  Attempting uninstall: matplotlib
    Found existing installation: matplotlib 3.1.0
    Uninstalling matplotlib-3.1.0:
      Successfully uninstalled matplotlib-3.1.0
  Attempting uninstall: PyYAML
    Found existing installation: PyYAML 5.1.1
ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

解决办法:

$ pip install --ignore-installed PyYAML

以后遇到此类问题,都可以采用此种方法,先忽略掉出问题的包,然后在继续按装自己要安装的包。(虽然这个问题解决了,但不知道有没有遗留问题)

参考博文:https://blog.csdn.net/weixin_42317507/article/details/104667146?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param#commentBox

 

你可能感兴趣的:(python,anaconda,linux,pip,深度学习)