Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ipython2 does not work anymore

57 views
Skip to first unread message

Cecil Westerhof

unread,
Jan 19, 2017, 10:14:13 AM1/19/17
to
I did not work with ipython2 for a long time. Most of my work is done
with python3. I just tried to start ipython2 and got:
Traceback (most recent call last):
File "/usr/bin/ipython2", line 7, in <module>
from IPython import start_ipython
File "/usr/lib/python2.7/site-packages/IPython/__init__.py", line 49, in <module>
from .terminal.embed import embed
File "/usr/lib/python2.7/site-packages/IPython/terminal/embed.py", line 16, in <module>
from IPython.core.interactiveshell import DummyMod, InteractiveShell
File "/usr/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 31, in <module>
from pickleshare import PickleShareDB
File "/usr/lib/python2.7/site-packages/pickleshare.py", line 40, in <module>
from path import path as Path
ImportError: No module named path


What could be the problem here?


Python2 does work:
Python 2.7.12 (default, Jul 01 2016, 15:36:53) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

Otherwise I would have a problem. Some scripts still use it.

I am working with openSUSE 13.2

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

MRAB

unread,
Jan 19, 2017, 3:08:56 PM1/19/17
to
There's no module called 'path' in Python 3. Do you mean 'pathlib'?

If you do mean 'pathlib', it was introduced in Python 3.4.

Cecil Westerhof

unread,
Jan 19, 2017, 4:14:19 PM1/19/17
to
I copied this from the output I got.


> If you do mean 'pathlib', it was introduced in Python 3.4.

It is about python2.

Steve D'Aprano

unread,
Jan 19, 2017, 7:01:26 PM1/19/17
to
On Fri, 20 Jan 2017 02:06 am, Cecil Westerhof wrote:

> I did not work with ipython2 for a long time. Most of my work is done
> with python3. I just tried to start ipython2 and got:
> Traceback (most recent call last):
[...]
> ImportError: No module named path
>
>
> What could be the problem here?

Something has changed between the last time you ran IPython and now. You
have deleted something, changed something, installed something... or you
have file system corruption and files are disappearing... or your
PYTHONPATH environment variable is not set, or is set differently to the way
it used to be...

Do you want to investigate why the error occurred, or just fix it in the
most convenient and easy way?

If the second, then you can probably fix it by running:

python2 -m pip install path

assuming that you trust that path is a legitimate module.

Looking at the traceback, I see the final call which fails is in a module
called pickleshare.py:

File "/usr/lib/python2.7/site-packages/pickleshare.py", line 40, in <module>
from path import path as Path


You could try removing pickleshare and re-installing, or upgrading to the
latest version, and see whether it brings in the "path" dependency.

You could try running "locate path.py | grep python2.7" in the shell and see
whether path is installed. If it is installed, it sounds like the PYTHONPATH
is messed up. Run these and tell us what they say:

locate path.py | grep python2.7
python2.7 -c "import sys; print sys.path"
echo $PYTHONPATH



Googling for your error gives me these two relevant looking hits:

https://duckduckgo.com/html/?q=%22ImportError:%20No%20module%20named%20path%22+ipython

https://github.com/jupyter/notebook/issues/270

https://github.com/jupyter/notebook/issues/525



--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up,
and sure enough, things got worse.

dieter

unread,
Jan 20, 2017, 4:47:04 AM1/20/17
to
Cecil Westerhof <Ce...@decebal.nl> writes:
> ...
>> If you do mean 'pathlib', it was introduced in Python 3.4.
>
> It is about python2.

I can remember to have seen announcements for enhanced "path" modules
in this list. Your previously posted traceback shows that the problem
comes from the package "pickleshare" which expects a "path" module
(likely one of those enhanced modules) and cannot find one.

I would try to find out what "path" module "pickleshare" requires
and then install it.

0 new messages