16

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

2
  • try launching it from anaconda shell Commented Apr 2, 2017 at 14:03
  • I run it using anaconda shell but the same thing happened Commented Apr 2, 2017 at 14:56

4 Answers 4

37

I recommend you try this:

pip install --upgrade pip setuptools

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

Sign up to request clarification or add additional context in comments.

3 Comments

Is this supposed to work even without sudo? It doesn't work for me without sudo!
@Saurav This depends on the environment you are using. If pip refers to a global installation then you have to use sudo. If pip is running from within a virtualenv then it should work without (as it is installed for your user only).
Could you incorporate some information from the bug report link on github into your answer? If that issue got deleted that information would just be lost.
9

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.

2 Comments

Clearler instructions would be better. What exactly do you mean by finding any other pip3 links?
@Schütze It means that you should look if there are references to the old installation somewhere in your files and delete them before you install again. Therefore the rm command. find will look for files (including link) containing pip3 in the name.
4

upgrading setuptools didn't work for me. I did reinstall pip,

git clone https://github.com/pypa/pip.git
cd pip
python setup.py install

2 Comments

Worked, thanks, but better work with a specific release branch than point ppl to master. git clone https://github.com/pypa/pip.git -b release/9.0.3 --single-branch && cd pip && python setup.py install
re-checked - it didn't solve my issue. Using a release branch still recommended ...
3

Had the same issue with pip install. The following worked for me.

easy_install pip
easy_install setuptools

https://github.com/pypa/setuptools/issues/885

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.