Error while launching Jupyter Notebook - @attr.s(hash=True) AttributeError: module 'attr' has no attribute 's'

ぐ巨炮叔叔 提交于 2020-04-16 05:48:50

问题


I am not able to launch or open Jupyter Notebook. I have uninstalled and installed it multiple times, still get the same error which I have pasted below!

It's giving some 'Attribute Error'.

Traceback (most recent call last):
File "C:\Users\Ramya\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in 
from notebook.notebookapp import main
File "C:\Users\Ramya\anaconda3\lib\site-packages\notebook\notebookapp.py", line 80, in 
from .services.contents.manager import ContentsManager
File "C:\Users\Ramya\anaconda3\lib\site-packages\notebook\services\contents\manager.py", line 17, in 
from nbformat import sign, validate as validate_nb, ValidationError
File "C:\Users\Ramya\anaconda3\lib\site-packages\nbformat\__init__.py", line 32, in 
from .validator import validate, ValidationError
File "C:\Users\Ramya\anaconda3\lib\site-packages\nbformat\validator.py", line 12, in 
from jsonschema import ValidationError
File "C:\Users\Ramya\anaconda3\lib\site-packages\jsonschema\__init__.py", line 11, in 
from jsonschema.exceptions import (
File "C:\Users\Ramya\anaconda3\lib\site-packages\jsonschema\exceptions.py", line 152, in 
@attr.s(hash=True)
AttributeError: module 'attr' has no attribute 's'

Please help!


回答1:


You have most likely created a module with the name attr that is shadowing the PyPI package required by jsonschema.




回答2:


Run Anaconda prompt as Admin

pip uninstall attr

followed by

conda install --force attrs

Now jupyter notebook should work.

Reason for the Issue :

  • attr pip package was installed into your user site-packages directory.
  • That is loaded in preference to the site-packages directory maintained by conda.
  • so every time you launch your Jupyter - attr package is been referred from your user site-packages instead of attrs from conda



回答3:


  1. Search the file named 'attr.py' on your computer
  2. Delete that file
  3. Reopen Jupiter notebook or redownload it This works on my computer, I have tried' pip uninstall attr' and it does not work, I guess we should do it by hand.


来源:https://stackoverflow.com/questions/60910874/error-while-launching-jupyter-notebook-attr-shash-true-attributeerror-modu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!