Any reason to try and replace it with something else? I'm a beginner to python, but have encountered problems with C and importing CGI. List of instance where import cgi would not be the best option would be great for further understanding of language use.
List of instance where import cgi would not be the best option

If you're writing a script which will be installed and run as a CGI script on a web server, and you're not using some other framework that replaces it, import cgi is always the best option.
So, the cases where it's not the best option:

You're not writing a CGI script.
You don't need access to FieldStorage or anything else from the gateway.
You're using a framework with its own replacement for cgi.

That's about it.
If you're not sure whether you want to use CGI or not in the first place… you probably don't. If you want the same general style of coding as CGI, WSGI is just as simple, more flexible, and usually faster. 
But if you're just starting at this stuff, that may not even be the style you want. Start at the high level. Do you want to template web pages, or serve JSON to JavaScript code that does the dynamic stuff in the browser? What features do you need on your user sessions? And so on. Once you know what you want, then see if there's a framework—Django, Tornado, CherryPy, whatever—that looks like it'll make your design easier. Only then ask yourself whether you want WSGI, CGI, mod_python, an embedded server, …
Any reason not to just import CGI in Python?