Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: '_NamespacePath' object has no attribute 'sort'

I downloaded anaconda and when try to launch jupyter notebook using cmd, the error appear as AttributeError: '_NamespacePath' object has no attribute 'sort'. I am launching jypyter by typing jupyter notebook in cmd in windows os. Thanks for solving my error

like image 509
Lim Ken Sian Avatar asked Apr 02 '17 14:04

Lim Ken Sian


2 Answers

I recommend you try this:

pip install --upgrade pip setuptools

Based on https://github.com/GoogleCloudPlatform/google-cloud-python/issues/2990.

like image 149
ida Avatar answered Nov 17 '22 09:11

ida


This worked for me on Ubuntu 16.04.

  1. Uninstall pip3

    sudo apt-get purge --auto-remove python3-pip
    
  2. Go to your home directory

    cd $HOME
    
  3. Search for any other pip3 links

    sudo find . -name 'pip3'
    
  4. Delete all the links using rm if any were found

  5. Download/Clone pip from here (via git for example)

    git clone https://github.com/pypa/pip
    
  6. Go to the downloaded directory

    cd pip
    
  7. Install pip3 (you might need to add sudo in front of it)

    python3 setup.py install
    

This will install the latest version of pip and remove the error without loss of any packages.

like image 9
Rohan Avatar answered Nov 17 '22 08:11

Rohan