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 not opening [ubuntu] #5876

Closed
raddanki opened this Issue May 17, 2014 · 12 comments

Comments

Projects
None yet
4 participants
@raddanki

raddanki commented May 17, 2014

When I try running ipython on ubuntu , I am getting this error..

--------------------------------------------------------------------------------------------------------------------------------

Traceback (most recent call last):
  File "/usr/bin/ipython", line 5, in <module>
    from IPython import start_ipython
  File "/usr/lib/python2.7/dist-packages/IPython/__init__.py", line 43, in <module>
    from .config.loader import Config
  File "/usr/lib/python2.7/dist-packages/IPython/config/__init__.py", line 16, in <module>
    from .application import *
  File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 29, in <module>
    from IPython.external.decorator import decorator
  File "/usr/lib/python2.7/dist-packages/IPython/external/decorator/__init__.py", line 4, in <module>
    from _decorator import *
ImportError: No module named _decorator
@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver May 17, 2014

Member

IPython on Ubuntu depends on the python-decorator package. I'm not sure how that could be missing, but check that it's installed using apt-get. If it is, you may have saved a file called decorator.py somewhere, and it's trying to import that instead of the real decorator module.

Member

takluyver commented May 17, 2014

IPython on Ubuntu depends on the python-decorator package. I'm not sure how that could be missing, but check that it's installed using apt-get. If it is, you may have saved a file called decorator.py somewhere, and it's trying to import that instead of the real decorator module.

@raddanki

This comment has been minimized.

Show comment
Hide comment
@raddanki

raddanki May 18, 2014

I have it installed, but still the same error is getting displayed

raddanki commented May 18, 2014

I have it installed, but still the same error is getting displayed

@Carreau Carreau added the needs-info label Jun 29, 2014

@baharev

This comment has been minimized.

Show comment
Hide comment
@baharev

baharev Oct 14, 2014

I have encountered the same problem with ipython 1.2.1 on Ubuntu 14.04 LTS. The python-decorator package is installed. What makes it even more mysterious is that it doesn't happen if I start ipython in my home directory but I get ImportError: No module named _decorator in a subdirectory under my home directory.

Any ideas? What information would be helpful?

baharev commented Oct 14, 2014

I have encountered the same problem with ipython 1.2.1 on Ubuntu 14.04 LTS. The python-decorator package is installed. What makes it even more mysterious is that it doesn't happen if I start ipython in my home directory but I get ImportError: No module named _decorator in a subdirectory under my home directory.

Any ideas? What information would be helpful?

@baharev

This comment has been minimized.

Show comment
Hide comment
@baharev

baharev Oct 14, 2014

OK, after some debugging I have found that there is an inspect.py in my working directory which is then being executed by ipython on start-up. I know that inspect is also a module in the standard library. Renaming my inspect.py to inspection.py solves the problem.

Am I not allowed to have an inspect.py in my working directory?

baharev commented Oct 14, 2014

OK, after some debugging I have found that there is an inspect.py in my working directory which is then being executed by ipython on start-up. I know that inspect is also a module in the standard library. Renaming my inspect.py to inspection.py solves the problem.

Am I not allowed to have an inspect.py in my working directory?

@Carreau

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau Oct 14, 2014

Member

Can you from decorator import * in a pure python shell.

Member

Carreau commented Oct 14, 2014

Can you from decorator import * in a pure python shell.

@Carreau

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau Oct 14, 2014

Member

Also IPython 1.x is not supported anymore, you might have to upgrade to 2.x

Member

Carreau commented Oct 14, 2014

Also IPython 1.x is not supported anymore, you might have to upgrade to 2.x

@baharev

This comment has been minimized.

Show comment
Hide comment
@baharev

baharev Oct 14, 2014

@Carreau Please read my comment posted right before yours which explains the issue; it has nothing to do with the decorator package.

baharev commented Oct 14, 2014

@Carreau Please read my comment posted right before yours which explains the issue; it has nothing to do with the decorator package.

@baharev

This comment has been minimized.

Show comment
Hide comment
@baharev

baharev Oct 14, 2014

@Carreau OK, IPython 2.1.0 does not seem to have this issue.

However, I am afraid many users will bump into this issue as IPython 1.2.1 is the one that comes with Ubuntu 14.04 LTS.

baharev commented Oct 14, 2014

@Carreau OK, IPython 2.1.0 does not seem to have this issue.

However, I am afraid many users will bump into this issue as IPython 1.2.1 is the one that comes with Ubuntu 14.04 LTS.

@Carreau

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau Oct 14, 2014

Member

@Carreau Please read my comment posted right before yours which explains the issue; it has nothing to do with the decorator package.

Our messages crossed :-)

Am I not allowed to have an inspect.py in my working directory?

No, a few of our modules try to import inspect :

IPython/core/completer.py:import inspect
IPython/core/completerlib.py:import inspect
IPython/core/formatters.py:import inspect
IPython/core/magics/code.py:import inspect
IPython/core/oinspect.py:import inspect
IPython/core/ultratb.py:import inspect
IPython/extensions/storemagic.py:import inspect, os, sys, textwrap
IPython/qt/util.py:import inspect
IPython/utils/traitlets.py:import inspect

So they load the file that is in your CWD instead of the module, which hence fails in weird ways. This is something we achieved to go around now.

If someone volunteers to maintain a 1.x stable branch, I guess we could have one, but I doubt this will happend. Usually we try to release before ubuntu freeze, I hope it will be the case next time.

Member

Carreau commented Oct 14, 2014

@Carreau Please read my comment posted right before yours which explains the issue; it has nothing to do with the decorator package.

Our messages crossed :-)

Am I not allowed to have an inspect.py in my working directory?

No, a few of our modules try to import inspect :

IPython/core/completer.py:import inspect
IPython/core/completerlib.py:import inspect
IPython/core/formatters.py:import inspect
IPython/core/magics/code.py:import inspect
IPython/core/oinspect.py:import inspect
IPython/core/ultratb.py:import inspect
IPython/extensions/storemagic.py:import inspect, os, sys, textwrap
IPython/qt/util.py:import inspect
IPython/utils/traitlets.py:import inspect

So they load the file that is in your CWD instead of the module, which hence fails in weird ways. This is something we achieved to go around now.

If someone volunteers to maintain a 1.x stable branch, I guess we could have one, but I doubt this will happend. Usually we try to release before ubuntu freeze, I hope it will be the case next time.

@baharev

This comment has been minimized.

Show comment
Hide comment
@baharev

baharev Oct 14, 2014

Well then, let's close this issue.

baharev commented Oct 14, 2014

Well then, let's close this issue.

@Carreau Carreau added this to the no action milestone Oct 14, 2014

@Carreau

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau Oct 14, 2014

Member

Ok, we can still reopen if we have more people coming here.

Thanks !

Member

Carreau commented Oct 14, 2014

Ok, we can still reopen if we have more people coming here.

Thanks !

@Carreau Carreau closed this Oct 14, 2014

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Oct 14, 2014

Member

Python files in the cwd should not cause this kind of problem, but we had a
bug for a while where they did. I guess 1.2 was affected by that, and we
fixed it by 2.1.

Member

takluyver commented Oct 14, 2014

Python files in the cwd should not cause this kind of problem, but we had a
bug for a while where they did. I guess 1.2 was affected by that, and we
fixed it by 2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment