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

ipython won't start #11678

Open
keisuke-yanagisawa opened this issue Apr 8, 2019 · 12 comments
Open

ipython won't start #11678

keisuke-yanagisawa opened this issue Apr 8, 2019 · 12 comments

Comments

@keisuke-yanagisawa
Copy link

Now I'm facing that ipython won't start without any error messages.
I tried to run it with DEBUG, then the command will be "uninterruptible sleep" after the logs.

$ pyenv global system
$ python --version
Python 2.7.5
$ ipython --version
6.2.1
$ ipython --log-level=DEBUG
[TerminalIPythonApp] IPYTHONDIR set to: /users/yanagisawa/.ipython
[TerminalIPythonApp] Using existing profile dir: '/users/yanagisawa/.ipython/profile_default'
[TerminalIPythonApp] Searching path ['/users/yanagisawa', '/users/yanagisawa/.ipython/profile_default', '/usr/etc/ipython', '/usr/local/etc/ipython', '/etc/ipython'] for config files
[TerminalIPythonApp] Attempting to load config file: ipython_config.py
[TerminalIPythonApp] Looking for ipython_config in /etc/ipython
[TerminalIPythonApp] Looking for ipython_config in /usr/local/etc/ipython
[TerminalIPythonApp] Looking for ipython_config in /usr/etc/ipython
[TerminalIPythonApp] Looking for ipython_config in /users/yanagisawa/.ipython/profile_default
[TerminalIPythonApp] Loaded config file: /users/yanagisawa/.ipython/profile_default/ipython_config.py
[TerminalIPythonApp] Looking for ipython_config in /users/yanagisawa

Another system also has the same problem

$ pyenv global anaconda3-2018.12
$ python --version
Python 3.7.1
$ ipython --version
7.2.0
$ ipython --log-level=DEBUG
ipython --log-level=DEBUG
[TerminalIPythonApp] IPYTHONDIR set to: /users/yanagisawa/.ipython
[TerminalIPythonApp] Using existing profile dir: '/users/yanagisawa/.ipython/profile_default'
[TerminalIPythonApp] Searching path ['/users/yanagisawa', '/users/yanagisawa/.ipython/profile_default', '/users/yanagisawa/.local/pyenv/versions/anaconda3-2018.12/etc/ipython', '/usr/local/etc/ipython', '/etc/ipython'] for config files
[TerminalIPythonApp] Attempting to load config file: ipython_config.py
[TerminalIPythonApp] Looking for ipython_config in /etc/ipython
[TerminalIPythonApp] Looking for ipython_config in /usr/local/etc/ipython
[TerminalIPythonApp] Looking for ipython_config in /users/yanagisawa/.local/pyenv/versions/anaconda3-2018.12/etc/ipython
[TerminalIPythonApp] Looking for ipython_config in /users/yanagisawa/.ipython/profile_default
[TerminalIPythonApp] Loaded config file: /users/yanagisawa/.ipython/profile_default/ipython_config.py
[TerminalIPythonApp] Looking for ipython_config in /users/yanagisawa

It should be noted that It is on a cluster machine, not own PC. I guess it is related to permission problems thus far (without any reasons).

@keisuke-yanagisawa
Copy link
Author

Now we found vers=3 in /etc/fstab is probably the cause. Is there any way to avoid the problem without modification of /etc/fstab? (Because I do not have permission...)

@Carreau
Copy link
Member

Carreau commented Apr 10, 2019

You likely want to deactivate the history which is using sqlite. I'm not quite sure I rememeber the config for this.

$ python --version
Python 2.7.5
$ ipython --version
6.2.1

That is unlikely; IPython 6 will not work on Python 2. Make sure your IPython are using the correct Python, that might help you to solve things. to be sure you can use python -m IPython to be certain.

@keisuke-yanagisawa
Copy link
Author

Thanks for the comment.
I found the python3 command and ipython will be run with python3. Unfortunately, the problem is still there.

$ pyenv global system
$ python --version
Python 2.7.5
$ python3 --version
Python 3.6.3
$ python -m IPython
/bin/python: No module named IPython
$ python3 -m IPython
(no response)

@Carreau
Copy link
Member

Carreau commented Apr 11, 2019

Can you try ipython --quick ? It should some expensive disk access and avoid reading config.

@keisuke-yanagisawa
Copy link
Author

keisuke-yanagisawa commented Apr 14, 2019

I tried ipython --quick, however, it got stuck with same status.

@jhayes-py
Copy link

I have encountered the same problem, and have tried the following:

  • Installed IPython 7.7.0 as a pip user package (for global Python version 3.7.0)
  • Installed IPython 7.7.0 within a new Miniconda environment (local Python version 3.7.4)
  • Installed IPython 6.5.0 within another new Miniconda environment (local Python version 3.7.4)

I am trying to run IPython on an HPC with CentOS v7.6.1810, accessed via SSH. It worked just fine a week ago, but then the HPC was physically relocated. Since the relocation, even though nothing new has been installed or updated on the head node, IPython now hangs while looking for "ipython_config". The only notable hardware change was the replacement of a network switch. Python works, conda works, and Java works, but I cannot launch the IPython kernel for an interactive shell or for a Jupyter notebook.

