您的位置:首页 > 编程语言 > Python开发

ubuntu安装Python环境以及科学计算环境

2015-10-31 21:58 651 查看
参考:http://blog.csdn.net/a1311543690/article/details/48878843


1.sudo apt-get install python-pip

pip是Python的一个安装和管理扩展库的工具。同时会提示下载安装依赖包

2.sudo apt-get install python-dev

sudo apt-get install python-matplotlib

下载安装python

  直接输入:python就可以运行

  cd 进入文件夹

ls察看文件夹文件

3. 进入文件夹后直接:python 1.py 即可运行

cd -返回上一级目录

4.sudo easy_install numpy安装numpy科学计算板块

sudo easy_install pandas

安装过程中遇到error: Setup script exited with error: command 'gcc' failed with exit status1

  解决方法:(并没有解决问题)
  $ sudo apt-get install gcc

  $ sudo apt-get install python-dev

  $ sudo apt-get install libxml2 libxml2-dev

  $ sudo apt-get install libxslt1.1 libxslt1-dev

gcc: error trying to exec 'cc1plus': execvp: 没有那个文件或目录

  首先安装gcc和g++及一些依赖包

  sudo apt-get install build-essential

保证gcc(c语言编译器)和g++(c++编译器)版本号一致:察看版本号 g++ -v

终于安装好了pandas板块

5.安装jieba中文分词 sudo easy_install jieba

  遇到超时或不FQ无法下载的问题

  1.解决方案http://www.xuebuyuan.com/1157602.html

  sudo pip install Theano -i http://pypi.v2ex.com/simple
sudo pip install Theano -i http://e.pypi.python.org/simple
  2.、解决办法,增加
--default-timeout=100
,加大超时时间。如:

  C:Usersluohui>pip –default-timeout=100 install zope.interface

6.安装keras ,和theano时候遇到较大问题

  提示:Rolling back uninstall of scipy

然后卸载和重新安装了几次之后,奇迹的就好了,也不知道是什么原因

  sudo pip uninstall scipy


sudo pip install scipy

然后试一试>>>python

     >>>import keras

     >>>import theano

就成功了

7.使用keras

  

http://www.bubuko.com/infodetail-777299.html 易用的深度学习框架Keras简介 http://www.bubuko.com/infodetail-792731.html 深度学习框架Keras的使用-进阶


  遇到No module named six.moves

  >>>sudo pip install six

  遇到Exception: Layer is not connected. Did you forget to set "input_shape"?

  I am pretty sure this worked with older version of Keras and I cannot find the way how it should work with new version.

    (https://github.com/fchollet/keras/issues/816)

  >>>
pip install keras==0.1.3


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: