Please include a template of ipython_notebook_config.py in profile_default folder #2974

Closed
lsnz opened this Issue Feb 23, 2013 · 17 comments

Projects

None yet

7 participants

@lsnz
lsnz commented Feb 23, 2013

I was trying to config the default behavior of my notebook, such as default notebook folder.

I had a lot of trouble until I tried to create a new profile and saw the 'ipython_notebook_config.py' in that profile folder. This is just a workaround.

I suggest IPython includes a template of ipython_notebook_config.py in profile_default folder. It will be a lot helpful and avoid a lot of search. The configuration file itself is well self-documented.

Note: tested with IPython0.13.1.

@Carreau
Member
Carreau commented Feb 23, 2013

profile_default does have a ipython_notebook_config.py. It was not created, probably because you upgraded IPython from a previous version and already have a profile_default folder. Is it the case ?

@oseack
oseack commented Feb 23, 2013

I recently installed IPython on my raspberryPi with ArchArm Linux. It's a fresh install. I just checked my Profile_default folder, it doesn't have the notebook confiugration file.

BTW, I am the guy who logged this bug with a different ID.

See the following output of ls -al command in profile_default folder.

[oseack@alarmpi profile_default]$ ls -al
total 40
drwxr-xr-x 7 oseack users 4096 Feb 16 22:53 .
drwxr-xr-x 3 oseack users 4096 Jan 21 23:38 ..
drwxr-xr-x 2 oseack users 4096 Feb  3 21:29 db
-rw-r--r-- 1 oseack users 9216 Feb 16 22:53 history.sqlite
drwxr-xr-x 2 oseack users 4096 Jan 21 23:38 log
drwx------ 2 oseack users 4096 Jan 21 23:38 pid
drwx------ 2 oseack users 4096 Jan 21 23:38 security
drwxr-xr-x 2 oseack users 4096 Jan 21 23:38 startup
@Carreau
Member
Carreau commented Feb 23, 2013

Hum, ok, weird. Tagging for probably next release.

Thanks !

@minrk
Member
minrk commented Feb 23, 2013

run:

$> ipython profile create

to generate the default config files. They are not written to the profile dir by default.

@Carreau
Member
Carreau commented Feb 23, 2013

Is there a reason of not creating the config files by default ?
I would expect users to try to modify default config files before creating a new profile.

And using ipython profile create to create the default files of an already existing profile dir does not seem obvious to me.

If I had to find one reason it would be that new options could appear between version, and the "default" files would be out of date. What about a default Readme file that state "run ipython profile create to generate the default config files for the directory" ?

@minrk
Member
minrk commented Feb 23, 2013

What about a default readme file that state "run ipython profile create to generate the default config files for the directory" ?

Probably a good idea.

@oseack
oseack commented Feb 24, 2013

To follow the convention of OSS, I hope we can include a template config file in the default folder like most others do.

Workaround is Ok after software is released, but for next release, workaround shouldn't be the first thought. And put the template into the the profile_default folder isn't a 'mission impossible'.

@takluyver
Member

I think the reasoning was that it would be easier for us to change defaults
if most users didn't have conflicting config files in their profile folder.
But a lot of people create it anyway, so perhaps that's not such an
advantage.

On 24 February 2013 01:38, oseack notifications@github.com wrote:

To follow the convention of OSS, I hope we can include a template config
file in the default folder like most others do.

Workaround is Ok after software is released, but for next release,
workaround shouldn't be the first thought. And put the template into the
the profile_default folder isn't a 'mission impossible'.


Reply to this email directly or view it on GitHubhttps://github.com/ipython/ipython/issues/2974#issuecomment-14001726.

@minrk
Member
minrk commented Feb 24, 2013

Yes, I think this was perhaps a wrong decision - that is, don't write config files until people actually have a reason to use them, so that they won't have stale config files representing an outdated IPython by the time they ultimately do want to do some configuration.

Workaround is Ok after software is released

Except it's not a workaround, it is deliberate, intended practice. It may be that we should change it, but ipython profile create is absolutely not a workaround for a bug, it is how you are supposed to configure IPython.

@oseack
oseack commented Feb 24, 2013

