5

When i execute ipython in terminal i see following error

aman@ebex-MacBookPro:~/ipython_work$ ipython                                                                                       
Traceback (most recent call last):                                                                                                 
  File "/usr/local/bin/ipython", line 5, in <module>                                                                               
    from pkg_resources import load_entry_point                                                                                     
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3141, in <module>                                  
    @_call_aside                                                                                                                   
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3127, in _call_aside                               
    f(*args, **kwargs)                                                                                                             
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3154, in _initialize_master_working_set            
    working_set = WorkingSet._build_master()                                                                                       
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 640, in _build_master                              
    ws.require(__requires__)                                                                                                       
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 941, in require                                    
    needed = self.resolve(parse_requirements(requirements))                                                                        
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 828, in resolve                                    
    raise DistributionNotFound(req, requirers)                                                                                     
pkg_resources.DistributionNotFound: The 'pathlib2' distribution was not found and is required by ipython   

Just before that i followed

 $ git clone --recursive https://github.com/ipython/ipython.git
 $ cd ipython
 $ pip install -e ".[notebook]"

From the link [How to autosave ipython notebook]

http://stackoverflow.com/questions/21517296/how-to-autosave-ipython-notebook

I tried to uninstall and install using apt-get but its still not working and throwing missing distribution error.

I installed pathlib2 though

sudo pip install pathlib2

But again while accessing ipython I see another error

pkg_resources.DistributionNotFound: The 'backports.shutil_get_terminal_size' distribution was not found and is required by ipython
Cœur
  • 37,241
  • 25
  • 195
  • 267
aman
  • 1,875
  • 4
  • 18
  • 27

4 Answers4

14

You need install some packages manually as follows:

pip install pathlib2
pip install backports.shutil_get_terminal_size
pip install enum34
jwg
  • 5,547
  • 3
  • 43
  • 57
int32bit
  • 156
  • 1
  • 2
2

For me, I also had to pip install enum34 but otherwise int32bit's answer worked.

pip install pathlib2 backports.shutil_get_terminal_size enum34

Peter Tseng
  • 1,294
  • 1
  • 12
  • 15
0

I see the same error When i execute ipython interminal. The problem was solved by installing libraries about the exception.

0

I launched the Jupyter notebook from Anaconda "Environments" and the dos Windows open with all the launching packages in issues appearing.

Then I just had to install packages missing and mentioned in this window in your environment one by one. You can retry the same process as many times as needed.

double-beep
  • 5,031
  • 17
  • 33
  • 41