Why do I get an error message although I have installed thonny sqlite3 correctly - sqlite

I want to use thonny sqlite3. I am installing sqlite3 module with Thonny Manage Packages.But after typing import sqlite3, when I want to run it in this state, it gives the following error message:
File "<stdin>", line 3, in <module>
File "/lib/sqlite3.py", line 11, in <module>
AttributeError: 'NoneType' object has no attribute 'func'
Thank for your help.

Related

Python gprc AttributeError: 'NoneType' object has no attribute 'message_types_by_name'

I just want to complete a simple demo, but I got this error message.
Traceback (most recent call last):
File "E:/grpc/biliService.py", line 10, in <module>
import hello_bilibili_pb2 as pb2
File "E:\grpc\hello_bilibili_pb2.py", line 21, in <module>
_HELLODEWEIREQ = DESCRIPTOR.message_types_by_name['HelloDeweiReq']
AttributeError: 'NoneType' object has no attribute 'message_types_by_name'
grpcio==1.30.0
grpcio-tools==1.30.0
The latest grpcio version 1.44.0 generate incompatible pb2 files, so I've seen the same question, I downgrade grpcio 1.30.0, and it worked.

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

Jupyter will not launch from Anaconda Navigator 32bit

I read where running installing pyqt5 or pip install pyqt5 would correct this error. Did not work for my enviornment. Any suggestions?
Traceback (most recent call last):
File "C:\Users\Paula\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 10, in
import sqlite3
File "C:\Users\Paula\Anaconda3\lib\sqlite3\__init__.py", line 23, in
from sqlite3.dbapi2 import *
File "C:\Users\Paula\Anaconda3\lib\sqlite3\dbapi2.py", line 27, in
from _sqlite3 import *
ImportError: DLL load failed: The specified procedure could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Paula\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
from notebook.notebookapp import main
File "C:\Users\Paula\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 86, in
from .services.sessions.sessionmanager import SessionManager
File "C:\Users\Paula\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 13, in
from pysqlite2 import dbapi2 as sqlite3
ModuleNotFoundError: No module named 'pysqlite2'

ImportError: No module named cryptography.hazmat.backends - anaconda on windows

I am using the Anaconda environment for python.
I have installed the paramiko (v. 2.0.2) and cryptography (v 1.5) modules using the Anaconda Navigator..
When I try to execute this import statement:
import netmiko
I get an error message "ImportError: No module named cryptography.hazmat.backends"
The total output in the cmd window is:
>>> import netmiko
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build\bdist.win-amd64\egg\netmiko\__init__.py", line 1, in <module>
File "build\bdist.win-amd64\egg\netmiko\ssh_dispatcher.py", line 3, in <module>
File "build\bdist.win-amd64\egg\netmiko\cisco\__init__.py", line 1, in <module>
File "build\bdist.win-amd64\egg\netmiko\cisco\cisco_ios_ssh.py", line 1, in <module>
File "build\bdist.win-amd64\egg\netmiko\ssh_connection.py", line 3, in <module>
File "build\bdist.win-amd64\egg\netmiko\base_connection.py", line 13, in <module>
File "build\bdist.win-amd64\egg\paramiko\__init__.py", line 30, in <module>
File "build\bdist.win-amd64\egg\paramiko\transport.py", line 32, in <module>
ImportError: No module named cryptography.hazmat.backends
Does anyone know how to fix this?
Any help is appreciated.
I guess the right order for the commands would be:
#apt-get update
#apt-get install python-dev
#apt-get install libffi-dev
#pip install cryptography
It solved the issue in my case
You're probably running into a problem because you don't have libffi-dev installed. Installing "python-dev" and "libffi-dev" at the OS layer may help.

cx_freeze error with pyodbc

if you have a simple program name pyodbcTest.py
import pyodbc
print "pass"
and then use cx_freeze to compile it
cxfreeze --targe-dir=cxTest pyodbcTest.py
and then run that program it throws the following error.
C:\temp\pythonWork\cxTest>pyodbcTest.exe
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27, in <module>
exec code in m.__dict__
File "pyodbcTest.py", line 1, in <module>
RuntimeError: Unable to import decimal
Any ideas?
I had to add the option --include-module decimal to solve the problem. Not sure why it could not find that one on its own during the freeze process, but its working now

Resources