Skip to content

chuyicui/basic-python-workshop

Repository files navigation

basic-python-training

Topic 0. Setting up Anaconda environment and managing packages

Why install Anaconda?

Instead of installing Python by itself, we are going to install Anaconda Navigator. Anaconda Navigator is a desktop graphical user interface (GUI) that allows users to launch applications and manage packages, environments and channels without using tons of command-line commands. Also, Anaconda Navigator comes with commonly used packages including SciPy, NumPy, Pandas, and Matplotlib, etc.

Go to page Anaconda distribution: https://www.anaconda.com/distribution/

Choose your operation platform and download Python 3

image

Make sure the directory here does not contain space

image

image

By default, Anaconda comes with the -base environment with hundreds of pre-installed packages.

Screenshot 2023-01-17 at 2 49 07 PM

2. IDEs and their pro and cons in programming

An IDE (Integrated Development Environment) is a software suite that consolidates basic tools required to write and test programs. As the name implies, IDEs usually integrate several tools including:

  • An editor designed to handle code (with, for example, syntax highlighting and auto-completion)
  • Code execution, and debugging tools
  • Console for displaying numerical results and figures
  • more

Lauch Anaconda you will see multiple IDEs. There are more general or specific IDEs, for different languages. For this training, we will be focusing on two IDEs:

image

a. Jupyter Notebooks

The Jupyter Notebook is an IDE that allows you to create and share documents that contain live code (similar to Matlab live script). We are going to develop our initial data analysis and regulotory tasks in Jupyter Notebooks. It is designed for checking results and visualizing data while executing code section by section. It is also great for document your codes in rich text. For further information, refer to https://jupyterlab.readthedocs.io/en/stable/

image

b. Spyder Spyder is an IDE that’s optimized for data science workflows. This IDE we are going to cover in a later workshop. It is a great place to develop longer programs and modules, to review source codes in other people's packages, and to debug. For further information, refer to https://realpython.com/python-ides-code-editors-guide/

image

3. Managing packages in Anaconda directory

  1. use Anaconda GUI

Search packages and click Apply

Screenshot 2023-01-17 at 2 50 48 PM

  1. use conda install in terminal (mac) or anaconda prompt (win)

Apart from widely used packages that came with Anaconda, we often need to install other packages for specific use. Well developed packages would have prepared all different ways for installation, including anaconda install.

  1. use pip install (not recommended)

Some other packages may only support pip install in termimals.

pip is the standard package manager for python, it can install packages inside and outside of Anaconda. So make sure you are using the pip with anaconda. Check and find out by which -a pip. Further info refer to https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#installing-non-conda-packages

Screenshot 2023-01-12 at 6 16 54 PM

Now we are going to install packages in the following list:

About

Going through basic setup for future data management and signal processing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published