I am facing problem to connect postgresql with superset while i giving my connection username,password hostname and database name
and when we click on test connection even I have install postgresql and psycopg2.
It says
ERROR: {"error": "Connection failed!
The error and shows pop up in the superset page.
ERROR: {"error": "Connection failed!
The error message returned was:
No module named 'psycopg2'", "stacktrace": "Traceback (most recent call last):
File \"/home/tutree/venv/lib/python3.6/site-packages/superset/views/core.py\", line 1702, in testconn
engine = database.get_sqla_engine(user_name=username)
File \"/home/tutree/venv/lib/python3.6/site-packages/superset/utils/core.py\", line 131, in __call__
value = self.func(*args, **kwargs)
File \"/home/tutree/venv/lib/python3.6/site-packages/superset/models/core.py\", line 911, in get_sqla_engine
return create_engine(url, **params)
File \"/home/tutree/venv/lib/python3.6/site-packages/sqlalchemy/engine/__init__.py\", line 479, in create_engine
return strategy.create(*args, **kwargs)
File \"/home/tutree/venv/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py\", line 87, in create
dbapi = dialect_cls.dbapi(**dbapi_args)
File \"/home/tutree/venv/lib/python3.6/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py\", line 737, in dbapi
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
"}
I solved it by running this command
pip install psycopg2
Read the error message:
The problem may be that you need to install psychopg2 on the same virtualenv as the original superset.
so:
1. source your-virtual-env
2. pip install the requriements
3. run superset
Related
I am trying to install the openERP Odoo 14 on macOS Catalina version 10.15.7. I have installed python3, postgreSQL, pgAdmin4 just as demanded and cloned odoo 14 from here but when I type this command python3 odoo-bin -d odoo14 which should create the database, it didn't work whereas it gives this error saying Connection to the database failed and no password supplied:
2021-04-15 11:46:20,236 79206 INFO ? odoo: Odoo version 14.0
2021-04-15 11:46:20,236 79206 INFO ? odoo: addons paths: ['/Users/mac/Desktop/odoo/odoo/odoo/addons', '/Users/mac/Library/Application Support/Odoo/addons/14.0', '/Users/mac/Desktop/odoo/odoo/addons']
2021-04-15 11:46:20,237 79206 INFO ? odoo: database: default#default:default
2021-04-15 11:46:20,262 79206 INFO ? odoo.sql_db: Connection to the database failed
Traceback (most recent call last):
File "odoo-bin", line 8, in <module>
odoo.cli.main()
File "/Users/mac/Desktop/odoo/odoo/odoo/cli/command.py", line 61, in main
o.run(args)
File "/Users/mac/Desktop/odoo/odoo/odoo/cli/server.py", line 178, in run
main(args)
File "/Users/mac/Desktop/odoo/odoo/odoo/cli/server.py", line 142, in main
odoo.service.db._create_empty_database(db_name)
File "/Users/mac/Desktop/odoo/odoo/odoo/service/db.py", line 99, in _create_empty_database
with closing(db.cursor()) as cr:
File "/Users/mac/Desktop/odoo/odoo/odoo/sql_db.py", line 675, in cursor
return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
File "/Users/mac/Desktop/odoo/odoo/odoo/sql_db.py", line 248, in __init__
self._cnx = pool.borrow(dsn)
File "/Users/mac/Desktop/odoo/odoo/odoo/sql_db.py", line 558, in _locked
return fun(self, *args, **kwargs)
File "/Users/mac/Desktop/odoo/odoo/odoo/sql_db.py", line 626, in borrow
**connection_info)
File "/Users/mac/opt/miniconda3/lib/python3.7/site-packages/psycopg2/__init__.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: fe_sendauth: no password supplied
I am using python3 of the system not a virtual environment.
Could anyone please help me figure out what's wrong and get Odoo 14 working?
Thanks in advance.
When you first install PostgreSQL on MacOS with brew it creates a db user
with the same name as your MacOS user with no password.
Can you try launching with these flags?
python3 odoo-bin -d odoo14 --db_user=yourusername --db_password=False
I am working on VirtualBox 6.0 with Python 3.5. I am trying to install airflow from github using the requirements-python3.5.txt file (https://raw.githubusercontent.com/apache/airflow/v1-10-stable/requirements/requirements-python3.5.txt). However, when I try to download this file from the command line, I get a read-only file system:
vagrant#learnairflow:~$ source .sandbox/bin/activate
(.sandbox) vagrant#learnairflow:~$ wget https://raw.githubusercontent.com/apache/airflow/v1-10-stable/requirements/requirements-python3.5.txt
--2020-06-13 15:47:54-- https://raw.githubusercontent.com/apache/airflow/v1-10-stable/requirements/requirements-python3.5.txt
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 199.232.48.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|199.232.48.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6210 (6.1K) [text/plain]
requirements-python3.5.txt: Read-only file system
Cannot write to ‘requirements-python3.5.txt’ (Success).
Subsequently, when I try to install airflow I get the following error:
(.sandbox) vagrant#learnairflow:~$ pip install "apache-airflow[celery, crypto, mysql, rabbitmq, redis]"==1.10.10 --constraint requirements-python3.5.txt
WARNING: The directory '/home/vagrant/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
ERROR: Exception:
Traceback (most recent call last):
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/cli/base_command.py", line 188, in _main
status = self.run(options, args)
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/cli/req_command.py", line 185, in wrapper
return func(self, options, args)
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/commands/install.py", line 288, in run
wheel_cache = WheelCache(options.cache_dir, options.format_control)
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/cache.py", line 296, in __init__
self._ephem_cache = EphemWheelCache(format_control)
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/cache.py", line 265, in __init__
globally_managed=True,
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/utils/temp_dir.py", line 137, in __init__
path = self._create(kind)
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/utils/temp_dir.py", line 185, in _create
tempfile.mkdtemp(prefix="pip-{}-".format(kind))
File "/usr/local/lib/python3.5/tempfile.py", line 358, in mkdtemp
prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)
File "/usr/local/lib/python3.5/tempfile.py", line 130, in _sanitize_params
dir = gettempdir()
File "/usr/local/lib/python3.5/tempfile.py", line 296, in gettempdir
tempdir = _get_default_tempdir()
File "/usr/local/lib/python3.5/tempfile.py", line 231, in _get_default_tempdir
dirlist)
FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/home/vagrant']
I've tried using the sudo command but it doesn't work either. Do you have any idea of what might be causing this error and how to fix it? Thank you in advance!
I'm setting up awslogs agent on ec2 instance, When i run the python script of awslogs. I'm getting below message.
Downloading the latest CloudWatch Logs agent bits ... ERROR: Failed to create virtualenv. Try manually installing with pip and adding it to the sudo user's PATH before running this script.
And awslogs-agent-setup.log show below error.
Environment: CentOS 6.10 and Python 2.6
Traceback (most recent call last):
File "/usr/bin/pip", line 7, in <module>
from pip._internal import main
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_internal/__init__.py", line 19, in <module>
from pip._vendor.urllib3.exceptions import DependencyWarning
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_vendor/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_vendor/urllib3/connectionpool.py", line 92
_blocking_errnos = {errno.EAGAIN, errno.EWOULDBLOCK}
^
SyntaxError: invalid syntax
/usr/bin/virtualenv
Traceback (most recent call last):
File "/usr/bin/virtualenv", line 7, in <module>
from virtualenv import main
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 51, in <module>
print("ERROR: {}".format(sys.exc_info()[1]))
ValueError: zero length field name in format
Basically, this error is due to your python version 2.6. Could you please update your python version from 2.6 to 2.7 or 3.1.
This should help.
I'm getting the following error when trying to run psycopg2 in a AWS Lambda:
/var/task/functions/../vendored/psycopg2/_psycopg.so: ELF file's phentsize not the expected size: ImportError
Traceback (most recent call last):
File "/var/task/functions/refresh_mv.py", line 64, in execute
session = SessionFactoryGraphQL.get_session(app=item['app'])
File "/var/task/lib/session_factory.py", line 22, in get_session
engine = create_engine(conn_string, poolclass=NullPool)
File "/var/task/functions/../vendored/sqlalchemy/engine/__init__.py", line 387, in create_engine
return strategy.create(*args, **kwargs)
File "/var/task/functions/../vendored/sqlalchemy/engine/strategies.py", line 80, in create
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/var/task/functions/../vendored/sqlalchemy/dialects/postgresql/psycopg2.py", line 554, in dbapi
import psycopg2
File "/var/task/functions/../vendored/psycopg2/__init__.py", line 50, in <module>
from psycopg2._psycopg import ( # noqa
ImportError: /var/task/functions/../vendored/psycopg2/_psycopg.so: ELF file's phentsize not the expected size
The weird thing is: everything was working fine until yesterday (for more than 5 months), and suddenly stopped working. None of the libraries has been updated.
I tried to build from scratch, as in https://github.com/jkehler/awslambda-psycopg2, but still having the same error.
Can someone help me with it?
The problem is in the latest version of serverless framework. I assume that you are using serverless to deploy your lambda function.
serverless remove
npm install serverless#1.20.2 -g
This should work.
Description of problem:
Importing an Ubuntu disk image fails with 'Error: VMWare SVGA not available'.
I am using KVM has a hypervisor on CentOS.
I am getting following error.
Unable to complete install: 'internal error: process exited while connecting to monitor: Error: VMWare SVGA not available
'
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 89, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/create.py", line 1855, in do_install
guest.start_install(meter=meter)
File "/usr/share/virt-manager/virtinst/guest.py", line 411, in start_install
noboot)
File "/usr/share/virt-manager/virtinst/guest.py", line 475, in _create_guest
dom = self.conn.createLinux(start_xml or final_xml, 0)
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3401, in createLinux
if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: internal error: process exited while connecting to monitor: Error: VMWare SVGA not available
I was able to work around this problem by using virt-manager to import the guest. I checked the "Customize configuration before install" box on the last page of the wizard and chose "VGA" as the video model.
If using 'virt-install' please specify "--video=vga"