Hello,
Do you happen to have 2 versions of python installed on your laptop? You say that you are using python3 but are you starting it by typing python or python3 in the terminal?
I saw the kind of problem you mention on linux machines which still have python2 as the default version (and can be launched using python), but also package python3, which is usually launched using python3. It is easy to forget to call the correct version of python
Rather than calling the script the way you do, run
python extract-proper-nouns proofs.txt > nouns.txt
(or try python3)
As good practice, I would rename the script from extract-proper-nouns to extract-proper-nouns.py
Good luck