输入pip list以后出现了错误
就是,我刚刚安装jieba库的时候,然后第一次输入成功,然后又输入了python-m pip install--upgrade pip,然后现在输入pip list是这个样子,求帮助
输入pip list以后的代码:
Traceback (most recent call last):
File "c:\users\lenovo\appdata\local\programs\python\python38\lib\runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\lenovo\appdata\local\programs\python\python38\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python38\Scripts\pip.exe_main.py", line 5, in
File "c:\users\lenovo\appdata\local\programs\python\python38\lib\site-packages\pip_internal\cli\main.py", line 9, in
from pip._internal.cli.autocompletion import autocomplete
File "c:\users\lenovo\appdata\local\programs\python\python38\lib\site-packages\pip_internal\cli\autocompletion.py", line 10, in
from pip._internal.cli.main_parser import create_main_parser
File "c:\users\lenovo\appdata\local\programs\python\python38\lib\site-packages\pip_internal\cli\main_parser.py", line 8, in
from pip._internal.cli import cmdoptions
File "c:\users\lenovo\appdata\local\programs\python\python38\lib\site-packages\pip_internal\cli\cmdoptions.py", line 23, in
from pip._internal.cli.parser import ConfigOptionParser
File "c:\users\lenovo\appdata\local\programs\python\python38\lib\site-packages\pip_internal\cli\parser.py", line 12, in
from pip._internal.configuration import Configuration, ConfigurationError
File "c:\users\lenovo\appdata\local\programs\python\python38\lib\site-packages\pip_internal\configuration.py", line 20, in
from pip._internal.exceptions import (
File "c:\users\lenovo\appdata\local\programs\python\python38\lib\site-packages\pip_internal\exceptions.py", line 14, in
from pip._vendor.rich.console import Console, ConsoleOptions, RenderResult
File "c:\users\lenovo\appdata\local\programs\python\python38\lib\site-packages\pip_vendor\rich\console.py", line 36, in
from typing import Literal, Protocol, runtime_checkable
ImportError: cannot import name 'Literal' from 'typing' (c:\users\lenovo\appdata\local\programs\python\python38\lib\typing.py)
怎么修改啊?
或者怎么办啊?
因该是你pip升级之后版本过高导致,可以把pip卸载了重新安装之前的版本
pip 卸载 python -m pip uninstall pip
然后安装之前版本的pip,参考https://blog.csdn.net/weixin_40501429/article/details/117250054
重新安装python
你的python版本是多少啊?如果是3.8及其以上版本,建议安装3.7版本。
python3.8? pip不能用了?
现在可以了,但是输入pip unstall numpy 的时候,出现了C:\Users\lenovo>pip install numpy
Collecting numpy
Using cached https://files.pythonhosted.org/packages/f4/66/17b8e95770478436bf968353c89683ce6f9e14d92e0d4fb3111c09ba18d2/numpy-1.23.2.tar.gz
Installing build dependencies ... done
Installing collected packages: numpy
Running setup.py install for numpy ... error
Complete output from command d:\python\python.exe -u -c "import setuptools, tokenize;file='C:\Users\lenovo\AppData\Local\Temp\pip-install-8r6ur1vb\numpy\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\lenovo\AppData\Local\Temp\pip-record-tqordogo\install-record.txt --single-version-externally-managed --compile:
Running from numpy source directory.
C:\Users\lenovo\AppData\Local\Temp\pip-install-8r6ur1vb\numpy\setup.py:86: DeprecationWarning:
`numpy.distutils` is deprecated since NumPy 1.23.0, as a result
of the deprecation of `distutils` itself. It will be removed for
Python >= 3.12. For older Python versions it will remain present.
It is recommended to use `setuptools < 60.0` for those Python versions.
For more details, see:
https://numpy.org/devdocs/reference/distutils_status_migration.html
import numpy.distutils.command.sdist
Note: if you need reliable uninstall behavior, then install
with pip instead of using `setup.py install`:
- `pip install .` (from a git repo or downloaded source
release)
- `pip install numpy` (last NumPy release on PyPI)
Cythonizing sources
Processing numpy/random\_bounded_integers.pxd.in
Processing numpy/random\bit_generator.pyx
Processing numpy/random\mtrand.pyx
Processing numpy/random\_bounded_integers.pyx.in
Processing numpy/random\_common.pyx
Processing numpy/random\_generator.pyx
Processing numpy/random\_mt19937.pyx
Processing numpy/random\_pcg64.pyx
Processing numpy/random\_philox.pyx
Processing numpy/random\_sfc64.pyx
INFO: blas_opt_info:
INFO: blas_armpl_info:
INFO: No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
INFO: customize MSVCCompiler
INFO: libraries armpl_lp64_mp not found in ['d:\\python\\lib', 'C:\\', 'd:\\python\\libs']
INFO: NOT AVAILABLE
INFO:
INFO: blas_mkl_info:
INFO: libraries mkl_rt not found in ['d:\\python\\lib', 'C:\\', 'd:\\python\\libs']
INFO: NOT AVAILABLE
INFO:
INFO: blis_info:
INFO: libraries blis not found in ['d:\\python\\lib', 'C:\\', 'd:\\python\\libs']
INFO: NOT AVAILABLE
INFO:
INFO: openblas_info:
INFO: libraries openblas not found in ['d:\\python\\lib', 'C:\\', 'd:\\python\\libs']
INFO: get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
INFO: customize GnuFCompiler
WARN: Could not locate executable g77
WARN: Could not locate executable f77
INFO: customize IntelVisualFCompiler
WARN: Could not locate executable ifort
WARN: Could not locate executable ifl
INFO: customize AbsoftFCompiler
WARN: Could not locate executable f90
INFO: customize CompaqVisualFCompiler
WARN: Could not locate executable DF
INFO: customize IntelItaniumVisualFCompiler
WARN: Could not locate executable efl
INFO: customize Gnu95FCompiler
WARN: Could not locate executable gfortran
WARN: Could not locate executable f95
INFO: customize G95FCompiler
WARN: Could not locate executable g95
INFO: customize IntelEM64VisualFCompiler
INFO: customize IntelEM64TFCompiler
WARN: Could not locate executable efort
WARN: Could not locate executable efc
INFO: customize PGroupFlangCompiler
WARN: Could not locate executable flang
WARN: don't know how to compile Fortran code on platform 'nt'
INFO: NOT AVAILABLE
INFO:
INFO: accelerate_info:
INFO: NOT AVAILABLE
INFO:
INFO: atlas_3_10_blas_threads_info:
INFO: Setting PTATLAS=ATLAS
INFO: libraries tatlas not found in ['d:\\python\\lib', 'C:\\', 'd:\\python\\libs']
INFO: NOT AVAILABLE
INFO:
INFO: atlas_3_10_blas_info:
INFO: libraries satlas not found in ['d:\\python\\lib', 'C:\\', 'd:\\python\\libs']
INFO: NOT AVAILABLE
INFO:
INFO: atlas_blas_threads_info:
INFO: Setting PTATLAS=ATLAS
INFO: libraries ptf77blas,ptcblas,atlas not found in ['d:\\python\\lib', 'C:\\', 'd:\\python\\libs']
INFO: NOT AVAILABLE
INFO:
INFO: atlas_blas_info:
INFO: libraries f77blas,cblas,atlas not found in ['d:\\python\\lib', 'C:\\', 'd:\\python\\libs']
INFO: NOT AVAILABLE
INFO:
C:\Users\lenovo\AppData\Local\Temp\pip-install-8r6ur1vb\numpy\numpy\distutils\system_info.py:2077: UserWarning:
Optimized (vendor) Blas libraries are not found.
Falls back to netlib Blas library which has worse performance.
A better performance should be easily gained by switching
Blas library.
if self._calc_info(blas):
INFO: blas_info:
INFO: libraries blas not found in ['d:\\python\\lib', 'C:\\', 'd:\\python\\libs']
INFO: NOT AVAILABLE
INFO:
C:\Users\lenovo\AppData\Local\Temp\pip-install-8r6ur1vb\numpy\numpy\distutils\system_info.py:2077: UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
if self._calc_info(blas):
INFO: blas_src_info:
INFO: NOT AVAILABLE
INFO:
C:\Users\lenovo\AppData\Local\Temp\pip-install-8r6ur1vb\numpy\numpy\distutils\system_info.py:2077: UserWarning:
Blas (http://www.netlib.org/blas/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [blas_src]) or by setting
the BLAS_SRC environment variable.
if self._calc_info(blas):
INFO: NOT AVAILABLE
INFO:
non-existing path in 'numpy\\distutils': 'site.cfg'
INFO: lapack_opt_info:
INFO: lapack_armpl_info:
INFO: libraries armpl_lp64_mp not found in ['d:\\python\\lib', 'C:\\', 'd:\\python\\libs']
INFO: NOT AVAILABLE
INFO:
INFO: lapack_mkl_info:
INFO: libraries mkl_rt not found in ['d:\\python\\lib', 'C:\\', 'd:\\python\\libs']
INFO: NOT AVAILABLE
INFO:
INFO: openblas_lapack_info:
INFO: libraries openblas not found in ['d:\\python\\lib', 'C:\\', 'd:\\python\\libs']
INFO: NOT AVAILABLE
INFO:
INFO: openblas_clapack_info:
INFO: libraries openblas,lapack not found in ['d:\\python\\lib', 'C:\\', 'd:\\python\\libs']
INFO: NOT AVAILABLE
INFO:
INFO: flame_info:
INFO: libraries flame not found in ['d:\\python\\lib', 'C:\\', 'd:\\python\\libs']
INFO: NOT AVAILABLE
INFO:
INFO: atlas_3_10_threads_info:
INFO: Setting PTATLAS=ATLAS
INFO: libraries tatlas,tatlas not found in d:\python\lib
INFO: libraries tatlas,tatlas not found in C:\
INFO: libraries tatlas,tatlas not found in d:\python\libs
INFO: <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
INFO: NOT AVAILABLE
INFO:
INFO: atlas_3_10_info:
INFO: libraries satlas,satlas not found in d:\python\lib
INFO: libraries satlas,satlas not found in C:\
INFO: libraries satlas,satlas not found in d:\python\libs
INFO: <class 'numpy.distutils.system_info.atlas_3_10_info'>
INFO: NOT AVAILABLE
INFO:
INFO: atlas_threads_info:
INFO: Setting PTATLAS=ATLAS
INFO: libraries ptf77blas,ptcblas,atlas not found in d:\python\lib
INFO: libraries ptf77blas,ptcblas,atlas not found in C:\
INFO: libraries ptf77blas,ptcblas,atlas not found in d:\python\libs
INFO: <class 'numpy.distutils.system_info.atlas_threads_info'>
INFO: NOT AVAILABLE
INFO:
INFO: atlas_info:
INFO: libraries f77blas,cblas,atlas not found in d:\python\lib
INFO: libraries f77blas,cblas,atlas not found in C:\
INFO: libraries f77blas,cblas,atlas not found in d:\python\libs
INFO: <class 'numpy.distutils.system_info.atlas_info'>
INFO: NOT AVAILABLE
INFO:
INFO: lapack_info:
INFO: libraries lapack not found in ['d:\\python\\lib', 'C:\\', 'd:\\python\\libs']
INFO: NOT AVAILABLE
INFO:
C:\Users\lenovo\AppData\Local\Temp\pip-install-8r6ur1vb\numpy\numpy\distutils\system_info.py:1902: UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
return getattr(self, '_calc_info_{}'.format(name))()
INFO: lapack_src_info:
INFO: NOT AVAILABLE
INFO:
C:\Users\lenovo\AppData\Local\Temp\pip-install-8r6ur1vb\numpy\numpy\distutils\system_info.py:1902: UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
return getattr(self, '_calc_info_{}'.format(name))()
INFO: NOT AVAILABLE
INFO:
INFO: numpy_linalg_lapack_lite:
INFO: FOUND:
INFO: language = c
INFO: define_macros = [('HAVE_BLAS_ILP64', None), ('BLAS_SYMBOL_SUFFIX', '64_')]
INFO:
Warning: attempted relative import with no known parent package
d:\python\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
running install
C:\Users\lenovo\AppData\Local\Temp\pip-build-env-sp6m6v71\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running config_cc
INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
INFO: build_src
INFO: building py_modules sources
creating build
creating build\src.win-amd64-3.8
creating build\src.win-amd64-3.8\numpy
creating build\src.win-amd64-3.8\numpy\distutils
INFO: building library "npymath" sources
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
Command "d:\python\python.exe -u -c "import setuptools, tokenize;file='C:\Users\lenovo\AppData\Local\Temp\pip-install-8r6ur1vb\numpy\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\lenovo\AppData\Local\Temp\pip-record-tqordogo\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\lenovo\AppData\Local\Temp\pip-install-8r6ur1vb\numpy
这些代码