jupyter notebook python compatibility - python

I am totally new to Python/Jupyter notebook.
Using Windows 11. I installed latest version python Python 3.11.1. Also latest Anaconda - conda 22.9.0.
My jupyter notebook (installed by anaconda) does not start from command line:
jupyter notebook
Traceback (most recent call last):
File "C:\apps\anaconda\Scripts\jupyter-notebook-script.py", line 6, in from notebook.notebookapp import main
File "C:\apps\anaconda\lib\site-packages\notebook\notebookapp.py", line 77, in from .services.kernels.kernelmanager import MappingKernelManager, AsyncMappingKernelManager
File "C:\apps\anaconda\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 18, in
from jupyter_client.session import Session
File "C:\apps\anaconda\lib\site-packages\jupyter_client_init_.py", line 8, in from .asynchronous import AsyncKernelClient # noqa
File "C:\apps\anaconda\lib\site-packages\jupyter_client\asynchronous_init_.py", line 1, in
from .client import AsyncKernelClient # noqa
File "C:\apps\anaconda\lib\site-packages\jupyter_client\asynchronous\client.py", line 6, in
from jupyter_client.channels import HBChannel
File "C:\apps\anaconda\lib\site-packages\jupyter_client\channels.py", line 12, in import zmq.asyncio
File "C:\apps\anaconda\lib\site-packages\zmq_init_.py", line 103, in from zmq import backend
File "C:\apps\anaconda\lib\site-packages\zmq\backend_init_.py", line 31, in raise original_error from None
File "C:\apps\anaconda\lib\site-packages\zmq\backend_init_.py", line 26, in ns = select_backend(first)
File "C:\apps\anaconda\lib\site-packages\zmq\backend\select.py", line 31, in select_backend mod = import_module(name)
File "C:\apps\anaconda\lib\importlib_init.py", line 127, in import_module return _bootstrap.gcd_import(name[level:], package, level)
File "C:\apps\anaconda\lib\site-packages\zmq\backend\cython_init.py", line 6, in
from . import (ImportError: DLL load failed while importing _device: The specified module could not be found.
Conda documentation states "Anaconda supports Python 3.7, 3.8, 3.9 and 3.10. The current default is Python 3.9."
Should I just downgrade my python to 3.9 or 3.10 (I dont care) ?? Any other work arounds?
Updates
Could open the jupyter notebook from the conda prompt. Not stated using it yet. So lets see. If python compatibility issues need to be resolved - need to figure it out.
But, cant start the anaconda-navigator. When I try start from windows start menu - does nothing. From Conda prompt: I get the flwg error on the prompt: >anaconda-navigator Traceback (most recent call last): File "C:\apps\anaconda\Scripts\anaconda-navigator-script.py", line 6, in <module> from anaconda_navigator.app.main import main File "C:\apps\anaconda\lib\site-packages\anaconda_navigator\app\main.py", line 19, in <module> from anaconda_navigator.app.start import start_app File "C:\apps\anaconda\lib\site-packages\anaconda_navigator\app\start.py", line 15, in <module> from qtpy.QtCore import QCoreApplication, QEvent, QObject, Qt # pylint: disable=no-name-in-module File "C:\apps\anaconda\lib\site-packages\qtpy\QtCore.py", line 15, in <module> from PyQt5.QtCore import * ImportError: DLL load failed while importing QtCore: The specified procedure could not be found.

Related

Unable to launch any application on my anaconda platform

Greetings: please neither jupyterlab, jupyternotebook, spyder none of them are working, it keeps giving me bunch of dependency errors and i don't even understand the errors: below are some when i launch spyder
Traceback (most recent call last):
File "/Users/mac/Public/anaconda3/bin/spyder", line 11, in
sys.exit(main())
File "/Users/mac/Public/anaconda3/lib/python3.9/site-packages/spyder/app/start.py", line 128, in main
from spyder.config.manager import CONF
File "/Users/mac/Public/anaconda3/lib/python3.9/site-packages/spyder/config/manager.py", line 22, in
from spyder.config.main import CONF_VERSION, DEFAULTS, NAME_MAP
File "/Users/mac/Public/anaconda3/lib/python3.9/site-packages/spyder/config/main.py", line 21, in
from spyder.config.appearance import APPEARANCE
File "/Users/mac/Public/anaconda3/lib/python3.9/site-packages/spyder/config/appearance.py", line 15, in
from spyder.plugins.help.utils.sphinxify import CSS_PATH
File "/Users/mac/Public/anaconda3/lib/python3.9/site-packages/spyder/plugins/help/utils/sphinxify.py", line 34, in
from jinja2 import Environment, FileSystemLoader
File "/Users/mac/Public/anaconda3/lib/python3.9/site-packages/jinja2/init.py", line 12, in
from .environment import Environment
File "/Users/mac/Public/anaconda3/lib/python3.9/site-packages/jinja2/environment.py", line 25, in
from .defaults import BLOCK_END_STRING
File "/Users/mac/Public/anaconda3/lib/python3.9/site-packages/jinja2/defaults.py", line 3, in
from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401
File "/Users/mac/Public/anaconda3/lib/python3.9/site-packages/jinja2/filters.py", line 13, in
from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/Users/mac/.local/lib/python3.9/site-packages/markupsafe/init.py)
PS. anyone who understands what's happening should please help me i need to submit a project today
i already uninstalled and installed new anaconda, i tried downgrading it, i tried importing some of the dependency manually. yet all show to no avail

