Query regarding a Python Library while doing NLP course

I am trying to use a library "from utils import process_tweet ", but it’s giving error: ImportError : cannot import name ‘process_tweet’ from ‘utils’ ([C:\Users\apoor\anaconda3\lib\site-packages\utils_init_.py)](file:///C:/Users/apoor/anaconda3/lib/site-packages/utils/init.py))

Need help on this.

Hi @Apoorva_Choudhary

Since you’re running the notebook on your local machine, make sure that you have utils.py in the same directory where the notebook is.


Hi, from where I can get the utils.py?

You can download it the same way you download your notebooks.

You might also find useful how to download all the files. Later in the Specialization there are a lot of files and it would be very painstaking to download them one at a time (if you would want to replicate the results on your own machine).


The Coursera Help articles are maybe not the best for our courses. There is a more DLAI specific article here about how to download all the files. Note that article is linked from the DLS FAQ Thread, which has a lot of items that are not DLS specific, so it’s worth a look in general.

Actually in this case, the Coursera Help article is just out of date: there’s no longer any need to manually create your own tar file, since they added the new “Lab Files” option described on that other thread I linked. I’m pretty sure that’s a Coursera feature, not a DLAI feature, but they just haven’t bothered to update their help items to point it out.

1 Like