0

I am using macOS and trying to add an image (png) file on Jupyter Notebook markdown cell, but it keeps generating an error message that they cannot find the png file. I am not sure what is wrong with my following two codes:

![alt text]("~Users/jj/pythonworkspace/what.is.numpy.png" "What is Numpy?") Alternatively, <img src="~Users/jj/pythonworkspace/what.is.numpy.png">

1 Answer 1

1

You shouldn't be using quotations around your path or links. Also i think you meant to have an additional / after your home directory or maybe not have ~ at all. The path you're providing isn't following the macOS conventions.

You can test if that path is valid by going into terminal and running

ls /path/you/are/testing

try

![What is Numpy?](/Users/jj/pythonworkspace/what.is.numpy.png)
Sign up to request clarification or add additional context in comments.

4 Comments

I removed the quotations. Using ls, I checked the path and the png.file is there in the directory /pythonworkspace, but still producing an error (link is broken).
As I mentioned earlier about macOS conventions, It's unlikely that you have a Users directory sitting under your home directory. Can you try removing ~ and instead use /Users/jj/pythonworkspace/what.is.numpy.png. If that works let me know and i can update this answer.
Great! It works perfect. I didn't realize "~" on the path. Once removed, the problem solved. Much appreciated.
Glad to hear it. Please accept this answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.