〖最全〗pycharm+ipython notebook搭建(for mac)

由于工作的需要,准备着手学习Python,并利用Python进行数据分析。工欲善其事,必先利其器。本文全面介绍:

①Python IDE–pycharm的安装及使用;

②ipython notebook 的web-server搭建;

③ipython notebook 科学计算环境搭建;

1.pycharm的安装及使用

pycharm是由JetBrains打造的,目前非常流行的Python IDE,pycharm的主界面如下:

《〖最全〗pycharm+ipython notebook搭建(for mac)》
《〖最全〗pycharm+ipython notebook搭建(for mac)》

安装完成后,创建一个新的项目:

《〖最全〗pycharm+ipython notebook搭建(for mac)》

创建一个pure python项目,选择project存储位置及注释器interpreter:

interpreter的选择时,系统会默认有自带的interpreter:这里是mac自带的Python2.7.1。然后点击create

《〖最全〗pycharm+ipython notebook搭建(for mac)》

在united1下可以创建新的文件file或者是directory,甚至可以编写一个Python package,这里选择file:

《〖最全〗pycharm+ipython notebook搭建(for mac)》 在文本中输入print”hello,world!”

发现文本右上角的运行是灰色,无法运行,此时需要添加调试配置信息配置:

《〖最全〗pycharm+ipython notebook搭建(for mac)》 点击edit configurations,进入配置对话框

《〖最全〗pycharm+ipython notebook搭建(for mac)》 点左上角的+,选择Python

《〖最全〗pycharm+ipython notebook搭建(for mac)》 点击OK,进入主界面,发现运行按钮变绿

《〖最全〗pycharm+ipython notebook搭建(for mac)》 这样一个Python文件就正常的执行了

在pycharm上使用ipython notebook可以参考官方文档:

http://confluence.jetbrains.com/display/PYH/Using+IPython+Notebook+with+PyCharm

2.ipython notebook 的web-server搭建

搭建web-server的前提是mac上已经安装了ipython,熟悉pip或brew的朋友,可以通过其进行安装。另外ipython仅仅是科学计算的第一步,ipython notebook还依赖于tornado 和pyzmq.最后进入终端,输入ipython notebook,

《〖最全〗pycharm+ipython notebook搭建(for mac)》 跳转到本地web页面

《〖最全〗pycharm+ipython notebook搭建(for mac)》 此处注意,官网或部分参考资料上说是跳转到127.1.1.0:8888,非也,目前均指向jupyter

进入Jupiter页面后,进入设定好的project文件夹,创建新的ipynb文件,并选择python2:

《〖最全〗pycharm+ipython notebook搭建(for mac)》 就可以在页面端run

3.基于云的ipython notebook 科学计算环境的搭建

进入免费云平台:http://www.ptopenlab.com 注册账号

通过选择预装软件计算服务(Pre-installed compute service), 进入预装好的开发环境镜像列表.

选择“Python科学计算及应用开发环境”,点击“启动”。在如下弹出框继续选择“启动”。

《〖最全〗pycharm+ipython notebook搭建(for mac)》

根据要求登录并配置开发环境

    原文作者:WAY2DataSci
    原文地址: https://www.jianshu.com/p/f2ba798109ca
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