I am facing the following error while starting jupyter-notebook. Anyone has any idea what's wrong?
desk ~/anaconda3/lib/python3.6/site-packages $ jupyter-notebook
Traceback (most recent call last):
File "/home/suny/anaconda3/bin/jupyter-notebook", line 4, in <module>
import notebook.notebookapp
File "/home/suny/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 28, in <module>
from jinja2 import Environment, FileSystemLoader
File "/home/suny/anaconda3/lib/python3.6/site-packages/jinja2/__init__.py", line 81, in <module>
_patch_async()
File "/home/suny/anaconda3/lib/python3.6/site-packages/jinja2/__init__.py", line 77, in _patch_async
from jinja2.asyncsupport import patch_all
File "/home/subinoy/anaconda3/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 13, in <module>
import asyncio
File "/home/suny/anaconda3/lib/python3.6/asyncio/__init__.py", line 21, in <module>
from .base_events import *
File "/home/suny/anaconda3/lib/python3.6/asyncio/base_events.py", line 17, in <module>
import concurrent.futures
File "/home/suny/anaconda3/lib/python3.6/site-packages/concurrent/futures/__init__.py", line 8, in <module>
from concurrent.futures._base import (FIRST_COMPLETED,
File "/home/suny/anaconda3/lib/python3.6/site-packages/concurrent/futures/_base.py", line 355
raise type(self._exception), self._exception, self._traceback
^
SyntaxError: invalid syntax
Thanks in advance!!
Related
I am a beginner. Please help. When I pass the jupyter lab command the following error occurs:-
Traceback (most recent call last):
File "c:\users\parijat basak\anaconda3\lib\site-packages\jupyterlab_server\server.py", line 20, in <module>
from notebook.notebookapp import aliases, flags, NotebookApp as ServerApp
File "c:\users\parijat basak\anaconda3\lib\site-packages\notebook\notebookapp.py", line 51, in <module>
from zmq.eventloop import ioloop
File "C:\Users\Parijat Basak\AppData\Roaming\Python\Python38\site-packages\zmq\__init__.py", line 50, in <module>
from zmq import backend
File "C:\Users\Parijat Basak\AppData\Roaming\Python\Python38\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\Users\Parijat Basak\AppData\Roaming\Python\Python38\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\Parijat Basak\AppData\Roaming\Python\Python38\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\Parijat Basak\AppData\Roaming\Python\Python38\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\Parijat Basak\AppData\Roaming\Python\Python38\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: cannot import name 'constants' from partially initialized module 'zmq.backend.cython' (most likely due to a circular import) (C:\Users\Parijat Basak\AppData\Roaming\Python\Python38\site-packages\zmq\backend\cython\__init__.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\parijat basak\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\parijat basak\anaconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Parijat Basak\anaconda3\Scripts\jupyter-lab.EXE\__main__.py", line 4, in <module>
File "c:\users\parijat basak\anaconda3\lib\site-packages\jupyterlab\labapp.py", line 14, in <module>
from jupyterlab_server import slugify, WORKSPACE_EXTENSION
File "c:\users\parijat basak\anaconda3\lib\site-packages\jupyterlab_server\__init__.py", line 4, in <module>
from .app import LabServerApp
File "c:\users\parijat basak\anaconda3\lib\site-packages\jupyterlab_server\app.py", line 9, in <module>
from .server import ServerApp
File "c:\users\parijat basak\anaconda3\lib\site-packages\jupyterlab_server\server.py", line 26, in <module>
from jupyter_server.base.handlers import ( # noqa
ModuleNotFoundError: No module named 'jupyter_server'
Please help!!! I am unable to use Jupyter Lab anymore and it is extremly problematic for me!
Thank You.
From my point of view, it may be faster, and easier is to reinstall Jupyter Lab (maybe create a new conda environment if needed).
One more thing, you might consider backing up your conda environment when everything is smooth:
https://www.anaconda.com/blog/moving-conda-environments
When I installed the Anaconda python distribution in Ubuntu 16.04LTS, it doesn't launch and giving below error.
Studio-XPS-1640:~$ spyder
Traceback (most recent call last):
File "/usr/bin/spyder", line 3, in <module>
start_app.main()
File "/usr/lib/python2.7/dist-packages/spyderlib/start_app.py", line 114, in main
from spyderlib import spyder
File "/usr/lib/python2.7/dist-packages/spyderlib/spyder.py", line 155, in <module>
from spyderlib.utils.environ import WinUserEnvDialog
File "/usr/lib/python2.7/dist-packages/spyderlib/utils/environ.py", line 17, in <module>
from spyderlib.widgets.dicteditor import DictEditor
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/dicteditor.py", line 39, in <module>
from spyderlib.widgets.dicteditorutils import (sort_against, get_size,
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/dicteditorutils.py", line 78, in <module>
import bs4
File "/usr/lib/python2.7/dist-packages/bs4/__init__.py", line 30, in <module>
from .builder import builder_registry, ParserRejectedMarkup
File "/usr/lib/python2.7/dist-packages/bs4/builder/__init__.py", line 314, in <module>
from . import _html5lib
File "/usr/lib/python2.7/dist-packages/bs4/builder/_html5lib.py", line 70, in <module>
class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):
AttributeError: 'module' object has no attribute '_base'
How to solve this and what could be the reason for the error.
Getting import Error while importing sklearn , the only Error code what it says is libquadmath.so.0 which i'm unale to see on the pkg path but same module works fine in 3.6.1.
>>> import sklearn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/python3/lib/python3.5/site-packages/sklearn/__init__.py", line 57, in <module>
from .base import clone
File "/python3/lib/python3.5/site-packages/sklearn/base.py", line 11, in <module>
from .utils.fixes import signature
File "/python3/lib/python3.5/site-packages/sklearn/utils/__init__.py", line 11, in <module>
from .validation import (as_float_array,
File "/python3/lib/python3.5/site-packages/sklearn/utils/validation.py", line 16, in <module>
from ..utils.fixes import signature
File "/python3/lib/python3.5/site-packages/sklearn/utils/fixes.py", line 324, in <module>
from scipy.sparse.linalg import lsqr as sparse_lsqr
File "/python3/lib/python3.5/site-packages/scipy-0.18.0rc2-py3.5-linux-x86_64.egg/scipy/sparse/linalg/__init__.py", line 112, in <module>
from .isolve import *
File "/python3/lib/python3.5/site-packages/scipy-0.18.0rc2-py3.5-linux-x86_64.egg/scipy/sparse/linalg/isolve/__init__.py", line 6, in <module>
from .iterative import *
File "/python3/lib/python3.5/site-packages/scipy-0.18.0rc2-py3.5-linux-x86_64.egg/scipy/sparse/linalg/isolve/iterative.py", line 7, in <module>
from . import _iterative
ImportError: libquadmath.so.0: cannot open shared object file: No such file or directory
This question already has answers here:
Importing installed package from script with the same name raises "AttributeError: module has no attribute" or an ImportError or NameError
(2 answers)
'module' object has no attribute 'loads' while parsing JSON using python [duplicate]
(2 answers)
Closed 4 years ago.
I am getting this error when I try to install the english model for spacy
ImportError: bad magic number in 'random': b'\x03\xf3\r\n'
Any help would be seriously appreciated
This is the traceback error:
Traceback (most recent call last):
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-packages\spacy\__init__.py", line 4, in <module>
from .cli.info import info as cli_info
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-packages\spacy\cli\__init__.py", line 1, in <module>
from .download import download
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-packages\spacy\cli\download.py", line 10, in <module>
from .link import link
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-packages\spacy\cli\link.py", line 8, in <module>
from ..compat import symlink_to, path2str
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-packages\spacy\compat.py", line 9, in <module>
from thinc.neural.util import copy_array
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-packages\thinc\neural\__init__.py", line 1, in <module>
from ._classes.model import Model
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-packages\thinc\neural\_classes\model.py", line 2, in <module>
from numpy import prod
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import add_newdocs
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-packages\numpy\core\__init__.py", line 74, in <module>
from numpy.testing import _numpy_tester
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-packages\numpy\testing\__init__.py", line 12, in <module>
from . import decorators as dec
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-packages\numpy\testing\decorators.py", line 6, in <module>
from .nose_tools.decorators import *
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-packages\numpy\testing\nose_tools\decorators.py", line 20, in <module>
from .utils import SkipTest, assert_warns
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-packages\numpy\testing\nose_tools\utils.py", line 15, in <module>
from tempfile import mkdtemp, mkstemp
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\tempfile.py", line 45, in <module>
from random import Random as _Random
ImportError: bad magic number in 'random': b'\x03\xf3\r\n'
This is what I used to install scapy and it's English model:
pip install -U spacy
python -m spacy download en
I can not run my Python script or even run command Python to go to python shell. What's wrong with my Python?
machine:project user$ python
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 62, in <module>
import os
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 398, in <module>
import UserDict
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py", line 83, in <module>
import _abcoll
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.py", line 11, in <module>
from abc import ABCMeta, abstractmethod
File "abc.py", line 2, in <module>
import scipy.special
File "/Library/Python/2.7/site-packages/scipy/__init__.py", line 70, in <module>
from numpy import show_config as show_numpy_config
File "/Library/Python/2.7/site-packages/numpy/__init__.py", line 153, in <module>
from . import add_newdocs
File "/Library/Python/2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/Library/Python/2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/Library/Python/2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/Library/Python/2.7/site-packages/numpy/core/__init__.py", line 11, in <module>
from . import numeric
File "/Library/Python/2.7/site-packages/numpy/core/numeric.py", line 5, in <module>
import collections
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.py", line 6, in <module>
__all__ += _abcoll.__all__
AttributeError: 'module' object has no attribute '__all__'
But anyway everything still looks fine if run Python outside my project directory.
You have a local file called abc.py which is hiding the built-in abc module. Rename your file to something else.