linux多版本python共存

版权声明:原创文章,转载注明出处! https://blog.csdn.net/u010317005/article/details/80386822

可以通过pythonbrew来实现多版本的控制,执行下述命令可以完成pythonbrew的安装

apt-get install python-pip
pip install pythonbrew
pythonbrew_install
[[ -s "$HOME/.pythonbrew/etc/bashrc" ]] && source "$HOME/.pythonbrew/etc/bashrc"

例如通过下述命令,可以安装两个版本的python

pythonbrew install 2.7.2
pythonbrew install 3.2

安装3.2版本,过程如下图所示

切换版本命令如下

pythonbrew switch 2.7.2
pythonbrew switch 3.2

删除版本

pythonbrew uninstall 2.7.2
pythonbrew uninstall 2.7.2 3.2

pythonbrew的所有命令

Usage: pythonbrew COMMAND [OPTIONS]

Options:
  --version   show program's version number and exit
  -h, --help  Show help

Commands available:
  buildout: Runs the buildout with specified or current using python
  cleanup: Remove stale source folders and archives
  help: Show available commands
  install: Build and install the given version of python
  list: List the installed all pythons
  off: Disable pythonbrew
  py: Runs a named python file against specified and/or all pythons
  switch: Permanently use the specified python as default
  symlink: Create/Remove a symbolic link on your $PATH
  uninstall: Uninstall the given version of python
  update: Update the pythonbrew to the latest version
  use: Use the specified python in current shell
  venv: Create isolated python environments
  version: Show version

Further Instructions:
  https://github.com/utahta/pythonbrew

参考文献

https://pypi.org/project/pythonbrew/

https://www.cnblogs.com/liaozhichao/p/4904277.html

猜你喜欢

转载自blog.csdn.net/u010317005/article/details/80386822
今日推荐