ubuntu中python2与python3的默认启动切换

ref:https://www.cnblogs.com/xia-Autumn/p/6683076.html

方法摘自SegmentFault:

方法一:



echo alias python=python3 >> ~/.bashrc && source ~/.bashrc
相当于先打开gedit ~/.bashrc 修改alias python=python3这行内容

方法二(使用update-alternatives来修改priority):

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150
如果要切换到python2
sudo update-alternatives --config python

按照提示输入选择数字回车即可。

这样你甚至可以将自己喜欢的任意版本python安装到任意位置,然后使用update-alternatives将其设置为系统默认python。

 

umap install

sudo apt install python3-numpy
sudo apt install python3-scipy
sudo apt install python3-sklearn
sudo apt install python3-numba
sudo apt install python3-matplotlib

sudo apt-get install llvm-10-dev
cd /usr/bin
sudo ln -s llvm-config-10 llvm-config

export LLVM_CONFIG=/usr/bin/llvm-config

sudo pip3 install joblib==0.16 -i https://pypi.tuna.tsinghua.edu.cn/simple
sudo pip3 install llvmlite==0.33 -i https://pypi.tuna.tsinghua.edu.cn/simple
sudo pip3 install pynndescent -i https://pypi.tuna.tsinghua.edu.cn/simple

https://github.com/lmcinnes/umap

https://github.com/lmcinnes/pynndescent

你可能感兴趣的:(管理,linux,python)