SaintKings-Mac-mini:~ saintking$ python
Python 2.7. (default, Jul , ::)
[GCC 4.2. Compatible Apple LLVM 8.0. (clang-800.0.)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> help() Welcome to Python 2.7! This is the online help utility. If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://docs.python.org/2.7/tutorial/. Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules. To quit this help utility and
return to the interpreter, just type "quit". To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics". Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam". help> numpy

>>> import numpy as np

>>> np.multiply(1,3)

3

>>>

numpy安装是完成的.

1.安装numpy

2.安装scipy

3.安装matplotlib

help> scipy

help> matplotlib

经检查都已经安装成功.

测试一下:

>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
File "<stdin>", line , in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/pyplot.py", line , in <module>
from matplotlib.figure import Figure, figaspect
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/figure.py", line , in <module>
from matplotlib.axes import Axes, SubplotBase, subplot_class_factory
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/axes.py", line , in <module>
import matplotlib.dates as _ # <-registers a date unit converter
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/dates.py", line , in <module>
from dateutil.rrule import (rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY,
File "/Users/saintking/Library/Python/2.7/lib/python/site-packages/dateutil/rrule.py", line , in <module>
from six.moves import _thread, range
ImportError: cannot import name _thread

解决一下这个问题.

因为python的版本太低.现在采用3.6

SaintKings-Mac-mini:~ saintking$ which python

/usr/bin/python

mv /usr/bin/python /usr/bin/python_backup

mv /usr/local/bin/python /usr/local/bin/python_backup

>>> import matplotlib.pyplot as plt

在很多时候我们希望忽略过去下载的安装包,直接下载安装可以使用–ignore-installed这个参数,比如我发现的的matplotlib的mplot3d部分有点问题,我想再重新下载安装一遍,可以这么做

这会把相关的包(numpy, pytz, six, python-dateutil, cycler, pyparsing, matplotlib)都下载安装一遍

SaintKings-Mac-mini:~ saintking$ sudo pip install --upgrade --ignore-installed matplotlib

Password:

The directory '/Users/saintking/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

The directory '/Users/saintking/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Collecting matplotlib

Downloading matplotlib-2.1.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (13.2MB)

100% |████████████████████████████████| 13.2MB 77kB/s

Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib)

Downloading pyparsing-2.2.0-py2.py3-none-any.whl (56kB)

100% |████████████████████████████████| 61kB 901kB/s

Collecting numpy>=1.7.1 (from matplotlib)

Downloading numpy-1.13.3-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (4.6MB)

100% |████████████████████████████████| 4.6MB 164kB/s

Collecting pytz (from matplotlib)

Downloading pytz-2017.2-py2.py3-none-any.whl (484kB)

100% |████████████████████████████████| 491kB 442kB/s

Collecting backports.functools-lru-cache (from matplotlib)

Downloading backports.functools_lru_cache-1.4-py2.py3-none-any.whl

Collecting six>=1.10 (from matplotlib)

Downloading six-1.11.0-py2.py3-none-any.whl

Collecting cycler>=0.10 (from matplotlib)

Downloading cycler-0.10.0-py2.py3-none-any.whl

Collecting subprocess32 (from matplotlib)

Downloading subprocess32-3.2.7.tar.gz (54kB)

100% |████████████████████████████████| 61kB 599kB/s

Collecting python-dateutil>=2.0 (from matplotlib)

Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)

100% |████████████████████████████████| 194kB 522kB/s

Installing collected packages: pyparsing, numpy, pytz, backports.functools-lru-cache, six, cycler, subprocess32, python-dateutil, matplotlib

Running setup.py install for subprocess32 ... done

Successfully installed backports.functools-lru-cache-1.4 cycler-0.10.0 matplotlib-2.1.0 numpy-1.13.3 pyparsing-2.2.0 python-dateutil-2.6.1 pytz-2017.2 six-1.11.0 subprocess32-3.2.7

SaintKings-Mac-mini:~ saintking$ python

Python 2.7.10 (default, Jul 30 2016, 18:31:42)