Anaconda/Conda on OS X 11 -- Broken Jupyter Notebook with DEFAULT installation

I am running the latest Anaconda on OS X 11 and cannot for the life of me figure out how to get jupyter notebook to run. It ends in this error:
% jupyter notebook
Traceback (most recent call last):
File "/usr/local/opt/anaconda3/bin/jupyter-notebook", line 7, in <module>
from notebook.notebookapp import main
File "/usr/local/opt/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 85, in <module>
from .services.contents.manager import ContentsManager
File "/usr/local/opt/anaconda3/lib/python3.7/site-packages/notebook/services/contents/manager.py", line 17, in <module>
from nbformat import sign, validate as validate_nb, ValidationError
File "/usr/local/opt/anaconda3/lib/python3.7/site-packages/nbformat/__init__.py", line 32, in <module>
from .validator import validate, ValidationError
File "/usr/local/opt/anaconda3/lib/python3.7/site-packages/nbformat/validator.py", line 12, in <module>
from .json_compat import get_current_validator, ValidationError
File "/usr/local/opt/anaconda3/lib/python3.7/site-packages/nbformat/json_compat.py", line 10, in <module>
import jsonschema
File "/usr/local/opt/anaconda3/lib/python3.7/site-packages/jsonschema/__init__.py", line 32, in <module>
from pkg_resources import get_distribution
ModuleNotFoundError: No module named 'pkg_resources'
I have tried fresh installs of both miniconda and anaconda without success. Nothing seems to work.
It baffles me that a default install of anaconda (no updates, no extra packages, nothing) is broken. Do these people even test their stuff?
Any solutions or suggestions? Thanks in advance!

jupyter notebook and spyder not launching from anaconda prompt.However it was working fine earlier. It is giving me the following error:

