本篇文章给大家谈谈Centos7安装ipython和ipython3,以及centos7安装ipmitool的知识点,同时本文还将给你拓展CentOs7同时安装python2、python3,如何创建
本篇文章给大家谈谈Centos7 安装ipython 和 ipython3,以及centos7安装ipmitool的知识点,同时本文还将给你拓展CentOs 7 同时安装python2、python3,如何创建独立的python3运行环境:virtualenv、Centos 7.4 安装ipython和mysql-python遇到的问题、CentOS 7安装Python3.6过程(让linux系统共存Python2和Python3环境)、centos6.5安装ipython等相关知识,希望对各位有所帮助,不要忘了收藏本站喔。
本文目录一览:- Centos7 安装ipython 和 ipython3(centos7安装ipmitool)
- CentOs 7 同时安装python2、python3,如何创建独立的python3运行环境:virtualenv
- Centos 7.4 安装ipython和mysql-python遇到的问题
- CentOS 7安装Python3.6过程(让linux系统共存Python2和Python3环境)
- centos6.5安装ipython
Centos7 安装ipython 和 ipython3(centos7安装ipmitool)
[root@localhost ~]# wget https://pypi.python.org/packages/79/63/b671fc2bf0051739e87a7478a207bbeb45cfae3c328d38ccdd063d9e0074/ipython-6.1.0.tar.gz#md5=1e15e1ce3f3f722da6935d7ac0e51346
[root@localhost ~]# tar xf ipython-6.1.0.tar.gz
[root@localhost ~]# cd ipython-6.1.0
[root@localhost ipython-6.1.0]# pwd
/root/ipython-6.1.0
[root@localhost ipython-6.1.0]# python3 setup.py install
#前提已安装python3,
#linux系统安装python3: http://www.cnblogs.com/chengd/p/7078498.html
[root@localhost ~]# ipython
Traceback (most recent call last):
File "/usr/local/bin/ipython", line 4, in <module>
from IPython import start_ipython
File "/usr/local/lib/python3.6/site-packages/IPython/__init__.py", line 54, in <module>
from .core.application import Application
File "/usr/local/lib/python3.6/site-packages/IPython/core/application.py", line 23, in <module>
from traitlets.config.application import Application, catch_config_error
ModuleNotFoundError: No module named ''traitlets''
#运行ipython是提示缺少''traitlets''模块;
#安装提示一步步通过pip安装缺失模块
[root@localhost ~]# pip install ''traitlets''
直到ipython可以正常运行即可
CentOs 7 同时安装python2、python3,如何创建独立的python3运行环境:virtualenv
- 安装完成python3
- pip3 install virtuallenv
- 检查virtualenv已安装,我的路径 /usr/local/python3/lib/python3.6/site-packages/virtualenv.py
- python3 /usr/local/python3/lib/python3.6/site-packages/virtualenv.py /home/py3new (其中/home/py3new为独立运行环境目录)
- 进入/home/py3new/bin/检查python的版本 python3
Centos 7.4 安装ipython和mysql-python遇到的问题
pip安装ipython报错记录
#pip install ipython==5.5.0
Collectingipython==5.5.0 Downloadinghttp://mirrors.aliyun.com/pypi/packages/08/2c/6285504003b4eadce5540f3ee3adc081468b26723f3eef07d9d5d7d97ed8/ipython-5.5.0-py2-none-any.whl(758kB) 100%|████████████████████████████████|768kB3.9MB/s Requirementalreadysatisfied:pygmentsin/usr/lib64/python2.7/site-packages(fromipython==5.5.0) Requirementalreadysatisfied:setuptools>=18.5in/usr/lib/python2.7/site-packages(fromipython==5.5.0) Requirementalreadysatisfied:backports.shutil-get-terminal-size;python_version=="2.7"in/usr/lib/python2.7/site-packages(fromipython==5.5.0) Requirementalreadysatisfied:traitlets>=4.2in/usr/lib/python2.7/site-packages(fromipython==5.5.0) Requirementalreadysatisfied:simplegeneric>0.8in/usr/lib/python2.7/site-packages(fromipython==5.5.0) Collectingpickleshare(fromipython==5.5.0) Downloadinghttp://mirrors.aliyun.com/pypi/packages/9f/17/daa142fc9be6b76f26f24eeeb9a138940671490b91cb5587393f297c8317/pickleshare-0.7.4-py2.py3-none-any.whl Requirementalreadysatisfied:decoratorin/usr/lib/python2.7/site-packages(fromipython==5.5.0) Collectingprompt-toolkit<2.0.0,>=1.0.4(fromipython==5.5.0) Downloadinghttp://mirrors.aliyun.com/pypi/packages/d1/b0/1a6c262da35c779dd79550137aa7c298a424987240a28792ec5ccf48f848/prompt_toolkit-1.0.15-py2-none-any.whl(247kB) 100%|████████████████████████████████|256kB61.8MB/s Requirementalreadysatisfied:pexpect;sys_platform!="win32"in/usr/lib/python2.7/site-packages(fromipython==5.5.0) Collectingpathlib2;python_version=="2.7"orpython_version=="3.3"(fromipython==5.5.0) Downloadinghttp://mirrors.aliyun.com/pypi/packages/74/4e/68add57f8b993bb5da70c22c7eebb4266c7b66cab15095a1578cc6a62b1a/pathlib2-2.3.0-py2.py3-none-any.whl Requirementalreadysatisfied:ipython-genutilsin/usr/lib/python2.7/site-packages(fromtraitlets>=4.2->ipython==5.5.0) Requirementalreadysatisfied:enum34;python_version=="2.7"in/usr/lib/python2.7/site-packages(fromtraitlets>=4.2->ipython==5.5.0) Requirementalreadysatisfied:sixin/usr/lib/python2.7/site-packages(fromtraitlets>=4.2->ipython==5.5.0) Collectingwcwidth(fromprompt-toolkit<2.0.0,>=1.0.4->ipython==5.5.0) Downloadinghttp://mirrors.aliyun.com/pypi/packages/7e/9f/526a6947247599b084ee5232e4f9190a38f398d7300d866af3ab571a5bfe/wcwidth-0.1.7-py2.py3-none-any.whl Collectingscandir;python_version<"3.5"(frompathlib2;python_version=="2.7"orpython_version=="3.3"->ipython==5.5.0) Downloadinghttp://mirrors.aliyun.com/pypi/packages/77/3f/916f524f50ee65e3f465a280d2851bd63685250fddb3020c212b3977664d/scandir-1.6.tar.gz Installingcollectedpackages:scandir,pathlib2,pickleshare,wcwidth,prompt-toolkit,ipython Runningsetup.pyinstallforscandir...error Completeoutputfromcommand/usr/bin/python2-u-c"importsetuptools,tokenize;__file__='/tmp/pip-build-Ezagxu/scandir/setup.py';f=getattr(tokenize,'open',open)(__file__);code=f.read().replace('\r\n','\n');f.close();exec(compile(code,__file__,'exec'))"install--record/tmp/pip-XwbXPl-record/install-record.txt--single-version-externally-managed--compile: runninginstall runningbuild runningbuild_py creatingbuild creatingbuild/lib.linux-x86_64-2.7 copyingscandir.py->build/lib.linux-x86_64-2.7 runningbuild_ext building'_scandir'extension creatingbuild/temp.linux-x86_64-2.7 gcc-pthread-fno-strict-aliasing-O2-g-pipe-Wall-Wp,-D_FORTIFY_SOURCE=2-fexceptions-fstack-protector-strong--param=ssp-buffer-size=4-grecord-gcc-switches-m64-mtune=generic-D_GNU_SOURCE-fPIC-fwrapv-DNDEBUG-O2-g-pipe-Wall-Wp,-D_FORTIFY_SOURCE=2-fexceptions-fstack-protector-strong--param=ssp-buffer-size=4-grecord-gcc-switches-m64-mtune=generic-D_GNU_SOURCE-fPIC-fwrapv-fPIC-I/usr/include/python2.7-c_scandir.c-obuild/temp.linux-x86_64-2.7/_scandir.o _scandir.c:14:20:fatalerror:Python.h:Nosuchfileordirectory #include<Python.h> ^ compilationterminated. error:command'gcc'Failedwithexitstatus1 ---------------------------------------- Command"/usr/bin/python2-u-c"importsetuptools,'exec'))"install--record/tmp/pip-XwbXPl-record/install-record.txt--single-version-externally-managed--compile"Failedwitherrorcode1in/tmp/pip-build-Ezagxu/scandir/
解决方法:
yum install python-devel libxslt-devel libffi-devel openssl-devel gcc gcc-c++ kernel-devel
CentOS7安装MysqL-python出错
解决方法:
yum install python-devel MysqL-devel zlib-devel openssl-deve
资料:https://www.92ez.com/?action=show&id=23431
CentOS 7安装Python3.6过程(让linux系统共存Python2和Python3环境)
CentOS 7系统自带了python2,不过可以不用2版本,直接使用python3运行python脚本就可以,但是千万别去动系统自带的python2,因为有程序依赖目前的python2环境,比如yum,动了yum就无法运行了,其他有的程序也可能会受影响。明白了上面的,然后就来安装python3.6:
安装步骤:
1. 安装依赖环境
# yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
2.下载python3
https://www.python.org/downloads/
1
|
# wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
|
3.安装python3
包安装在/usr/local/python3(具体安装位置看个人喜好)
创建目录:
1
|
# mkdir -p /usr/local/python3
|
解压下载好的Python-3.6.5.tgz包(具体包名因你下载的Python具体版本,我下载的是python3.6.5这里就以Python-3.6.5.tgz为例)
1
|
# tar -zxvf Python-3.6.5.tgz
|
4.进入解压后的目录,编译安装
如果编译安装过程有报错提示看我的另一个随笔写的解决办法http://www.cnblogs.com/shwee/p/9013851.html
1
2
|
# cd Python-3.6.5
# ./configure --prefix=/usr/local/python3
|
然后:make
1
|
# make
|
接着:make install
1
|
# make install
|
或者两步一起:make && make install
5.安装好了,建立python3的软链
1
|
# ln -s /usr/local/python3/bin/python3 /usr/bin/python3
|
6.并将/usr/local/python3/bin加入PATH
1
2
3
4
5
6
7
8
9
|
# vim ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if
[
-
f ~
/
.bashrc ]; then
. ~
/
.bashrc
fi
# User specific environment and startup programs
PATH
=
$PATH:$HOME
/
bin
:
/
usr
/
local
/P
ython3
/
bin
export PATH
|
按ESC,输入:wq,按回车保存退出编辑。
修改完记得执行行下面的命令,让上一步的修改生效:
1
|
# source ~/.bash_profile
|
检查python3及pip3是否正常可用:
1
2
3
4
|
# python3 -V
Python
3.6
.5
# pip3 -V
pip
9.0
.3
from
/
usr
/
local
/P
ython3
/
lib
/
python3.
6
/
site
-
packages (python
3.6
)
|
出处:http://www.cnblogs.com/shwee/
centos6.5安装ipython
centos6.5安装ipython步骤:
(1)安装easy_install :
# yum install python-setuptools
(2) 更新yum源:
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
64位:
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
(3)安装ipython:
# yum install ipython
(4)安装ipython模块需要的依赖:
# easy_install argparse
至此,可以使用ipython。
关于Centos7 安装ipython 和 ipython3和centos7安装ipmitool的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于CentOs 7 同时安装python2、python3,如何创建独立的python3运行环境:virtualenv、Centos 7.4 安装ipython和mysql-python遇到的问题、CentOS 7安装Python3.6过程(让linux系统共存Python2和Python3环境)、centos6.5安装ipython等相关知识的信息别忘了在本站进行查找喔。
本文标签: