Installation python3, ipython, jupyter

Installation python3

1. Download python3 source, as selected 3.6.7 ipython environment depends on the python> 3.6
https://www.python.org/ftp/python/3.6.7/Python-3.6.7.tar.xz wget
2. Solutions compressed source package, removing suffixes xz
xz -d-3.6.7.tar.xz the Python
3. decompressed source package, remove the suffix .tar
the tar-3.6.7.tar -xf the Python
4. python3 solution compiled and installed the software needed it is important rely ********
NOTE: to solve these dependencies late to the normal operation of python3.6,
if not resolved, there will be all kinds of error message, then have to re-compile python3.6
yum install gcc Patch libffi -devel python-devel zlib-devel bzip2 -devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel -y

5. Start build and install the
trilogy
configure the underlying source package 1. call path to the script file
./configure --prefix = / opt / python36 /

2. make execution instruction, the compiler starts (this step does not generate further / opt / python36 this folder)
# this compilation is what the hell?
- Translation python interpreter is translating the code line by line, and converted into machine code to perform
Print ( 'Hello World')

python script .py

- compilation, compiled language, before running the code, a process of compilation , (the code, compiled into a binary file conversion)
- C
- C ++
- Java
- golang
main.go
fmt.Println ( 'Hello World')

Go RUN main.go


Go main.go # compiler to generate an executable command build
- generated under the window a main.exe
- main




3. make install to install the software (this step is the installation of software)
- will generate a / opt / python36 software installation path
make install

6. compile and install ok, after not being given, you can normally use the python3
7. quick way of using python3.6
the following configuration, a second election, you choose the configuration path

1. flexible connection (This step is very troublesome, and not for creating the virtualenv)
LN /opt/python36/bin/python3.6 -s / usr / bin / python3 # but this step has not yet PIP
LN -s / opt / python36 / bin / PIP3 / usr / bin / PIP3

2 Configuring environment variables
1.echo the PATH $
/ usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / root / bin
2. configuration directory python36, adding environment variables
stressed! ! !
Emphasize! ! !
Emphasize! ! !
Find the path path because there is a priority order! ! !

And in the configuration virtualenv when the first priority to environment python found in the environment as a base

into the path of the directory # Please python36 first layer
/ opt / python36 / bin /: / usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / root / bin:

3. configuration environment variable, permanent, written to the file / etc / profile in every time you log into force on

vim / etc / profile # this configuration wrote lowest row
PATH=/opt/python36/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

source / etc / profile # read the file, so that the entry into force python3

8. At this time properly use python3 it!

9. Check all the folders python relationship
[root @ s14linux / opt 11:05:09] #ls
python36 (this works, it is safe python3 number of packages directory)
Python-3.6.7 (the source code is python3 folder can be deleted after a successful installation)
Python-3.6.7.tar can be deleted







9. pip upgrade tool, pip upgraded version
pip3 install --upgrade pip


Installation ipython interpreter
1. Install ipython, specify download source douban
pip3 install -i https://pypi.douban.com/simple ipython

2. Install Zhu Pitt
pip3 install -i https://pypi.douban.com/simple jupyter


3. ipython into the environment, to jupyter password
ipython # ipython into the interactive interface

from IPython.lib import passwd

passwd () # generate login password jupyter

 

4. Generate a profile jupter
jupyter notebook --generate-config --allow-root

vim ~/.jupyter/jupyter_notebook_config.py

Same configuration can be modified as follows, uncomment to read the code #

c.NotebookApp.ip = 'is recommended to write the current linux machines ip address'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8000

6. Start Zhu Pitt
jupyter notebook --allow-root # Start notebook

ip: 8000 port visit your page jupyter


7. If you can not start, most likely a firewall issue

iptables -L # View Rules

Clear rules iptables -F #


systemctl stop firewalld # turn off the firewall service

systemctl disable firewalld # from the boot from the start, removing the firewall service, permanently closed

# There was a selinux closed
1. getenforce see selinux rule
2. temporarily closed selinux setenforce 0

Note
permanently closed selinux, need to restart to take effect
vim / etc / selinux / config
write the following configuration
SELINUX = disabled
# restart the server to take effect, selinux permanently disabled

Guess you like

Origin www.cnblogs.com/mengxiangqun/p/11535191.html