I understand that Coursera Labs is the sandbox that allows students to work on each assignments.
I was wondering if there was an alternative workflow where we can work on each assignment from our local machine (including all test files) and then upload the assignment when ready for submission so we don’t need an internet connection to work on the assignments or if Coursera Labs is down like it was the other day.
I see the post about downloading assignments but I’m not sure how to work on the assignment once it’s downloaded.
If I were to guess it would be this:
download python
download Jupiter notebook
for each assignment download entire notebook using link above
when assignment is complete go to Coursera Labs and click “Work in browser” button associated with assignment and then upload assignment from local machine to Coursera Labs.
Is this correct? Can you provide detailed instructions on how to do all this?
Use Colab, which is a similar, but much more powerful and flexible, online environment. Here’s a thread from mentor Saif that shows how to port the course notebooks to that environment.
You can also run them locally, but the waters are much deeper there and (at least at this point) there is no detailed guide for that. There are just too many choices and circumstances (what flavor of Windows, MacOS, linux yadda yadda). But here is a thread with a lot of links and some guidance.
Here’s another thread with a guide for setting up locally. The high level point here is that you need to develop your own problem solving skills to succeed at that type of endeavor. The problems just literally never end. As has been said “If it’s not one thing, it’s another.” Of course it has also been wisely said “Google is your friend!” especially for this type of “techie” problem. You’ll only be the ten thousandth person to hit any given landmine.
Just one other technical point here: I don’t think it’s a good idea to work on the assignments in a different environment and then “upload” them back to Coursera and submit them. If you are working on the courses and want to get graded, please work on the course website only. The reason is that it has been demonstrated that other non-Coursera-based tools can modify the “metadata” in the notebooks in such a way that it messes over the graders. This is particularly true of Colab: it’s a complete disaster to work on a course notebook on Colab and then bring it back to the Coursera environment. I guarantee that you will regret it if you try that. The only way to make it work would be to “copy/paste” just your completed code from your polluted version of the notebook back into a clean copy that has only ever been touched by the Coursera environment.
So the point is that this is a “one way street”: it’s a way for you to become self-sufficient and not depend on the Coursera environment for your future work and investigations, once you have finished the courses here. If all you’re trying to do is take the courses, then why not use the course website? That’s what it’s designed for and there’s no “setup” or overhead on your part. Of course it is a good idea to use the “Download” method you linked in your initial post to save copies of your work, both as a “backup” and for your future reference. Once you complete a given course, you lose access to the notebooks on the course website within some period of time (roughly estimated to be single digit weeks).
@paulinpaloalto this makes sense and thanks for the warning. Will follow your advice. Have another question. I see post about downloading assignment (File >Download As > ipynb (notebook) and other post saying to Download All Files (Lab Files on menu bar > Download All Files). What is the benefit of doing one or the other. I ultimately want to be able to save my work (by uploading back into the assignment after it has been removed from the Coursera Lab if I ever need to check my answers after it has been deleted). What is the best approach for this? Thank you
Whether you download just the notebook itself (the ipynb file) or all the files depends on whether you actually want to be able to run the notebook or just refer to it. If you want to run it, then you need all the accompanying files. If you click “File → Open” from any running notebook and have a look around, you’ll see that there is a whole tree of files including more python code and data files that are required to actually run the notebook. But if all you want to do is read the contents to review your code, then you only need the ipynb file. Of course without the supporting python files, you can’t fully understand what the code actually does: they include utility routines which may be unique to the given case. I think the best strategy is to download everything and that way you aren’t constrained in terms of what you can do in the future.