Skip to content

#71 - cannot import name - from helper function #308

Answered by mrdbourke
Yossi-Hd asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Yossi-Hd,

I'm not sure why this may be happening.

But if you're running in Google Colab, you can try the following:

Step 1

Run this code in a Google Colab cell:

!wget https://raw.githubusercontent.com/mrdbourke/pytorch-deep-learning/main/helper_functions.py

Step 2

Import plot_predictions from helper_functions.py.

from helper_functions import plot_predictions 

Running !pip install helper_functions won't work as it's not a pip package but rather a Python file on the course GitHub: https://github.com/mrdbourke/pytorch-deep-learning/blob/main/helper_functions.py

Example in Google Colab

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@Yossi-Hd
Comment options

Answer selected by Yossi-Hd
Comment options

You must be logged in to vote
2 replies
@mrdbourke
Comment options

@edeltobi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants