python2.7安装matplotlib,在python 2.7中为plotly和matplotlib创建环境

I managed to install on my conda the plotly package with:

conda install -c plotly plotly

And the matplotlib with:

conda create --name mpl33 python=3.3 matplotlib ipython-notebook

But I cant create one env with both of them inside because the plotly uses python 2.7 and matplotlib python 3.3

Thanks for the help!

解决方案

Installation

If you create a new environment, I would recommend using a new python version. Currently, I'd use python 3.6, because matplotlib does not support python 3.3 anymore.

So first create a conda environment with python 3.6; I name it plotenv here:

> conda create --name plotenv python=3.6

Next install matplotlib to it,

> conda install --name plotenv matplotlib

Finally install plotly to it,

> conda install --name plotenv -c plotly plotly

Done.

Console usage

Don't forget to activate the environment if you want to use it via source activate plotenv (on linux) or activate plotenv (on windows).

> activate plotenv

You may then start python

(plotenv) > python

and import any of the installed submodules, e.g.

>>> from mpl_toolkits.axes_grid1 import ImageGrid

Usage with Jupyter

In case you want to use jupyter notebook with the newly created environment, you need to install it first,

> conda install --name plotenv ipython jupyter

and then run the following inside this environment:

(plotenv) > python -m ipykernel install --user --name plotenv

Now, starting juypter

(plotenv) > jupyter notebook

would give you the option to create a new notebook with this environment:

u5zPw.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值