Did try the following

import gzip
f = gzip.open('myfile.gz','rb')

But then got the error

AttributeError: 'module' object has no attribute 'open'

What I really should have done was to read the whole error stack

Traceback (most recent call last):
  File "gzip.py", line 1, in module
    import gzip
  File "d:\test-py\gzip.py", line 13, in 
    fileHandler = gzip.open(pathToGzFile)
AttributeError: 'module' object has no attribute 'open'module

While testing I had named my file

gzip.py

causing Python to believe that I meant “import the script I am testing”. Renamed the file to testgzip.py and it all works fine (name can be whatever, but do not name the file the same as a module you are importing)

During this I found a nice way to pretty print (pprint) the attributes of a module/object in Python, see StackOverflow