ipython / ipython

Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.
https://ipython.readthedocs.org
BSD 3-Clause "New" or "Revised" License
16.26k stars 4.43k forks source link

Force ipython to ignore /root/.ipython #8472

Open marmalodak opened 9 years ago

marmalodak commented 9 years ago

ipython3 seems to insist on looking in /root/.ipython. How do I make it use only the directories to which I point it? Example, I start my ipython3 notebook like this:

ipython3 notebook --profile=/ipython3/profiles/qa-ipython3/ipython_config.py \
                  --ip=0.0.0.0                                               \
                  --port=80                                                  \
                  --no-browser                                               \
                  --notebook-dir=/ipython3/notebooks                         \
                  --ipython-dir=/ipython3/ipython                            \
                  --profile-dir=/ipython3/profiles

But it still looks in /root/.ipython. If I remove /root/.ipython, I get a traceback that ends with

FileNotFoundError: [Errno 2] No such file or directory: '/root/.ipython'

I also asked this question on stackoverflow.

Carreau commented 9 years ago

it has no reason to look into /root/.ipython unless you run IPython as root. Do you run it as root ?

marmalodak commented 9 years ago

I do run it as root. But I've tried using a local account called qa and ipython looked in /home/qa/.ipython.

Carreau commented 9 years ago

Heve you tried the IPYTHONDIR env variable.

Also I doubt passing --profile, --profile-dir and --ipython dir at the same time works. And --profile does not take a path.

marmalodak commented 9 years ago

Thanks for getting back to me.

I have not tried using the environment variable. I kept adding command line arguments because ipython seemed to be ignoring my command line arguments and using $HOME instead.

What is the canonically correct way of creating a public notebook server? (By public, I mean local intranet, not globally public) When my notebook server is done, it ought to have several languages installed. This is the page that is my guide for this project.

Carreau commented 9 years ago

I would suggest following the docs once built : http://ipython.org/ipython-doc/stable/index.html , not only the source.

This page tell you how to build a public notebook server.

If it is multi-user have a look at jupyter-hub.

I'm not quire sure why you don't want IPython to look into ~/.ipython, do you plan on having many user accessing the server ? Are you aware that IPYTHONDIR need to be writable ?

I'm trying to uderstand what you want to do.

marmalodak commented 9 years ago

I will look into jupyter.

Some members of my team wanted to see if our projects could be shared with a centralised ipython notebook server. I think of it as a team wiki.

I do expect IPYTHONDIR to be writable. The host is a virtual machine that will likely see light traffic. Some projects involve a lot of javascript, so I thought ijavascript would be nice to have. Same with redis. I want to learn Haskell, so ihaskell seems very attractive.

One of the reasons I do not want things in /root/ is that some of the other kernels might not be stable. Example, the redis kernel did not work for me. Until it does, I do not want it visible on the notebook server web page.