Python 3.11. Issue - python-3.x

I've installed fresh version of Python 3.11. on Win 10 x64 and figured I should try Jupyter notebook, but after installing it using pip command (without any kind of error and previously adding python to environment variable path) I've received this error:
`
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python311\Scripts\jupyter-notebook.EXE\__main__.py", line 4, in <module>
File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python311\Lib\site-packages\notebook\notebookapp.py", line 59, in <module>
from tornado import httpserver
File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\httpserver.py", line 32, in <module>
from tornado.http1connection import HTTP1ServerConnection, HTTP1ConnectionParameters
File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\http1connection.py", line 34, in <module>
from tornado import iostream
File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\iostream.py", line 40, in <module>
from tornado.netutil import ssl_wrap_socket, _client_ssl_defaults, _server_ssl_defaults
File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\netutil.py", line 35, in <module>
_client_ssl_defaults = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 775, in create_default_context
context.load_default_certs(purpose)
File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 596, in load_default_certs
self._load_windows_store_certs(storename, purpose)
File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 588, in _load_windows_store_certs
self.load_verify_locations(cadata=certs)
ssl.SSLError: [ASN1] nested asn1 error (_ssl.c:4004)
`
searching stack overflow as wheel as gitHub resulted in many dead ends.
I would be very grateful for any kind of assistance.

Related

python virtual env issue

While using command pipenv shell to create virtual env for project it shows below error:
“Creating a virtualenv for this project...
Pipfile: /opt/fiware-env/ckan/Pipfile
Using /usr/bin/python3.5 (3.5.2) to create virtualenv...
✘ Failed creating virtual environment
[pipenv.exceptions.VirtualenvCreationException]: Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 174, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.5/runpy.py", line 133, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.5/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/usr/local/lib/python3.5/dist-packages/virtualenv/__init__.py", line 3, in <module>
from .run import cli_run, session_via_cli
File "/usr/local/lib/python3.5/dist-packages/virtualenv/run/__init__.py", line 13, in <module>
from .plugin.activators import ActivationSelector
File "/usr/local/lib/python3.5/dist-packages/virtualenv/run/plugin/activators.py", line 6, in <module>
from .base import ComponentBuilder
File "/usr/local/lib/python3.5/dist-packages/virtualenv/run/plugin/base.py", line 9, in <module>
from importlib_metadata import entry_points
File "/usr/local/lib/python3.5/dist-packages/importlib_metadata/__init__.py", line 88
dist: Optional['Distribution'] = None
^
SyntaxError: invalid syntax
Failed to create virtual environment.”
using python version 3.5.2
Any suggestions would be great. Thank you

IPython Not opening (invalid syntax)

I have installed IPython using the command:
python3.7 -m pip install ipython
And it gave the prompt of successful installation as well but when i try to open IPython using the command:
python3.7 -m IPython
(NOTE: using IPython instead of ipython because that's how it is stored in my system)
I am getting the following error:
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.7/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.7/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/usr/local/lib/python3.7/dist-packages/IPython/__init__.py", line 54, in <module>
from .core.application import Application
File "/usr/local/lib/python3.7/dist-packages/IPython/core/application.py", line 25, in <module>
from IPython.core import release, crashhandler
File "/usr/local/lib/python3.7/dist-packages/IPython/core/crashhandler.py", line 27, in <module>
from IPython.core import ultratb
File "/usr/local/lib/python3.7/dist-packages/IPython/core/ultratb.py", line 119, in <module>
from IPython.utils import path as util_path
File "/usr/local/lib/python3.7/dist-packages/IPython/utils/path.py", line 17, in <module>
from IPython.utils.process import system
File "/usr/local/lib/python3.7/dist-packages/IPython/utils/process.py", line 19, in <module>
from ._process_posix import system, getoutput, arg_split, check_pid
File "/usr/local/lib/python3.7/dist-packages/IPython/utils/_process_posix.py", line 23, in <module>
import pexpect
File "/usr/lib/python3/dist-packages/pexpect/__init__.py", line 75, in <module>
from .pty_spawn import spawn, spawnu
File "/usr/lib/python3/dist-packages/pexpect/pty_spawn.py", line 15, in <module>
from .spawnbase import SpawnBase
File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 218
def expect(self, pattern, timeout=-1, searchwindowsize=-1, async=False):
^
SyntaxError: invalid syntax
Download pexpect4.6 source code from https://github.com/pexpect/pexpect/releases/tag/4.6
Extract the source code, get into the folder and install the pexpect by:
sudo python3.7 setup.py install
This should solve your problem. :)

