Anaconda fails to launch my Jupyter because of launch error - jupyter-notebook

I tried to launch the Jupyter notebook from Anaconda and I am getting these errors:
Traceback (most recent call last):
File "C:\Users\saiki\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
from notebook.notebookapp import main
File "C:\Users\saiki\anaconda3\lib\site-packages\notebook\notebookapp.py", line 44, in
from jinja2 import Environment, FileSystemLoader
File "C:\Users\saiki\anaconda3\lib\site-packages\jinja2\__init__.py", line 12, in
from .environment import Environment
File "C:\Users\saiki\anaconda3\lib\site-packages\jinja2\environment.py", line 25, in
from .defaults import BLOCK_END_STRING
File "C:\Users\saiki\anaconda3\lib\site-packages\jinja2\defaults.py", line 3, in
from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401
File "C:\Users\saiki\anaconda3\lib\site-packages\jinja2\filters.py", line 13, in
from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (C:\Users\saiki\AppData\Roaming\Python\Python39\site-packages\markupsafe\__init__.py)
It was working properly until I installed pandas-profiling library in my Anaconda Powershell prompt.
How to rectify this?

I found such an issue on github: https://github.com/aws/aws-sam-cli/issues/3661
Downgrading markupsafe to 2.0.1 fixes the issue on my side.
pip install markupsafe==2.0.1

Related

Getting an error while opening jupyter Notebook in Ubuntu

Traceback (most recent call last):
File "/home/mohit/anaconda3/bin/jupyter-notebook", line 7, in
from notebook.notebookapp import main
File "/home/mohit/anaconda3/lib/python3.8/site-packages/notebook/notebookapp.py", line 83, in
from .services.kernels.kernelmanager import MappingKernelManager, AsyncMappingKernelManager
File "/home/mohit/anaconda3/lib/python3.8/site-packages/notebook/services/kernels/kernelmanager.py", line 18, in
from jupyter_client.session import Session
File "/home/mohit/anaconda3/lib/python3.8/site-packages/jupyter_client/session.py", line 41, in
from jupyter_client.jsonutil import extract_dates, squash_dates, date_default
File "/home/mohit/anaconda3/lib/python3.8/site-packages/jupyter_client/jsonutil.py", line 10, in
from dateutil.parser import parse as _dateutil_parse
File "/home/mohit/anaconda3/lib/python3.8/site-packages/dateutil/parser.py", line 158
l.append("%s=%s" % (attr, `value`))
^
SyntaxError: invalid syntax
pip install python-dateutil --upgrade will solve your problem

Apprication launch error: cannot import name 'metadata' from 'importlib'

