I am running raspbian on my raspberry pi 4. Following the advice here (https://installvirtual.com/how-to-install-python-3-8-on-raspberry-pi-raspbian/) I entered "vim ~/.bashrc" which gave me a ton of info and color and no place to type the next command. I closed the terminal and entered "echo "/usr/local/bin/python3.8" >> .bashrc", "echo "alias python='/usr/local/bin/python3.8'" >> .bashrc", and "source ~/.bashrc". Now my terminal says "Python 3.8.0 (default, Nov 26 2019, 23:20:39)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> " and does not recognize terminal commands. There has to be an easy way to undo this. Please help me get my terminal back.
Solved! Solved! Go to Solution.
If you are at the python prompt (reads ">>>") then type "exit()" without the quotes and you should be back to the normal terminal.
The steps you are struggling with are to make the "python" command invoke python 3.8 rather than the Raspian installed version. So you have these choices:
1. Always use the command "python3.8" to run python 3.8
2. Don't use the "vim" editor, as the blog writer suggests. You can use any other text editor you are comfortable with (Nano; the Raspbian GUI editor) to edit your ".bashrc" file. When editing the ".bashrc" file, you add the two lines that start with the word "echo " to the end of the file, then save it. The "source ~/.bashrc" is a command you type at a terminal window [or just restart your Pi].
[I'm not too impressed with the blog entry: anyone who wants instructions on how to install Python 3.8 is _not_ likely to know how to use vim, nor understands the need for the source command!]
Please follow-up to let us know how you made out. For good karma, mark a reply as the answer if it helped!
Thanks! I will try that when I get a chance! Once I exit, will the terminal continue to open to python or will it return to how it always was? Is there a way to make it so I can just open it and type terminal commands without exiting whatever I am in?
Thanks so much for your help!!!