python使用pip安装遇到的一些问题

系统提示没有pip或者pip找不到

如果python安装路径中没有pip的话,需要安装pip,这个网上教程很多的
在这里插入图片描述

如果有pip的话需要配置一下环境变量,这个也是常见的问题了。复制上图中的路径,右击电脑,属性,高级系统设置,环境变量,path,编辑,新建,将复制的路径添加到里面就行了。

在使用pip安装某些包的时候报错

F:\hlx>pip install numpy
Collecting numpy
  Using cached https://files.pythonhosted.org/packages/bf/e8/15aea783ea72e2d4e51e3ec365e8dc4a1a32c9e5eb3a6d695b0d58e67cdd/numpy-1.19.2.zip
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: 'f:\python3.8\python.exe' 'f:\python3.8\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\hony\AppData\Local
\Temp\tmpz64v33w1'
         cwd: C:\Users\hony\AppData\Local\Temp\pip-install-7uzk4grh\numpy
    Complete output (200 lines):
    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
    Cythonizing sources
    blas_opt_info:
    blas_mkl_info:
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries mkl_rt not found in ['f:\\python3.8\\lib', 'C:\\', 'f:\\python3.8\\libs']
      NOT AVAILABLE

这里有很长的错误报告,网上找了好久都没解决,报告末尾会有一段警告,只要按系统提示的升级一下pip版本就可以了。

WARNING: You are using pip version 19.2.1, however version 20.2.4 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

升级后再执行安装命令,如下:

F:\hlx>python -m pip install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/cb/28/91f26bd088ce8e22169032100d4260614fc3da435025ff389ef1d396a433/pip-20.2.4-py2.py3-none-any.whl (1.5MB)
     |████████████████████████████████| 1.5MB 233kB/s
Installing collected packages: pip
  Found existing installation: pip 19.2.1
    Uninstalling pip-19.2.1:
      Successfully uninstalled pip-19.2.1
Successfully installed pip-20.2.4

如果还是不能的话,可以考虑网络问题,某些国外网络访问不到,可以换成国内源。加速pip安装python库的效率

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值