I have problem with starting my jupyter notebook after uninstalling and updating of sklearn library
as below.
conda uninstall scikit-learn --yes
conda install scikit-learn==0.23.1
I can not start my jupyter notebook from ANACONDA NAGIGATOR by clicking the jupyter notebook launch button.
The Application launch error says,
Traceback (most recent call last):
File "D:\Anaconda3\lib\site-packages\jsonschema\__init__.py", line 31, in
from importlib import metadata
ImportError: cannot import name 'metadata' from 'importlib' (D:\Anaconda3\lib\importlib\__init__.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
from notebook.notebookapp import main
File "D:\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 85, in
from .services.contents.manager import ContentsManager
File "D:\Anaconda3\lib\site-packages\notebook\services\contents\manager.py", line 17, in
from nbformat import sign, validate as validate_nb, ValidationError
File "D:\Anaconda3\lib\site-packages\nbformat\__init__.py", line 32, in
from .validator import validate, ValidationError
File "D:\Anaconda3\lib\site-packages\nbformat\validator.py", line 12, in
from .json_compat import get_current_validator, ValidationError
File "D:\Anaconda3\lib\site-packages\nbformat\json_compat.py", line 10, in
import jsonschema
File "D:\Anaconda3\lib\site-packages\jsonschema\__init__.py", line 33, in
import importlib_metadata as metadata
ModuleNotFoundError: No module named 'importlib_metadata'
Dose anyone know how to solve this problem?

unable to initialize airflow database after installing airflow

I installed on a fresh version of airflow using Python 3.7.4 on Mac OS Catalina 10.15.1.
By running:
$ pip install 'apache-airflow[s3,postgres,celery,hdfs,jdbc,hive,slack,crypto,redis]==1.10.4'
When I run:
$ airflow initidb
I get the following error message:
Traceback (most recent call last):
File "/Users/user/opt/anaconda3/bin/airflow", line 21, in <module>
from airflow import configuration
File "/Users/user/opt/anaconda3/lib/python3.7/site-packages/airflow/__init__.py", line 31, in <module>
from airflow.utils.log.logging_mixin import LoggingMixin
File "/Users/user/opt/anaconda3/lib/python3.7/site-packages/airflow/utils/__init__.py", line 24, in <module>
from .decorators import apply_defaults as _apply_defaults
File "/Users/user/opt/anaconda3/lib/python3.7/site-packages/airflow/utils/decorators.py", line 34, in <module>
from airflow import settings
File "/Users/user/opt/anaconda3/lib/python3.7/site-packages/airflow/settings.py", line 36, in <module>
from airflow.configuration import conf, AIRFLOW_HOME, WEBSERVER_CONFIG # NOQA F401
File "/Users/user/opt/anaconda3/lib/python3.7/site-packages/airflow/configuration.py", line 29, in <module>
from future import standard_library
ValueError: source code string cannot contain null bytes
I'm wondering if anyone has any suggestions.
Thanks.
I think I figured it out. The future module I had was corrupt, so I just re-installed things and it seems to work now.

how to resolve the error" ImportError: cannot import name 'HIDE_CURSOR' " in python 3.6.5

when I am installing a package in python 3.6.5 an error occurs:
"ImportError: cannot import name 'HIDE_CURSOR'"
command: pip install
pip install glob Traceback (most recent call last): File
"c:\python\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec) File "c:\python\lib\runpy.py", line 85, in _run_code
exec(code, run_globals) File "C:\python\Scripts\pip.exe__main__.py", line 5, in File
"c:\python\lib\site-packages\pip_internal__init__.py", line 40, in
from pip._internal.cli.autocompletion import autocomplete File "c:\python\lib\site-packages\pip_internal\cli\autocompletion.py",
line 8, in
from pip._internal.cli.main_parser import create_main_parser File "c:\python\lib\site-packages\pip_internal\cli\main_parser.py",
line 8, in
from pip._internal.cli import cmdoptions File "c:\python\lib\site-packages\pip_internal\cli\cmdoptions.py", line
24, in
from pip._internal.utils.ui import BAR_TYPES File "c:\python\lib\site-packages\pip_internal\utils\ui.py", line 11, in
from pip._vendor.progress import HIDE_CURSOR, SHOW_CURSOR ImportError: cannot import name 'HIDE_CURSOR'
Any help is appreciated.
I simply reinstalled pip by downloading pip from here and reinstalled using cmd python get-pip.pyonce in the directory.
Thats all that seemed to work for me, hope you get it sorted!

Problem when importing distributed on Ubuntu 18.04

I am trying to import distributed version 1.22.0 installed with pip3.
However, I get this error :
>>> import distributed
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/distributed/__init__.py", line 5, in <module>
from .core import connect, rpc
File "/usr/local/lib/python3.6/dist-packages/distributed/core.py", line 25, in <module>
from .system_monitor import SystemMonitor
File "/usr/local/lib/python3.6/dist-packages/distributed/system_monitor.py", line 4, in <module>
import psutil
File "/home/users/ej/.local/lib/python3.6/site-packages/psutil/__init__.py", line 100, in <module>
from . import _pslinux as _psplatform
File "/home/users/ej/.local/lib/python3.6/site-packages/psutil/_pslinux.py", line 26, in <module>
from . import _psutil_linux as cext
ImportError: /home/users/ej/.local/lib/python3.6/site-packages/psutil/_psutil_linux.cpython-36m-x86_64-linux-gnu.so: failed to map segment from shared object
>>>
I have dask version 0.18.1 installed with pip3.
I work on Ubuntu 18.04 with python3.
I tried reinstall and install but no solution.
Could you help me please ?
Thanks in advance.

Resources