hopeless-dream

导航

pip通用配置--安装jupyter和ipython

pip是Python的包管理工具,和yum相似

配置pip源

[python@localhost web]$ cd
[python@localhost ~]$ mkdir .pip
[python@localhost ~]$ cd .pip

[python@localhost .pip]$ vim pip.conf
[global]
index-url=https://mirrors.aliyun.com/pypi/simple
trusted-host=mirrors.aliyun.com

pyenv安装

git clone https://gitee.com/krypln/pyenv.git   ~/.pyenv

加入环境变量

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
exec $SHELL

下载python并创建pyenv缓存目录

mkdir $PYENV_ROOT/cache && cd $PYENV_ROOT/cache

wget https://mirrors.huaweicloud.com/python/3.8.6/Python-3.8.6.tar.xz

安装Python-3.8.6

pyenv install 3.8.6

下载pyenv-virtualenv

git clone https://gitee.com/krypln/pyenv-virtualenv.git  $(pyenv root)/plugins/pyenv-virtualenv
 
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
 
exec $SHELL

安装ipython

centos8安装ipython(出现报错:TypeError: __init__() got an unexpected keyword argument 'column或者AttributeError: 'TypeError' object has no attribute 'tb_frame')

yum install -y ipython

增强的Python交互式命令行工具

(zh353) [python@localhost cmdb]$ pip install ipython

安装jupyter

mkdir ~/zh/projects -p

cd zh/projects/

pyenv local 3.8.6

更新pip
/home/python/.pyenv/versions/3.8.6/bin/python3.8 -m pip install --upgrade pip

pip3.8 install jupyter

 

posted on 2020-07-19 00:06  hopeless-dream  阅读(231)  评论(0编辑  收藏  举报