Python学习小计

时间:2023-03-09 04:57:02
Python学习小计

1、初学Python最好选择2.7版本,因为大部分Python书籍的示例代码是基于这个版本的

2、Python安装可以参考百度经验完成

如果在电脑上同时安装2个版本,则CMD启动时只需要:

py -2.7 启动2.7版

py -3.5启动3.5版

在运行脚本时 同样  py -2.7  D:\test.py 表示用python2.7运行

3、通过pip方式安装必要的包pandas、matplotlib
pip一般随python进行安装,一般在安装目录的x:\Python xx\Scripts下,
具体使用时cmd 到x:\Python xx\Scripts下,然后输入 pip.exe install pandas
具体见:http://jingyan.baidu.com/article/466506583fec5af549e5f825.html

注意:如果电脑上安装两个版本的python,则需要在各自的pip文件夹下安装,不能通用。

4、windows install scipy 错误:numpy.distutils.system_info.NotFoundError: no lapack/blas resources found

原因:安装scipy,必须和自己的电脑系统位数(32或64),还有python版本有关

解决方案是:从http://www.lfd.uci.edu/~gohlke/pythonlibs/上下载相应的版本,然后通过cmd安装,

例如我将包放到C:\Python27\Scripts,然后cmd到这个路径,pip install scipy-0.19.1-cp27-cp27m-win_amd64.whl