Python - Hello World 2015-3-31

优秀项目:html

Twitter Stormjava


解释型语言python


1shell

https://www.python.org/downloads/ windows

其中Windows x86-64 embeddable zip file,即为绿色版(免安装)app

绿色版2.7[在用] http://download.csdn.net/download/ricyn/8755279 dom

绿色版33 http://download.csdn.net/download/amwswceud/5727069 python2.7


2 dos>pythonui

100+22url

python hello.py

print('Hello World!')



NumPy

1 安装setuptools https://pypi.python.org/pypi/setuptools#windows-powershell-3-or-later

不然出现 "no module named setuptools"

python ez_setup.py


下载完成后双击执行安装文件,便可在D:\Program Files\python2.7\scripts下安装easy_install。包含一个easy_install.exe,而后进行环境变量设置,在系统环境变量中作以下设置:

(也就是将D:\Program Files\python2.7\scripts添加到环境变量中)


2 安装VCForPython27http://www.microsoft.com/en-us/download/confirmation.aspx?id=44266

不然出现如下错误

error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get

it from http://aka.ms/vcpython27


3 安装pip

http://jingyan.baidu.com/article/e73e26c0d94e0524adb6a7ff.html

 easy_inatall pip


4 安装 python-dev,直接输入如下命令安装, 不然出来如下错误

pip install python-dev

    "Cannot compile 'Python.h'. Perhaps you need to "

SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.


5 安装 pyopenssl ndg-httpsclient pyasn1,不然出现

pip install pyopenssl ndg-httpsclient pyasn1

packages\urllib3\util\ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately a

nd may cause certain SSL connections to fail. For more information, see https://

3 安装NumPy

http://sourceforge.net/projects/numpy/files/latest/download?source=files

python setup.py install

or

pip install numpy


用上安装版python一切正常

1 python-2.7.7.amd64.msi

pip install numpy


验证numpy是否正确安装

from numpy import *

random.rand(4,4)

randMat=mat(random.rand(4,4))

invRandMat=randMat.I

randMat*invRandMat

myEye=randMat*invRandMat

myEye-eye(4)


23/296

相关文章
相关标签/搜索