I am unable to load the package lab_utils_multi.py I do not see the file when I navigate the file explorer. When I download all files I do recover it but my local python environment cannot read it either. It appears to be corrupted or null. Please advise.
ValueError Traceback (most recent call last)
in
3 from sklearn.linear_model import SGDRegressor
4 from sklearn.preprocessing import StandardScaler
----> 5 from lab_utils_multi import load_house_data
6 from lab_utils_common import dlc
7 np.set_printoptions(precision=2)
ValueError: source code string cannot contain null bytes
Hi @Nicholas_Alexander!
I think you are talking about the Optional lab: Linear regression with scikit-learn.
If you don’t see lab_utils_multi.py in coursera’s jupyter notebook file explorer, or unable to load it because it does not exist, you may get it by the following steps:
On the top of the jupyter notebook, click “File” > “Open” to go the explorer. Do a quick check to see if the file exists, and if not, click “Help” at the top right corner, and click “Get latest version”. In this way, missing files will come back and existing files will not be touched.
If you want to get the latest version of any existing files because they are corrupted or you just want a new copy, please do the same steps as above, but before clicking “Help”, rename those files.
Lastly, our labs were tested on the coursera platform, so you should be able to run the code without problem on the platform. Cheers!
Raymond
When I used lab_utils_multi, I still got this syntax error message.
What is wrong?
message
Traceback (most recent call last):
File “c:\users****\appdata\local\programs\python\python39\lib\site-packages\IPython\core\interactiveshell.py”, line 3437, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File “”, line 3, in
from lab_utils_multi import load_house_data, run_gradient_descent
File “C:\Users****\lab_utils_multi.py”, line 1
^
SyntaxError: invalid syntax
Hello @M.Y_LE77, we tested the labs and the assignments on the coursera jupyter environment and so we encourage learners to complete them on coursera.
From the error message, it seems that there is/are some unknown characters in the first line of your lab_utils_multi.py
. Please first make sure the lab_utils_multi.py
can run through on your coursera environment so it wasn’t corrupted, then try to download a new copy of it, or copy and paste the text content of the lab_utils_multi.py
, and rerun the code.
Please is there a way I could run ‘lab_utils_multi’ and lab_utils_uni packages outside coursera jupyter environment? This will help me to work on more project outside the course.