Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ipython broke: doesn't start, says missing 'pathlib2' distribution

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
like image 944
aman Avatar asked May 18 '16 12:05

aman


2 Answers

You need install some packages manually as follows:

pip install pathlib2
pip install backports.shutil_get_terminal_size
pip install enum34
like image 171
int32bit Avatar answered Oct 22 '22 04:10

int32bit


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

pip install pathlib2 backports.shutil_get_terminal_size enum34

like image 34
Peter Tseng Avatar answered Oct 22 '22 04:10

Peter Tseng