We'll test your Python installation using the command shell for your OS. The command shell is a text-based version of the Windows Explorer or MacOS Finder; it is how we will run Python in this class.
At the bottom of the page, we explain how to get help if all else fails.
Open a command shell window. (If you've never done this before, see our separate page of command-shell instructions.) In that window, type
python
(and hit return). This should put you in the “Python Interactive Shell”; you can tell this succeeded because a Python "banner" message will be printed out, and you'll get the Python ">>>
" (three greater-than signs) prompt. Here are screenshots from a Mac and a Windows computer.
It is possible that you may see a warning under the Python banner about a conda environment that "has not been activated". If so, please ignore that warning, and for CS1110, you don't need to do the "activation" step that the warning mentions. In other words, your installation has still passed Test #1.
(Screenshot courtesy S. Hoogendoorn.)
First, reboot and retry Test #1.
If your command shell still can't find Python, let's figure out where Anaconda Python 3 went (even though the command shell isn't "seeing" it). Copy-paste the appropriate command for your computer, and then hit return:
echo "...started t1-r2..."; ls {/opt,/Applications,~,/Users/Shared/Relocated\ Items/Security}/anaconda3/bin/python 2>/dev/null; echo "...finished t1-r2..."
echo "...started t1-r2..."; ls C:\ProgramData\Anaconda3\python.exe ; echo "...finished t1-r2..."
(Don't type the command; copy-paste it! But if you insist: what is just after the first semi-colon is "LS" but in lowercase; it is not "the number 1 followed by an 's'".)
Look carefully at the output.
If you are here, then one of lines that was printed in step T1-recovery2 says something about "Anaconda" or "anaconda". That line could look like one of the following, and the "directory" we want is the part just before the last slash:
output from the "ls" command | the Anaconda directory |
---|---|
/opt/anaconda3/bin/python |
/opt/anaconda3/bin |
/Applications/anaconda3/bin/python |
/Applications/anaconda3/bin |
C:\ProgramData\Anaconda3\python.exe |
C:\ProgramData\Anaconda3 |
Come to consulting/office hours to have a staff member fix the so-called "path" for your command shell. Or, if you are feeling brave, you can do this yourself:
echo $SHELL
you get back the answer "/bin/zsh
", then the easiest thing to do is to "change your shell from zsh to bash". Follow the directions here: How to change the default shell to bash on macOS Catalina.echo $SHELL
should give you something like /bin/bash
)/bin/zsh
", and Linux), follow the directions given at this page for Windows 10 or this page for Mac OS or Linux to add the Anaconda directory mentioned above to your path.Open a new command-shell window, enter the word "python" (then hit return), and look in the Python "banner" for the words "Python 3.7" or "Python 3.8" and "Anaconda". Here is an example screenshot; it's fine if your "banner" looks different, as long as you see the two words we're looking for.
If not, your system is running the wrong Python for this class. First, try rebooting. If the same problem happens, re-install (sorry) and re-test.
Open a new command-shell window, and start Python in it. At the Python prompt (the three greater-than signs, ">>>
"), enter "1+1"
>>> 1+1
and hit Return (do not type the >>
; it is already there).
If anything other than the appearance of the numeral "2" happens, record the precise output, even if it's a very long error message (copy-and-paste is best) to report the problem to us.
Otherwise, you have a working installation of Anaconda Python 3.7. Hurrah!
To exit the Python Interactive Shell, type quit()
or exit()
and hit Return.
Post a question on Ed Discussions, or talk to someone at office/consulting hours.