[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import matplotlib.pyplot as plt

>>> plt.bar(left=(0,1),height=(1,0.5))

/Library/Python/2.7/site-packages/matplotlib/__init__.py:1710: MatplotlibDeprecationWarning: The *left* kwarg to `bar` is deprecated use *x* instead. Support for *left* will be removed in Matplotlib 3.0

return func(ax, *args, **kwargs)

<Container object of 2 artists>

>>> plt.show()

>>>

显示出来:

 

mac安装numpy,scipy,matplotlib的更多相关文章

  1. Linux入门(10)——Ubuntu16.04使用pip3和pip安装numpy,scipy,matplotlib等第三方库

    安装Python3第三方库numpy,scipy,matplotlib: sudo apt install python3-pip pip3 install numpy pip3 install sc ...

  2. win7 64+python2.7.12安装numpy+scipy+matplotlib+scikit-learn

    python包下载网址 http://www.lfd.uci.edu/~gohlke/pythonlibs/ 1.已经安装python2.7.12,查看scripts里是否有pip.2.7.9版本以上 ...

  3. Python中安装numpy,scipy,matplotlib安装方法

    这个吧,说简单也简单,说难吧我捣鼓了两天才弄出来,真是头发都急白了.其实只要一个网址就搞定了,嘿嘿 http://www.lfd.uci.edu 这里面有你需要的任何东西,当你运行python imp ...

  4. Windows10+Python3下安装NumPy+SciPy+Matplotlib

    Numpy.SciPy.MatplotLib是Python下从事科学计算必不可少的库.我在用其他的方法安装时出现各种问题,发现直接安装.whl包是最快且不报错的方法. 1.下载.whl包在下面的网站中 ...

  5. Python: Ubuntu 安装numpy,scipy,matplotlib

    安装python-dev 安装这个包,以后安装各种python扩展包,可以省很多事情. sudo apt-get install python-dev 使用apt-get 安装 只需要下面的几个命令即 ...

  6. windows 安装 numpy scipy matplotlib scikit-learn

    直接使用  pip install 包名  的方法安装不成功 下载第三方安装包 下载地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy  根据系统 ...

  7. Ubuntu下安装Numpy, SciPy and Matplotlib

    Python开发环境包含科学计算,需要安装NumPy, SciPy, Matplotlib.其中Matplotlib依赖于Python和NumPy.我们先安装NumPY和SciPy.  Matplot ...

  8. win7系统下python安装numpy,matplotlib,scipy和scikit-learn

    1.安装numpy,matplotlib,scipy和scikit-learn win7系统下直接采用pip或者下载源文件进行安装numpy,matplotlib,scipy时会遇到各种问题,这是因为 ...

  9. [python] 安装numpy+scipy+matlotlib+scikit-learn及问题解决

    这篇文章主要讲述Python如何安装Numpy.Scipy.Matlotlib.Scikit-learn等库的过程及遇到的问题解决方法.最近安装这个真是一把泪啊,各种不兼容问题和报错,希望文章对你有所 ...

随机推荐

  1. [2018-03-06] 基于Django的轻量级CMS Mezzanine搭建笔记

    一丶什么是Mezzanine? 它是基于django的内容管理平台(),组成简单,可扩展性和定制性强,特别是个小型的个人博客系统.它也提供了类似wordpress的管理页面.博客发布.图片展示等功能, ...

  2. [wcp部署]Linux(Ubuntu)安装部署WCP

    1.安装JAVA运行环境 配置环境变量及安装jdk mkdir /usr/local/java tar -zxvf jdk-8u31-linux-x64.gz #解压jdk包 mv jdk1.8.0_ ...

  3. beacon帧字段结构最全总结(一)——beacon基本结构

    一.beacon帧主要结构 二.MAC  header 1.Version:版本号,目前为止802.11只有一个版本,所以协议编号为0 2.Type:定义802.11帧类型,802.11帧分为管理帧( ...

  4. vue的路由安全验证

    在传统的网页中: view层是由后端控制的,用户的请求到达后端的控制器中,只有当安安全全没有丝毫异常的情况下,后端才会将完成数据的渲染,返回给前端视图 前后端分离的项目: view层的切换权,转交给了 ...

  5. Nginx做缓存服务器

    Nginx做缓存服务器 Nginx配置 1.主配置/etc/nginx/nginx.conf worker_processes 1; events { worker_connections 1024; ...

  6. [复现论文程序图]High Speed Continuous Variable Source-Independent Quantum Random Number Generation

    这次的任务是复现该文章的图2(C),过程如下. ①翻译了整篇文章,断断续续,花了3-4天时间. ②阅读文章,并且记录下每个符号的意义,记在单独的1个word文档里. ③开始编程,用的matlab201 ...

  7. Python常用模块之os.path

    os.path.abspath(path) 输入相对路径,返回绝对路径 Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1 ...

  8. Pod镜像拉取策略imagePullPolicy

    默认值是IfNotPresent Always 总是拉取: 首先获取仓库镜像信息, 如果仓库中的镜像与本地不同,那么仓库中的镜像会被拉取并覆盖本地. 如果仓库中的镜像与本地一致,那么不会拉取镜像. 如 ...

  9. FPGA基础(verilog语言)——语法篇(续1)

    上一篇文章提到了FPGA中一个模块基本结构,这篇文章开始介绍语法. 首先,我们学习一门语言都要从这门语言的单词学起,所以verilog中的关键词都有哪些呢?看下面: A:always.assign B ...

  10. Java工作流系统-驰骋BPM工作流 引擎的工作模式

    关键字:驰骋工作流引擎 流程引擎工作模式 流程中间件工作模式  工作流快速开发平台  工作流流设计  业务流程管理   asp.net 开源工作流bpm工作流系统  java工作流主流框架  自定义工 ...