Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dealing with images in multidirectory environment #4424

Closed
damianavila opened this issue Oct 23, 2013 · 5 comments · Fixed by #4426
Closed

Dealing with images in multidirectory environment #4424

damianavila opened this issue Oct 23, 2013 · 5 comments · Fixed by #4426
Milestone

Comments

@damianavila
Copy link
Member

I am playing with this and I found this behaviour:

My directory have the following structure:
/Desarrollos
---/damian_blog
---/pyconar2013_talks
---/etc...

I started the notebook in Desarrollos using: ipython notebook pyconar2013_talks/IPython_fu_talk.ipynb

Then if I load an image in markdown cell, <img src="figs/logo.png" /> the files prepend is no longer necessary, which is great...

But if I try to load the image in a code cell,

from IPython.display import Image
Image(filename='pyconar2013_talks/figs/logo.png')

I have to preppend with the pyconar2013_talks to make it render in the code cell... and if a preppend the src in the markdown cell <img src="pyconar2013_talks/figs/logo.png" />, it is not rendered...

This is the intended behaviour? Because we have a lack of consistency? Or a I missing something?

Dami]an.

@ellisonbg
Copy link
Member

What is the cwd of the kernel?

On Wed, Oct 23, 2013 at 6:32 AM, Damián Avila notifications@github.comwrote:

I am playing with this and I found this behaviour:

My directory have the following structure:
/Desarrollos
/damian_blog
/pyconar2013_talks
/etc...

I started the notebook using: `ipython notebook
pyconar2013_talks/IPython_fu_talk.ipynb

Then if I load an image in markdown cell, the
files prepend is no longer necessary, which is great...

But if I try to load the image in a code cell,

from IPython.display import Image
Image(filename='pyconar2013_talks/figs/logo.png')

I have to preppend with the pyconar2013_talks to make it render in the
code cell... and if a preppend the src in the markdown cell , it is not rendered...

This is the intended behaviour? Because we have a lack of consistency? Or
a I missing something?

Damian.


Reply to this email directly or view it on GitHubhttps://github.com//issues/4424
.

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

@Carreau
Copy link
Member

Carreau commented Oct 23, 2013

Apparently the cwd of the kernel is the cwd of where the server start.
I don't think that was our plan.

@ellisonbg
Copy link
Member

Right, that is what I was thinking. The cwd of the kernel should match the
location of the notebook.

On Wed, Oct 23, 2013 at 9:20 AM, Matthias Bussonnier <
notifications@github.com> wrote:

Apparently the cwd of the kernel is the cwd of where the server start.
I don't think that was our plan.


Reply to this email directly or view it on GitHubhttps://github.com//issues/4424#issuecomment-26919509
.

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

minrk added a commit to minrk/ipython that referenced this issue Oct 23, 2013
@minrk
Copy link
Member

minrk commented Oct 23, 2013

Try #4426

@damianavila
Copy link
Member Author

Working great now! Thanks.

@minrk minrk added this to the 2.0 milestone Mar 26, 2014
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants