![]() ![]() # update-alternatives -install /usr/bin/python python /usr/bin/python3.4 2 Update-alternatives: using /usr/bin/python2.7 to provide /usr/bin/python (python) in auto mode For this reason we need to update our alternatives table and include both python2.7 and python3.4: # update-alternatives -install /usr/bin/python python /usr/bin/python2.7 1 The above error message means that no python alternatives has been recognized by update-alternatives command. Update-alternatives: error: no alternatives for python Logged in as a root user, first list all available python alternatives: # update-alternatives -list python To change python version system-wide we can use update-alternatives python command. ~/.bashrcĬheck your default python version: $ python -versionĬhange python version system-wide with update-alternatives python Once you make the above change, re-login or source your. ![]() Open ~/.bashrc file and add new alias to change your default python executable: alias python='/usr/bin/python3.4' ![]() To change a python version on per user basis you simply create an alias within user’s home directory. If that command doesn’t work, try with python3 command instead: $ python3 -version $ – requires given linux commands to be executed as a regular non-privileged user # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command Privileged access to your Linux system as root or via the sudo command. Requirements, Conventions or Software Version Used How to change from default to alternative Python version on Debian Linux Software Requirements and Linux Command Line Conventions Category How to install multiple python versions.This will allow you to run various Python programs including legacy scripts. In this tutorial, you will see how to install multiple versions of python, and change the python version on Debian using the update-alternatives python command. Your Debian Linux installation may include multiple Python versions and thus also include multiple Python binary executables, and it’s possible to change the python version that the system is using. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |