Python is a popular language for scientific computing and data science, as well as being a great for general-purpose programming. Installing all of the scientific packages individually can be a bit difficult, so we recommend an using an all-in-one installer, like Anaconda.
Regardless of how you choose to install it, please make sure you install Python version 3.x (e.g., 3.4 is fine).
We will teach Python using the Jupyter notebook, a programming environment that runs in a web browser. For this to work you will need a reasonably up-to-date browser. The current versions of the Chrome, Safari and Firefox browsers are all supported (some older browsers, including Internet Explorer version 9 and below, are not).
We recommend the all-in-one scientific Python installer Anaconda.
bash Anaconda-and then press tab. The name of the file you just downloaded should appear.
yes
and
press enter to approve the license. Press enter to approve the
default location for the files. Type yes
and
press enter to prepend Anaconda to your PATH
(this makes the Anaconda distribution the default Python).
ggplot is a Python implementation of the R ggplot2 graphics package. It is not intended to be a feature-for-feature port of ggplot2 but provides some of ggplot2 functionality in Python ecosystem.
The easiest approach to install ggplot is via conda package manager provided in Anaconda distribution that you have installed above.
conda install -c conda-forge ggplot
and accept when prompted for feedback.
conda install -c conda-forge ggplot
and accept when prompted for feedback.
conda install -c conda-forge ggplot
and accept when prompted for feedback.
Now it is time to make sure that your Anaconda installation was successful. Download check_env.py file which is a Python script that will check if Anaconda has been correctly installed on your system. From your terminal, navigate to the directory that contains check_env.py and execute the following:
python check_env.pyIf you receieve an AssertionError, it will inform you how to correct your installation. Otherwise, it will tell you that your system is good to go and ready for Data Carpentry!