Getting DLL error with 'jupyter lab' command in Anaconda Installation

Getting DLL error with 'jupyter lab' command in Anaconda Installation:
Details for system:
conda 4.5.11
Python 3.7.0
jupyter 4.4.0
Height of weirdness is that I am able to launch jupyter lab from Anaconda Navigator, but 'jupyter lab' is not working and throwing below exception:
Traceback (most recent call last):
File "c:\ml\installed_tools\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\ml\installed_tools\anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\ML\installed_tools\anaconda3\Scripts\jupyter-lab.EXE\__main__.py", line 5, in <module>
File "c:\ml\installed_tools\anaconda3\lib\site-packages\jupyterlab\labapp.py", line 12, in <module>
from jupyterlab_server import slugify, WORKSPACE_EXTENSION
File "c:\ml\installed_tools\anaconda3\lib\site-packages\jupyterlab_server\__init__.py", line 4, in <module>
from .app import LabServerApp
File "c:\ml\installed_tools\anaconda3\lib\site-packages\jupyterlab_server\app.py", line 9, in <module>
from .server import ServerApp
File "c:\ml\installed_tools\anaconda3\lib\site-packages\jupyterlab_server\server.py", line 32, in <module>
from jupyter_server.serverapp import ServerApp, aliases, flags # noqa
File "c:\ml\installed_tools\anaconda3\lib\site-packages\jupyter_server\serverapp.py", line 46, in <module>
from zmq.eventloop import ioloop
File "c:\ml\installed_tools\anaconda3\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "c:\ml\installed_tools\anaconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "c:\ml\installed_tools\anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "c:\ml\installed_tools\anaconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "c:\ml\installed_tools\anaconda3\lib\site-packages\zmq\backend\select.py", line 27, in select_backend
mod = __import__(name, fromlist=public_api)
File "c:\ml\installed_tools\anaconda3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed: The specified module could not be found.
Although I have posted this question, but now I also got a solution for the same.
Please add following in the path variable, it will be resolved thereafter (I just checked):
C:\ML\installed_tools\anaconda3 (was already present)
C:\ML\installed_tools\anaconda3\Scripts (was already present)
C:\ML\installed_tools\anaconda3\Library\bin (added now)
C:\ML\installed_tools\anaconda3\Library\mingw-w64\bin (added now)

tensorboard debugger is not working

