ubuntukylin-14.04.2-desktop-amd64中python2.7版本安装机器学习库
2017-07-18 00:00
239 查看
本文永久地址:https://my.oschina.net/bysu/blog/1456737
1.如果需要设置代理才能上网,那么先设置代理。
摘自:http://www.cnblogs.com/foonsun/p/5781767.html
ubuntu 全局代理,特别适合虚拟机nat,公司代理上网,强烈推荐
建立/etc/apt/apt.conf文件
其中写入代理,格式如下:
-----------------------------------------------------------
参考自:http://www.linuxidc.com/Linux/2014-04/100476.htm
2.更换源
可以通过图形界面去更换。
在终端修改和替换源的方法
打开终端,输入命令:
sudo gedit /etc/apt/sources.list
更换完源之后,然后更新:
3.安装numpy+scipy+matlotlib+scikit-learn
由于包之间有依赖关系,建议从上往下的顺序安装
Numpy测试代码
SciPy测试代码
MatPlotLib测试代码
----------------------更新时间:2017年8月10日 23:22:28-------------------------------
今天想安装Python的pandas包,于是执行:
提示如下错误:
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
执行如下命令:
继续安装pandas
还是报错,如下:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
解决方案,执行如下命令:
执行上面的命令之后继续执行
之后再继续运行安装python-pandas的命令,
参考:
http://blog.csdn.net/xiao_lxl/article/details/53159635 http://www.cnblogs.com/ajianbeyourself/p/4214398.html http://blog.csdn.net/sunbibei/article/details/51191452 http://blog.csdn.net/tterminator/article/details/66478221 http://blog.csdn.net/kevin_android_123456/article/details/8174343 http://blog.csdn.net/gudujianjsk/article/details/7893156
linux中python的IDE:https://download.jetbrains.8686c.com/python/pycharm-community-2017.1.5.tar.gz
1.如果需要设置代理才能上网,那么先设置代理。
摘自:http://www.cnblogs.com/foonsun/p/5781767.html
ubuntu 全局代理,特别适合虚拟机nat,公司代理上网,强烈推荐
建立/etc/apt/apt.conf文件
其中写入代理,格式如下:
Acquire::http::proxy "http://192.168.2.200:808/"; Acquire::ftp::proxy "ftp://192.168.2.200:808/"; Acquire::https::proxy "https://192.168.2.200:808/";
-----------------------------------------------------------
参考自:http://www.linuxidc.com/Linux/2014-04/100476.htm
2.更换源
可以通过图形界面去更换。
在终端修改和替换源的方法
打开终端,输入命令:
sudo gedit /etc/apt/sources.list
更换完源之后,然后更新:
sudo apt-get update
3.安装numpy+scipy+matlotlib+scikit-learn
由于包之间有依赖关系,建议从上往下的顺序安装
sudo apt-get install python-numpy sudo apt-get install Python-scipy sudo apt-get install python-matplotlib sudo apt-get install python-sklearn
Numpy测试代码
from numpy import * print random.rand(4,4)
SciPy测试代码
import numpy as np from scipy.stats import beta from matplotlib.pyplot import hist, plot, show obs = beta.rvs(5, 5, size=2000) # 2000 observations hist(obs, bins=40, normed=True) grid = np.linspace(0.01, 0.99, 100) plot(grid, beta.pdf(grid, 5, 5), 'k-', linewidth=2) show()
MatPlotLib测试代码
from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt from matplotlib import cm fig = plt.figure() ax = fig.gca(projection='3d') X, Y, Z = axes3d.get_test_data(0.05) ax.plot_surface(X, Y, Z, rstride=8, cstride=8, alpha=0.3) cset = ax.contour(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm) cset = ax.contour(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm) cset = ax.contour(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm) ax.set_xlabel('X') ax.set_xlim(-40, 40) ax.set_ylabel('Y') ax.set_ylim(-40, 40) ax.set_zlabel('Z') ax.set_zlim(-100, 100) plt.show()
----------------------更新时间:2017年8月10日 23:22:28-------------------------------
今天想安装Python的pandas包,于是执行:
sudo apt-get install python-pandas
提示如下错误:
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
执行如下命令:
sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/dpkg/lock
继续安装pandas
sudo apt-get install python-pandas
还是报错,如下:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
解决方案,执行如下命令:
sudo dpkg --configure -a
执行上面的命令之后继续执行
sudo apt-get update
之后再继续运行安装python-pandas的命令,
参考:
http://blog.csdn.net/xiao_lxl/article/details/53159635 http://www.cnblogs.com/ajianbeyourself/p/4214398.html http://blog.csdn.net/sunbibei/article/details/51191452 http://blog.csdn.net/tterminator/article/details/66478221 http://blog.csdn.net/kevin_android_123456/article/details/8174343 http://blog.csdn.net/gudujianjsk/article/details/7893156
linux中python的IDE:https://download.jetbrains.8686c.com/python/pycharm-community-2017.1.5.tar.gz
相关文章推荐
- 在Win7下安装ubuntukylin-14.04.2-desktop-amd64
- 在anaconda中安装、切换python的版本:2.7~3.6
- ubuntu-16.10-desktop-amd64.iso 版本 安装 oracle 11gR2 11.2.0.1 database
- Windows 7/8.1 下 双版本Python2.7/Python3.5 安装 GPU版的tensorflow
- Centos6.2 安装Python2.7.x 版本
- python2.7版本win7 64位系统安装pandas注意事项_20161226
- Windows8.1硬盘安装ubuntukylin-15.10-desktop-amd64
- Python -- centos6 安装 python2.7版本
- ubuntu16.04安装anaconda(python2.7 版本)
- ubuntu16.04LTS安装tensorflow1.1.0(pip方式/python2.7版本/cpu版本)
- ubuntu-14.04.2-desktop-amd64.iso:ubuntu-14.04.2-desktop-amd64:安装Oracle11gR2
- 在win64位,python64位2.7版本中安装pyHook
- python2.7版本在win7、64位系统安装遇到的问题
- win7 64位安装Python 2.7版本
- Python 2.7版本安装pip,及使用pip碰到的问题
- 系统:win10 IDE:pycharm Python版本:2.7 安装第三方插件是报错: 这里写图片描述 报错原因与编码有关,pip把下载的临时文件存放在了用户临时文件中,这个目录一般是C
- windows8.1 下硬盘安装 ubuntu-14.04.2-desktop-amd64.iso
- ubuntu16.04安装tensorflow(python2.7版本)
- (4)Centos6.X升级Python为2.7版本并安装Pip
- window10下同时安装python2.7和python3.5,并配置sublime ctrl+B选择运行python版本