MacOS安装python sklearn库等

本文详细介绍了在MacOS系统中如何管理python库,重点是安装sklearn、numpy、scipy和matplotlib等科学计算库,并通过VSCode进行测试。文章包括查看python版本、更新pip3、安装与测试库以及解决VSCode中Python文件编码问题。
摘要由CSDN通过智能技术生成

一、python库管理

  • 查看python版本
dulei@duleideMacBook-Pro ~ % python -V
Python 2.7.16

  • 查看python安装位置
dulei@duleideMacBook-Pro ~ % where python
/usr/bin/python
  • 更新pip3
pip3 install --upgrade pip
dulei@duleideMacBook-Pro ~ % pip3 install --upgrade pip
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in ./Library/Python/3.8/lib/python/site-packages (21.2.4)
Collecting pip
  Downloading pip-21.3.1-py3-none-any.whl (1.7 MB)
     |████████████████████████████████| 1.7 MB 651 kB/s 
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.2.4
    Uninstalling pip-21.2.4:
      Successfully uninstalled pip-21.2.4
  WARNING: The scripts pip, pip3 and pip3.8 are installed in '/Users/dulei/Library/Python/3.8/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-21.3.1
  • 查看已安装库
dulei@duleideMacBook-Pro ~ % pip3 list
Package    Version
---------- -------
imageio    2.9.0
numpy      1.21.2
Pillow     8.3.1
pip        21.3.1
setuptools 49.2.1
six        1.15.0
wheel      0.33.1
  • 查看可以更新的第三方库
dulei@duleideMacBook-Pro ~ % pip3 list --outdated
Package    Version Latest Type
---------- ------- ------ -----
imageio    2.9.0   2.13.3 wheel
numpy      1.21.2  1.21.4 wheel
Pillow     8.3.1   
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值