Send
Close Add comments:
(status displays here)
Got it! This site "robinsnyder.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website. Note: This appears on each machine/browser from which this site is accessed.
Python 3 installation
1. Python 3 installation
Note: These notes are still under development. If you find issues, have questions, or have suggestions, please let me know.
2. Python
Python 2 was discontinued in January 2020. These notes use Python 3.
3. Download
Python can be downloaded and installed from the official Python site.
4. Install
I installed Python to the following path.
D:\Python38
Note: In Windows, the C: drive requires special security settings. I have always kept the Windows
C: drive as a code drive and the Windows
D: drive (created) as a data drive.
In the examples below, change the paths to fit your paths.
5. Portable/flash drive
You can also run Python from a portable hard drive or flash drive.
I plugged a portable hard drive into a lab computer in KEC 119 and was able to run Python from the portable hard drive. In KEC 119 my portable hard drive mounted as drive D:.
6. Pip
The package manager for Python is
pip.exe. For Python 3, one should use
pip3.exe.
D:\Python38\Scripts\pip3.exe
7. Update pip
One often gets an error message that pip should be updated. Here is an example message, on 2019-12-18.
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command
Here is the command I used to upgrade pip.
D:\Python38\python.exe -m pip install --upgrade pip
Here is some of the output on 2019-12-18.
Installing collected packages: pip
Found existing installation: pip 19.2.3
Uninstalling pip-19.2.3:
Successfully uninstalled pip-19.2.3
Successfully installed pip-19.3.1
8. PIL imaging library
The PIL imaging library is used for many Python imaging tasks. Here is the command to install.
D:\Python38\Scripts\pip3.exe install pillow
Here is some of the output on 2019-12-18.
Installing collected packages: pillow
Successfully installed pillow-6.2.1
Other packages are installed in the same manner.
9. Data science
For the data science course, the following Python packages are useful. Here are some of the commands.
D:\Python38\Scripts\pip3.exe install matplotlib
D:\Python38\Scripts\pip3.exe install pillow
D:\Python38\Scripts\pip3.exe install numpy
D:\Python38\Scripts\pip3.exe install scipy
D:\Python38\Scripts\pip3.exe install pandas
D:\Python38\Scripts\pip3.exe install gensim
D:\Python38\Scripts\pip3.exe install nltk
D:\Python38\Scripts\pip3.exe install scikit-learn
(I will expand on each of these packages over time to explain more about each)
We may get to the following.
D:\Python38\Scripts\pip3.exe install jupyterlab
10. Command line
Python can be run from the command line.
Pip can be run from the command line.
In Windows 10, the command line has been replaced with PowerShell. To get the command line back, try the following.
Press Windows-I to open the settings app.
Select "Personalization".
Find the toggle for "Replace Command Prompt with Windows PowerShell in the menu when I right-click the start button or press Windows key+X" and turn it "Off".
Now one can select
Windows-X (power users menu) and select "
Command prompt".
It can be useful to select the icon in the taskbar and select "
Pin to taskbar" to make it easier to start in the future.
11. Idle
Idle is the default (and simple) IDE for Python included with Python.
Here as a command to start Idle.
D:\Python38\python.exe D:\Python38\Lib\idlelib\idle.pyw
Note: This command runs python and has it run the idle python code. After this command is run, the command line window cannot be used until Idle is exited. But one can always open another command prompt.
12. End of page