Welcome!
This course requires knowledge of Python (the requirement is listed in the course description). If you do not know Python, you will not do well and the course will be harder than it already is.
We will be using Slack this semester for course communication/discussion. Please make sure you have Slack installed on your computer before the semester starts. You will be given a link for the course Slack workspace when the course starts.
Note: This may be different for Section 82, with Dr. Shane Strasser
The course requires a specific programming style. That style is introduced in the following programming video:
- You are very strongly encouraged to use a computer upon which you have administrator/superuser privileges. I cannot help you with problems associated with the installation of software and libraries.
- You may have an easier time if you use "Unix"-style operating system (MacOS or Linux flavor) either directly or in a virual environment (Docker or VirtualBox). It's not required.
- You should have your environment up and running before the semester starts but no later than the 2nd day of class. There is a test assignment due that Wednesday.
- Install Anaconda for Python for your operating system: Anaconda.
- Set
libmamba
to be the default solver:$ conda config --set solver libmamba
Note if this fails, you need to update Conda. - Create a directory/folder for AI and move ("cd") into it.
- Download environment.yml into your directory (or just copy the Raw content, paste it into a file named
environment.yml
, and save it). - Execute
conda env create -f environment.yml
- You now have all the libraries needed for the course (as of now).
- Activate the new conda environment:
conda activate en605645
. Important the next step will not work correctly if you don't activate the en605645 environtment. - Set up Jupyter notebook to use this environment:
python -m ipykernel install --user --name en605645 --display-name "Python (en605645)"
NB: You "must" use this Anaconda environment and the "en605645" kernel for this class. Failure to do so has consequences that are your responsibility. These consequences may include getting a zero on assignments.
Do not use a regular code editor for you assignments. Instead use something that can correctly edit and display Jupyter notebooks (ie, Jupyter Notebooks, VS Code, etc.).
Once the class has started, you will be able to download the Jupyter notebooks for each module. In the interim, you may want to get a feel for the environment in which you'll be working. Use the following commands:
conda activate en605645
- this will activate the environment. (Useconda env list
to see your installed environments).jupyter notebook
- this will start the Jupyter notebook environment with the current directory as the root.- When you create a new Jupyter notebook, you can select "Python (en605645)" as the kernel.
Note - jupyter notebook
is eventually be "sunsetted" in favor of jupyter lab
.
If you want to use jupyter lab
, that's fine...I seem to have more memory problems with lab
, though, and not all extensions are/were/will be ported from notebook
to lab
. (August 2023 - I don't think notebook is sunsetted yet...).
When you're done, you can invoke conda deactivate
.
You should download the following two files and put them in your AI directory:
After the quick overview, install your environment and download the two files above, putting them in the referenced AI directory/folder.
- Python 3
- PEP8
- Jupyter notebooks (YouTube)
- Jupyter Notebooks for Beginners (blog)
- Advanced Jupyter Notebooks (blog)
- Markdown
Codewars is a great way to increase fluency with Python. Look for idiomatic Python solutions.
Trouble-shooting for install
environment.yml
:Sometimes you will run into permission issues when trying to write to the
/opt/anaconda3/pkgs/cache
directory. The main reason is that the Conda installation is in a system-level directory that requires elevated permissions for certain operations. You can run the command withsudo
to give it the necessary permissions:sudo conda env create -f environment.yml