(base) C:\Users\Aakash\anaconda3>jupyter notebook
Traceback (most recent call last):
File "C:\Users\Aakash\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
from notebook.notebookapp import main
File "C:\Users\Aakash\anaconda3\lib\site-packages\notebook\notebookapp.py", line 49, in
from zmq.eventloop import ioloop
File "C:\Users\Aakash\anaconda3\lib\site-packages\zmq__init__.py", line 47, in
from zmq import backend
File "C:\Users\Aakash\anaconda3\lib\site-packages\zmq\backend__init__.py", line 40, in
reraise(*exc_info)
File "C:\Users\Aakash\anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\Aakash\anaconda3\lib\site-packages\zmq\backend__init__.py", line 27, in
_ns = select_backend(first)
File "C:\Users\Aakash\anaconda3\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = import(name, fromlist=public_api)
File "C:\Users\Aakash\anaconda3\lib\site-packages\zmq\backend\cython__init__.py", line 6, in
from . import (constants, error, message, context,
ImportError: DLL load failed: The specified module could not be found.
Run these on anaconda prompt:
conda upgrade qt
OR
conda uninstall tornado
conda install tornado==6.0.4
OR
Check these previous answers
Anaconda Navigator Jupyter and Spyder won't start after successful installation

Cannot import tensorflow in python3 and ImportError: This package should not be accessible on Python 3

I am trying to use tensorflow for research in my macbook. I use pip3 to install tensorflow in the system (not in virtual environment).
At first, I just want to verify tensorflow can be correctly imported via python3 in terminal. However, sometimes, I got the following problem when importing.
>>>import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/cyan/Library/Python/3.5/lib/python/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/Users/cyan/Library/Python/3.5/lib/python/site-packages/tensorflow/python/__init__.py", line 47, in <module>
import numpy as np
File "/Library/Python/2.7/site-packages/numpy/__init__.py", line 142, 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 14, in <module>
from . import multiarray
ImportError: dlopen(/Library/Python/2.7/site-packages/numpy/core/multiarray.so, 2): Symbol not found: _PyBuffer_Type
Referenced from: /Library/Python/2.7/site-packages/numpy/core/multiarray.so
Expected in: flat namespace in /Library/Python/2.7/site-packages/numpy/core/multiarray.so
This error could only be solved if I ran the following code firstly before python3 execution
unset PYTHONPATH
If I didn't unset PYTHONPATH, I also found errors when checking the version of pip3 using
pip3 --version
The errors are shown as follows.
>> pip3 --version
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 6, in <module>
from pip._internal import main
File "/Library/Python/2.7/site-packages/pip/_internal/__init__.py", line 19, in <module>
from pip._vendor.urllib3.exceptions import DependencyWarning
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/connectionpool.py", line 11, in <module>
from .exceptions import (
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/exceptions.py", line 2, in <module>
from .packages.six.moves.http_client import (
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/packages/six.py", line 203, in load_module
mod = mod._resolve()
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/packages/six.py", line 115, in _resolve
return _import_module(self.mod)
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/packages/six.py", line 82, in _import_module
__import__(name)
File "/Library/Python/2.7/site-packages/http/__init__.py", line 7, in <module>
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
I thought it was so inconvenient to unset PYTHONPATH every time, so is there any solutions for this problem? I also want to import tensorflow in other text editor, such as Sublime and Pycharm, so I was really not sure what to do next.
I tried the same scenario. It is working fine for me. In the first error it seems your python installation is messed up. If you are using python3 in terminal, it should not refer to 2.7 libraries.
Also I dont think you require unset PYTHONPATH everytime. First thing is you dont need to setup PYTHONPATH. It seems the installation got issue.
You using homebrew in mac to install packages. If not I will say use homebrew and it will work as charm. As it adds dependency properly.
Thanks,
Ashish

Launch of orange3

I tried to launch of Orange 3 on Anaconda. But launch have produced errors below.
Traceback (most recent call last):
File "C:\Users\tomo\Anaconda2\envs\orange3\Scripts\orange-canvas-script.py", line 6, in
from Orange.canvas.__main__ import main
File "C:\Users\tomo\Anaconda2\envs\orange3\lib\site-packages\Orange\canvas\__main__.py", line 30, in
from Orange.canvas.application.canvasmain import CanvasMainWindow
File "C:\Users\tomo\Anaconda2\envs\orange3\lib\site-packages\Orange\canvas\application\canvasmain.py", line 61, in
from .canvastooldock import CanvasToolDock, QuickCategoryToolbar, \
File "C:\Users\tomo\Anaconda2\envs\orange3\lib\site-packages\Orange\canvas\application\canvastooldock.py", line 25, in
from ..document.quickmenu import MenuPage
File "C:\Users\tomo\Anaconda2\envs\orange3\lib\site-packages\Orange\canvas\document\__init__.py", line 17, in
from .schemeedit import SchemeEditWidget
File "C:\Users\tomo\Anaconda2\envs\orange3\lib\site-packages\Orange\canvas\document\schemeedit.py", line 37, in
from .suggestions import Suggestions
File "C:\Users\tomo\Anaconda2\envs\orange3\lib\site-packages\Orange\canvas\document\suggestions.py", line 7, in
from .interactions import NewLinkAction
File "C:\Users\tomo\Anaconda2\envs\orange3\lib\site-packages\Orange\canvas\document\interactions.py", line 28, in
from ..canvas import items
File "C:\Users\tomo\Anaconda2\envs\orange3\lib\site-packages\Orange\canvas\canvas\items\__init__.py", line 9, in
from .annotationitem import TextAnnotation, ArrowAnnotation
File "C:\Users\tomo\Anaconda2\envs\orange3\lib\site-packages\Orange\canvas\canvas\items\annotationitem.py", line 7, in
import CommonMark
ModuleNotFoundError: No module named 'CommonMark'
Acutually I found these error on this web and tried to install the r-commonmark 1.4 but it does not work well now.
Please tell me how to deal with it.
CommonMark is a package that Orange used. It was renamed in the latest release what causes that imports do not work. The issue should be solved by installing newer Orange3 version3.16.0

Categories

Resources