I understand the concern. I am sorry to call it workaround. But I still hope to have something straighforward.

And here is my suggestion and some other softwares do.

we only need to put the newest ipython_notbook_config_example.py into the profile_default. 1.This will not override user's ipython_notebook_config.py in upgrade installation. 2. for a fresh install, user can copy this ipython_notbook_config_example.py to ipython_notebook_config.py as a start point. I saw a lot of open source softwares doing this especially server software, and notebook is a kind of server software or at least similar.

For both scenarios, the user will have most recent config example file as a reference.

@ellisonbg
Member

I seem to recall that Fernando had strong feelings about not including the
default config file by default.

On Sun, Feb 24, 2013 at 9:52 AM, oseack notifications@github.com wrote:

I understand the concern.

And here is my suggestion and some other softwares do.

we only need to put the newest ipython_notbook_config_example.py into the
profile_default. 1.This will not override user's ipython_notebook_config.py
in upgrade installation. 2. for a fresh install, user can copy this example
config to ipython_notebook_config.py as a start point. I saw a lot of open
source softwares doing this especially server software, and notebook is a
kind of server software or at least similar.

For both scenarios, the user will have most recent config example file as
a reference.


Reply to this email directly or view it on GitHubhttps://github.com/ipython/ipython/issues/2974#issuecomment-14012392.

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

@kejbaly2

Hi! Seems the docs and the 1.1.0 branch behavior aren't in sync.

I followed the instructions here: http://ipython.org/ipython-doc/stable/interactive/public_server.html#notebook-public-server

...
Start by creating a certificate file and a hashed password, as explained above. Then create a custom profile for the notebook, with the following command line, type:

    $ ipython profile create nbserver

In the profile directory just created, edit the file ipython_notebook_config.py.

but in the nbserver directory (or profile_default if i just run ipython profile create) ends up with a ipython_config.py only, no ipython_notebook_config.py as the docs suggest.

I know it's not a huge problem, one can cp ipython_config.py ipython_notebook_config.py and go from there, since the files are pretty much all commented out anyway and such, but it certainly is a bit confusing.

@Carreau
Member
Carreau commented Dec 12, 2013

@drpoovilleorg

astonishingly it works for me :

└[~/ipython]> git checkout rel-1.1.0
Note: checking out 'rel-1.1.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 7c2ea3a... release 1.1.0
┌[matthiasbussonnier@umr168-curn-2-85-6561] [/dev/ttys002] [7c2ea3a ⚡]
└[~/ipython]> ipython profile create rubrubrub1
[ProfileCreate] Generating default config file: u'/Users/matthiasbussonnier/.ipython/profile_rubrubrub1/ipython_config.py'
[ProfileCreate] Generating default config file: u'/Users/matthiasbussonnier/.ipython/profile_rubrubrub1/ipython_qtconsole_config.py'
[ProfileCreate] Generating default config file: u'/Users/matthiasbussonnier/.ipython/profile_rubrubrub1/ipython_notebook_config.py'
[ProfileCreate] Generating default config file: u'/Users/matthiasbussonnier/.ipython/profile_rubrubrub1/ipython_nbconvert_config.py

(on master too) How did you install ? Did you have all dependencies ?

@kejbaly2

Indeed! It's due to deps! when i first ran profile create i didn't have all the deps installed (pyzqm, jinja2) and it didn't create it; once i tried to create the config, then it failed b/c of missing deps, so i installed them, got the server running (then posted the above comment)

Now when i run ipython profile create, as you say, it works as expected! :)

Only difference b/w then and now is that i installed the deps required to get notebook running.

Maybe a simple note somewhere in the docs says, 'didn't create ipython_notebook_config.py, make sure you have all deps installed' :) for folks like me.

Thanks for the quick assistance!

@Carreau
Member
Carreau commented Dec 12, 2013

You shouldn't have to install deps manually, if you pip install ipython[all] it should get everything and "just works".

@ellisonbg
Member

@Carreau what do you think we should do with this? Close? Is there anything we need to do?

@Carreau
Member
Carreau commented Jan 26, 2014

I have a long term plan using json conf for that.
So I think we can close.

@Carreau Carreau closed this Jan 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment