Error import six - python

I'm getting an error message while running python script. Below is the error message. Appreciate help to resolve the issue.
When I import "six.moves.http_client import HTTPConnection" it works, issue is when I import HTTPSConnection
>>> from six.moves.http_client import HTTPSConnection
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'HTTPSConnection'
>>> from six.moves.http_client import HTTPSConnection
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'HTTPSConnection'

Related

>>> from app import db Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'app'

While running the code in terminal in python, after importing the db which is written inside my code through app, it was saying that the module is not found. Can any one help me out
> from app import db
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'app'

pyproj.database and pyproj.aoi import failed

I have installed the pyproj.2.6.1 version, and I am using the python3.8.8; I can't correctly import the module query_utm_crs_info from pyproj package.
Here below the code :
from pyproj import Proj, Transformer, CRS
from pyproj.database import query_utm_crs_info
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pyproj.database'
Similar problem with AreaOfInterest
from pyproj.aoi import AreaOfInterest
and I received this message
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pyproj.aoi'
However, if I change it in to
from pyproj.transformer import AreaOfInterest
Any suggestions ?
https://pyproj4.github.io/pyproj/stable/api/database.html#pyproj.database.query_crs_info
query_crs_info was added in pyproj 3.

Setting up an Odoo 12 developer environment, Issues with Werkzeug version

I'm attempting to set up an Odoo 12 instance with a Python 3.7 virtualenv on Ubuntu version 18.04 using Pycharm. I keep getting issues related to Werkzeug as follows:
If I use the desired version of werkzueg written in the requirements.txt file(Werkzeug==0.11.15) I get this error. I think this error comes from werkzueg's version not supporting Python 3.7
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/werkzeug/http.py", line 26, in <module>
from urllib2 import parse_http_list as _parse_list_header
ModuleNotFoundError: No module named 'urllib2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/werkzeug/datastructures.py", line 2700, in <module>
from werkzeug.http import dump_options_header, dump_header, generate_etag, \
ImportError: cannot import name 'dump_options_header' from 'werkzeug.http' (/usr/local/lib/python3.7/dist-packages/werkzeug/http.py)
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/werkzeug/http.py", line 26, in <module>
from urllib2 import parse_http_list as _parse_list_header
ModuleNotFoundError: No module named 'urllib2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/werkzeug/http.py", line 28, in <module>
from urllib.request import parse_http_list as _parse_list_header
ImportError: cannot import name 'parse_http_list' from 'urllib.request' (/usr/lib/python3.7/urllib/request.py)
Original exception was:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/werkzeug/http.py", line 26, in <module>
from urllib2 import parse_http_list as _parse_list_header
ModuleNotFoundError: No module named 'urllib2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/werkzeug/datastructures.py", line 2700, in <module>
from werkzeug.http import dump_options_header, dump_header, generate_etag, \
ImportError: cannot import name 'dump_options_header' from 'werkzeug.http' (/usr/local/lib/python3.7/dist-packages/werkzeug/http.py)
Process finished with exit code 1
If I use the most current version of werkzueg (Werkzeug==1.0.1) I get this error.
Traceback (most recent call last):
File "/home/alexvining/Documents/Odoo Dev Env/Odoo 12/odoo/odoo/http.py", line 32, in <module>
import werkzeug.contrib.sessions
ModuleNotFoundError: No module named 'werkzeug.contrib'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py", line 61, in <module>
import SocketServer as socketserver
ModuleNotFoundError: No module named 'SocketServer'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py", line 58, in <module>
from http.server import BaseHTTPRequestHandler
ModuleNotFoundError: No module named 'http.server'; 'http' is not a package
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py", line 61, in <module>
import SocketServer as socketserver
ModuleNotFoundError: No module named 'SocketServer'
Original exception was:
File "/home/alexvining/Documents/Odoo Dev Env/Odoo 12/odoo/odoo/http.py", line 32, in <module>
import werkzeug.contrib.sessions
ModuleNotFoundError: No module named 'werkzeug.contrib'
During handling of the above exception, another exception occurred:
File "/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py", line 61, in <module>
import SocketServer as socketserver
ModuleNotFoundError: No module named 'SocketServer'
Process finished with exit code 1
Sorry that I had to shorten the error logs, stack overflow was giving me an error saying the message looked like spam.
Any help would be much appreciated!
werkzeug.contrib was removed in v1.0.0.
Changing the requirements.txt entry to
werkzeug==0.16.1
will work.

How can I solve this error in python package?

from pymir import AudioFile
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/pymir/__init__.py", line 1, in <module>
from AudioFile import AudioFile
ImportError: No module named 'AudioFile'
Please answer.Thanks in advance!

test_ssl.py and test_urllib2.py tests are failing in python2.7

test_ssl.py
root#yasir:/home/yasir/PYTHON/python2.7-2.7.6/Lib/test# python python test_ssl.py
Traceback (most recent call last):
File "test_ssl.py", line 7, in <module>
from test.script_helper import assert_python_ok
ImportError: No module named script_helper
test_urllib2.py
root#yasir:/home/yasir/PYTHON/python2.7-2.7.6/Lib/test# python test_urllib2.py
Traceback (most recent call last):
File "test_urllib2.py", line 3, in <module>
from test import test_urllib
ImportError: cannot import name test_urllib
I'm not able to understand which module is missing so facing this error
tests failed due to missing python module libpython2.7-testsuite

Categories

Resources