@jhayes-py
Copy link

jhayes-py commented Sep 3, 2019

It looks like the problem has been previously addressed, as the following comment can be found in jupyter_core/dotipython/profile_default/ipython_config.py:

## Path to file to use for SQLite history database.
#
#  By default, IPython will put the history database in the IPython profile
#  directory.  If you would rather share one history among profiles, you can set
#  this value in each, so that they are consistent.
#
#  Due to an issue with fcntl, SQLite is known to misbehave on some NFS mounts.
#  If you see IPython hanging, try setting this to something on a local disk,
#  e.g::
#
#      ipython --HistoryManager.hist_file=/tmp/ipython_hist.sqlite
#
#  you can also use the specific value `:memory:` (including the colon at both
#  end but not the back ticks), to avoid creating an history file.

We were having the aforementioned NFS problem, and IPython did not hang when I used the example command. In our case, the ultimate solution was to update our NFS to version 4.x. Is there any way to catch this problem and return a descriptive error message, instead of hoping someone will read the entirety of ipython_config.py for an answer?

@DaScientist
Copy link

I also have the same problem. I tried creating empty files at the mentioned directories and it still doesn't work. I work on windows, installed python through chocolatey and the installers too and intalled ipython using pip.

@sbelharbi
Copy link

hi,
a couple days ago, i started having similar issue after reinstalling ipython 7.15.0 in a new home through conda.

this instruction helps starting ipython: ipython --HistoryManager.hist_file=/tmp/ipython_hist.sqlite.
running ipython alone will lead to a loop looking for ipython_config.py which is not found.

i run $ ipython profile create to create it, following this doc.

at some point, ipython finds ipython_config.py, but then, it starts looking for it again!!!!
here is the logout where ipython hangs forever....

$ ipython --log-level=DEBUG 
[TerminalIPythonApp] IPYTHONDIR set to: path-to-home/.ipython
[TerminalIPythonApp] Using existing profile dir: 'path-to-home/.ipython/profile_default'
[TerminalIPythonApp] Searching path ['path-to-home', 'path-to-home/.ipython/profile_default', 'path-to-home/anaconda3/etc/ipython', '/usr/local/etc/ipython', '/etc/ipython'] for config files
[TerminalIPythonApp] Attempting to load config file: ipython_config.py
[TerminalIPythonApp] Looking for ipython_config in /etc/ipython
[TerminalIPythonApp] Looking for ipython_config in /usr/local/etc/ipython
[TerminalIPythonApp] Looking for ipython_config in path-to-home/anaconda3/etc/ipython
[TerminalIPythonApp] Looking for ipython_config in path-to-home/.ipython/profile_default
[TerminalIPythonApp] Loaded config file: path-to-home/.ipython/profile_default/ipython_config.py
[TerminalIPythonApp] Looking for ipython_config in path-to-home

how to fix this without --HistoryManager.hist_file=/tmp/ipython_hist.sqlite and why suddenly this is a problem?

there is a file in ~/.ipython/profile_default. when using ipython --HistoryManager.hist_file=~/.ipython/profile_default/ipython_hist.sqlite, ipython hangs as well.

for now, i created an alias alias ipython='ipython --HistoryManager.hist_file=/tmp/ipython_hist.sqlite' , while it works, it is not a good way.
thanks

@Dan-RAI
Copy link

Dan-RAI commented Dec 2, 2020

hi,
encountered same problem. Hangs at

[TerminalIPythonApp] Looking for ipython_config in ...

However, starting ipython via sudo works. Perhaps permission problem ?

--force-reinstall does not help

@jacobmatthewmurray
Copy link

A solution without updating NFS, alias-ing or symlinking based on this:

ipython profile create


# Edit IPython configuration
vi ~/.ipython/profile_default/ipython_config.py

# Change following two lines
# c.HistoryManager.hist_file=''
# c.HistoryAccessor.hist_file=''

# To:
c.HistoryManager.hist_file=':memory:'
c.HistoryAccessor.hist_file=':memory:' 


jupyter notebook --generate-config

# Edit Jupyter configuration
vi ~/.jupyter/jupyter_notebook_config.py

# Change following line
# c.NotebookNotary.db_file = ''

# To:
c.NotebookNotary.db_file = ':memory:'

@aoot
Copy link

aoot commented Jun 10, 2023

A solution without updating NFS, alias-ing or symlinking based on this:

ipython profile create


# Edit IPython configuration
vi ~/.ipython/profile_default/ipython_config.py

# Change following two lines
# c.HistoryManager.hist_file=''
# c.HistoryAccessor.hist_file=''

# To:
c.HistoryManager.hist_file=':memory:'
c.HistoryAccessor.hist_file=':memory:' 


jupyter notebook --generate-config

# Edit Jupyter configuration
vi ~/.jupyter/jupyter_notebook_config.py

# Change following line
# c.NotebookNotary.db_file = ''

# To:
c.NotebookNotary.db_file = ':memory:'

For reference, this solved my issue which jupyter-lab was not able to create a new notebook and just hangs trying to create one.

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

No branches or pull requests

8 participants