Introduction and General Issues with Python

Hello,

I work for the Department of Health and Senior Services, and I am taking the AI Supervised Learning sequence with Richard Ng. I am enjoying the lessons. I am taking this sequence because I am interested in applying techniques of Supervised Learning to challenges to population health. If you are curious about this, you are welcome to contact me.

My particular questions here deal with initial installation of Python and its utilities. I am trying to use Python for my first set of projects and I do not know how to install these items:

  1. utils

The error message is as follows …

from utils import *
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘utils’

 2.  >>>matplotlib

The error …

%matplotlib inline
File “”, line 1
%matplotlib inline
^
SyntaxError: invalid syntax

  1. utils.py

I realize that there are files related to the assignments–should I try to copy and paste the code from these files directly into my Python 3.12 window or should I download it and add code to the code given to us for my window to access it???

Your assistance would be greatly appreciated.

All the best,

John

Are you trying to set up your own local environment?

Hello TMosh,

Thanks for the quick response. I do not believe so; I am working on a state government network that is connected to the WWW.

I am working to tap the shoulder of a colleague who has a lot of experience working with Python to help me out.

I will try to run some of the code in the assignments for the first course within the sequence and I will report if I have any issues.

Many thanks!!

John

Hi, John.

If you simply run the assignments on the course website, then all the software packages are already provided for you in that environment. But if you want to take the code from the course notebooks and run it on your own computer, then that’s an entirely different matter. Your best bet is to install one of the popular programming environment apps (so-called "IDE"s for Integrated Development Environment) and run things in that context locally. PyCharm is one example that is particularly oriented around python, but there are many others. If you just search “IDEs for python” you’ll find websites that offer advice. But my guess is that your colleague who is already experienced with python will also have some specific guidance on this question that will be optimized for your local network environment.

Regards,
Paul

Setting up your own local environment can be rather complicated and confusing.

Indeed. There are no “official” instructions because there are just too many possibilities. Are you using Windows or MacOS or linux? Which version of any of those and on and on …

Running locally is beyond the scope of the courses here, but here’s a thread that talks about setting up PyCharm just to give you a sense of the scale of what is involved. If you decide that’s the way you need to go, you can use that to get started down that long and winding road. :nerd_face: