first one python script:
[email protected] ~]# cat helloworld.py
Print ("Hello World")
[email protected] ~]# python helloworld.py
Hello World
Install python3 and ipython Overall environment, very troublesome, not pay attention will often error, installation is not successful, toss a day to fix, the process record as follows:
First step: Install python3.5
1. CentOS 6.5 Installing Python 's dependency package
Yum Groupinstall "Development tools"
Yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel Libpcap-devel Xz-devel
2. Download the Python3.5 source package and compile it
wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz
Tar XF python-3.5.0.tgz
CD Python-3.5.0
./configure--prefix=/Application/python--enable-shared
Make
Make Install
Ln–s/application/python/bin/python3/usr/bin/python3
3. You need to configure the library before running Python:
Echo/usr/local/lib >>/etc/ld.so.conf.d/local.conf
Ldconfig
4. Run the Demo:
Python3--version
Python 3.5.0
5. Delete the libraries needed tocompile Python , of course, it can not be deleted
Yum Groupremove "Development tools"--remove-leaveas
Yum Remove Zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel L Ibpcap-devel Xz-devel--remove-leaves
6, set up aliases for easy use , or you can not set
Alias Py=python3
Step Two: Install Ipython3
1, need to install setup-tools
Address: Https://pypi.python.org/pypi/setuptools
Decompression Unzip Setuptools-36.5.0.zip
CD setuptools-36.5.0
/application/python/bin/python3 setup.py Install
2. Install pip
Address: Https://pypi.python.org/pypi/pip
Tar XF pip-9.0.1.tar.gz
CD pip-9.0.1
/application/python/bin/python3 setup.py Install
A few folders named Pip pip3 pip3.5 are generated under /application/python/bin , stating that the pip The module has been packaged into a python environment.
3. Installing python-setuptools and python-setuptools-devel
Install with yum installation
4. Installing Ipython
Address: Https://pypi.python.org/pypi/ipython
Tar XF ipython-6.0.0.tar.gz
CD ipython-6.0.0
/application/python/bin/python3 setup.py Install
5. Configuring soft links or adding system environment variables
Ln-s/application/python/bin/python3/usr/bin/python3
Ln-s/application/python/bin/ipython3/usr/bin/ipython3
Ln-s/application/python/bin/ipython/usr/bin/ipython
Python3, Ipython3, Setup-tools, Pip and other environmental construction detailed summary