pew-org/pew

The 'shutilwhich' distribution was not found and is required by pew

acidtv opened this issue · 3 comments

Hi,

I'm was trying to get pipenv working, but ended up bumping into this issue with pew. When I run pipenv, or just pew manually it throws this error:

  File "/home/alex/.local/venvs/pipenv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", 
line 870, in resolve     
    raise DistributionNotFound(req, requirers)    
pkg_resources.DistributionNotFound: The 'shutilwhich' distribution was not found and is required by p
ew

I'm running Ubuntu 17.10, with python 2.7.14.

I've installed pew with pipsi.

This is the complete backtrace:

mango ~$ pew --version 
Traceback (most recent call last):                                                                   
  File "/home/alex/.local/bin/pew", line 5, in <module>                                              
    from pkg_resources import load_entry_point                                                       
  File "/home/alex/.local/venvs/pew/local/lib/python2.7/site-packages/pkg_resources/__init__.py", lin
e 3147, in <module>                                                                                  
    @_call_aside                                                                                     
  File "/home/alex/.local/venvs/pew/local/lib/python2.7/site-packages/pkg_resources/__init__.py", lin
e 3131, in _call_aside                                                                               
    f(*args, **kwargs)                                                                               
  File "/home/alex/.local/venvs/pew/local/lib/python2.7/site-packages/pkg_resources/__init__.py", lin
e 3160, in _initialize_master_working_set                                                            
    working_set = WorkingSet._build_master()                                                         
  File "/home/alex/.local/venvs/pew/local/lib/python2.7/site-packages/pkg_resources/__init__.py", lin
e 666, in _build_master                                                                              
    ws.require(__requires__)                                                                         
  File "/home/alex/.local/venvs/pew/local/lib/python2.7/site-packages/pkg_resources/__init__.py", lin
e 984, in require                                                                                    
    needed = self.resolve(parse_requirements(requirements))                                          
  File "/home/alex/.local/venvs/pew/local/lib/python2.7/site-packages/pkg_resources/__init__.py", lin
e 870, in resolve                                                                                    
    raise DistributionNotFound(req, requirers)                                                       
pkg_resources.DistributionNotFound: The 'shutilwhich' distribution was not found and is required by p
ew                                                                                                   

Installing shutilwhich manually does not solve the problem.

Any clues? :)

I haven't yet try to reproduce this, so I'm not sure what would be the cause.

A couple of workarounds: shutilwhich is only Required for Python < 3.3, so you could install pipenv on the newer Python (which is preinstalled on Ubuntu 17.10) or you could activate the virtualenv created by pipsi, and install the missing package with pip install shutilwhich

I just tried to reproduce this on 14.04, and installing pew with pipsi, but everything worked fine.

After activating ~/.local/venvs/pew, is shutilwhich listed in pip freeze?

Could you try to delete ~/.local/venvs/pew and reinstall it with pipsi install pew and paste the output?

Nope, shutilwhich is not listed in pip freeze for that virtualenv.

It seems more packages are missing in that virtualenv. In the end I had to activate it and pip install shutilwhich, pathlib and backports.shutil_get_terminal_size to get it working, so thanks for suggesting that :)

This is the output I get when installing pew with pipsi:

$ pipsi install pew                                                                                                             
Running virtualenv with interpreter /home/alex/.local/venvs/pipsi/bin/python                              
Using real prefix '/usr'                             
New python executable in /home/alex/.local/venvs/pew/bin/python                                           
Installing Setuptools.............................................................................................................................
Installing Pip....................................................................................................................................
.................................................................done.
Downloading/unpacking pew                            
  Downloading pew-1.1.2.tar.gz                       
  Running setup.py egg_info for package pew          
                                                     
    warning: no previously-included files matching '*~' found under directory 'pew'                       
Downloading/unpacking virtualenv>=1.11 (from pew)    
  Downloading virtualenv-15.1.0.tar.gz (1.9MB): 1.9MB downloaded                                          
  Running setup.py egg_info for package virtualenv   
                                                     
    warning: no previously-included files matching '*' found under directory 'docs/_templates'            
    warning: no previously-included files matching '*' found under directory 'docs/_build'                
Downloading/unpacking virtualenv-clone>=0.2.5 (from pew)                                                  
  Downloading virtualenv-clone-0.2.6.tar.gz          
  Running setup.py egg_info for package virtualenv-clone                                                  
                                                     
Downloading/unpacking setuptools>=17.1 (from pew)    
  Downloading setuptools-38.5.1.zip (737kB): 737kB downloaded                                             
  Running setup.py egg_info for package setuptools   
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'long_description_content_type'                           
      warnings.warn(msg)                             
    warning: no files found matching '*' under directory 'setuptools/_vendor'                             
Installing collected packages: pew, virtualenv, virtualenv-clone, setuptools                              
  Running setup.py install for pew                   
                                                     
    warning: no previously-included files matching '*~' found under directory 'pew'                       
    Installing pew script to /home/alex/.local/venvs/pew/bin                                              
  Running setup.py install for virtualenv            
                                                     
    warning: no previously-included files matching '*' found under directory 'docs/_templates'            
    warning: no previously-included files matching '*' found under directory 'docs/_build'                
    Installing virtualenv script to /home/alex/.local/venvs/pew/bin                                       
  Running setup.py install for virtualenv-clone      
                                                     
    Installing virtualenv-clone script to /home/alex/.local/venvs/pew/bin                                 
  Found existing installation: setuptools 0.9.8      
    Uninstalling setuptools:                         
      Successfully uninstalled setuptools            
  Running setup.py install for setuptools            
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'long_description_content_type'                           
      warnings.warn(msg)                             
    warning: no files found matching '*' under directory 'setuptools/_vendor'                             
    Installing easy_install script to /home/alex/.local/venvs/pew/bin                                     
    Installing easy_install-2.7 script to /home/alex/.local/venvs/pew/bin                                 
  Could not find .egg-info directory in install record for setuptools>=17.1 (from pew)                    
Successfully installed pew virtualenv virtualenv-clone setuptools                                         
Cleaning up...                                       
Done.