I have tried to initialise the tensorboard debugger via the following command
tensorboard --logdir summarytrain/ --debugger_port 7000
The output from this command is:
Traceback (most recent call last): File "c:\users\krisb\appdata\local\programs\python\python36\lib\site-packages\tensorboard\plugins\debugger\debugger_plugin_loader.py", line 79, in _ConstructDebuggerPluginWithGrpcPort from tensorboard.plugins.debugger import debugger_plugin as debugger_plugin_lib File "c:\users\krisb\appdata\local\programs\python\python36\lib\site-packages\tensorboard\plugins\debugger\debugger_plugin.py", line 36, in from tensorboard.plugins.debugger import debugger_server_lib File "c:\users\krisb\appdata\local\programs\python\python36\lib\site-packages\tensorboard\plugins\debugger\debugger_server_lib.py", line 33, in from tensorflow.python.debug.lib import grpc_debug_server File "c:\users\krisb\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\debug\lib\grpc_debug_server.py", line 27, in import grpc ModuleNotFoundError: No module named 'grpc' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:\users\krisb\appdata\local\programs\python\python36\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "c:\users\krisb\appdata\local\programs\python\python36\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\krisb\AppData\Local\Programs\Python\Python36\Scripts\tensorboard.exe__main__.py", line 9, in File "c:\users\krisb\appdata\local\programs\python\python36\lib\site-packages\tensorboard\main.py", line 36, in run_main tf.app.run(main) File "c:\users\krisb\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\platform\app.py", line 124, in run _sys.exit(main(argv)) File "c:\users\krisb\appdata\local\programs\python\python36\lib\site-packages\tensorboard\main.py", line 45, in main default.get_assets_zip_provider()) File "c:\users\krisb\appdata\local\programs\python\python36\lib\site-packages\tensorboard\program.py", line 165, in main tb = create_tb_app(plugins, assets_zip_provider) File "c:\users\krisb\appdata\local\programs\python\python36\lib\site-packages\tensorboard\program.py", line 199, in create_tb_app window_title=FLAGS.window_title) File "c:\users\krisb\appdata\local\programs\python\python36\lib\site-packages\tensorboard\backend\application.py", line 126, in standard_tensorboard_wsgi plugin_instances = [constructor(context) for constructor in plugins] File "c:\users\krisb\appdata\local\programs\python\python36\lib\site-packages\tensorboard\backend\application.py", line 126, in plugin_instances = [constructor(context) for constructor in plugins] File "c:\users\krisb\appdata\local\programs\python\python36\lib\site-packages\tensorboard\plugins\debugger\debugger_plugin_loader.py", line 87, in _ConstructDebuggerPluginWithGrpcPort err.message + AttributeError: 'ModuleNotFoundError' object has no attribute 'message'
I have tried to install GPRC via pip install gprc but i get the following error too
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\krisb\AppData\Local\Temp\pip-install-h7zjk7ly\grpc\
Totally stuck - anyone have any solutions?
Turns out the solution to this problem is to install
grpcio
Therefore enter
pip install grpcio

Sphinx throws an exception on Python 3.4/Windows

I have successfully installed the sphnix on Windows/Python 3.4, then successfully generated a basic structure by calling sphinx-quickstart.
But when calling sphinx-build html or make html, it throws an exception:
D:\my-doc>make html
Traceback (most recent call last):
File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main "__main__", mod_spec)
File "C:\Python34\lib\runpy.py", line 85, in _run_code exec(code, run_globals)
File "C:\Python34\Scripts\sphinx-build.exe\__main__.py", line 9, in <module>
File "C:\Python34\lib\site-packages\sphinx\__init__.py", line 51, in main sys.exit(build_main(argv))
File "C:\Python34\lib\site-packages\sphinx\__init__.py", line 61, in build_main from sphinx import cmdline
File "C:\Python34\lib\site-packages\sphinx\cmdline.py", line 23, in <module> from sphinx.application import Sphinx
File "C:\Python34\lib\site-packages\sphinx\application.py", line 37, in <module> from sphinx.builders import BUILTIN_BUILDERS
File "C:\Python34\lib\site-packages\sphinx\builders\__init__.py", line 23, in <module> from sphinx.util import i18n, path_stabilize
File "C:\Python34\lib\site-packages\sphinx\util\i18n.py", line 15, in <module> from babel.messages.pofile import read_po
File "C:\Python34\lib\site-packages\babel\messages\__init__.py", line 12, in <module> from babel.messages.catalog import *
File "C:\Python34\lib\site-packages\babel\messages\catalog.py", line 23, in <module> from babel.dates import format_datetime
File "C:\Python34\lib\site-packages\babel\dates.py", line 28, in <module> from babel.util import UTC, LOCALTZ
File "C:\Python34\lib\site-packages\babel\util.py", line 278, in <module> from babel import localtime
File "C:\Python34\lib\site-packages\babel\localtime\__init__.py", line 21, in <module> from babel.localtime._win32 import _get_localzone
File "C:\Python34\lib\site-packages\babel\localtime\_win32.py", line 18, in <module> tz_names = get_global('windows_zone_mapping')
File "C:\Python34\lib\site-packages\babel\core.py", line 58, in get_global _global_data = pickle.load(fileobj) TypeError: an integer is required (got type str)
I guess this is about compatibilities, since I have followed the tutorial step by step. Also been googling for this issue for hours and could not find an answer so far. Is it something I'm doing wrong or is it a compatibility issue?
The bug appears to be in babel v2.0. I downgraded to 1.3 (pip install babel==1.3) and the issue went away. Let me know if this works for you.

Resources