I have presto and apache superset hosted at GCP Cloud.
Presto server hosted at http://14.22.122.12:8088/ui/
But when i try to connect Presto to Superset it's giving me this error
Could not load database driver: presto
Already installed the presto driver using pip install pyhive.
Not sure what's wrong here ? My SQLAlchemyURL presto://14.22.122.12:8088/catalog_name
This error usually appears when the driver isn't available (so the connection string format isn't recognized).
I would confirm that the pip install happened correctly. If you're running everything within docker, make sure you rebuilt properly. You can enter the docker cli, fire up a Python shell, and try to import the presto driver (you can also try pip freeze in the docker cli).
Related
I need to connect to MSSQL database from Django 1.8 and preserve Django 1.8 (not upgrade to newer version od Django).
I installed
pip install django-mssql . ENGINE in settings.py is sqlserver_ado.
It ended with error message
ModuleNotFoundError: No module named pythoncom.
According to this page I see that django-mssql needs PyWin32.
So I returned back to my snapshot in virtual machine and tried it with
pip install django-mssql-backend and changed the ENGINE in settings.py to sql_server.pyodbc
Now I have error message
sql_server.pyodbc isn't an available database backend.
So I returned back to my snapshot in virtual machine and tried it with pip install mssql-django and ENGINE is mssql. This upgraded Django to 3.4.1.
So I returned to my snapshot of virtual machine.
How can I connect to MSSQL from Django 1.8 without upgrading Django? Or is it impossible? Why?
Django 1.8 is running on Ubuntu 18.04
i need help. currently i want to use PHP redis on my macOS from this repo https://github.com/phpredis/phpredis
because there are many error when i direct clone from that repository, i decided to choose install the phpredis use MacPorts.
my specification mac is
macOS Cataline v 10.15.7
PHP 7.3.11
i'm using XAMPP 7.4.12
after i install the macPorts i did run this command
sudo port install php73-redis
the installation was good and no error. after that i restart my apache and also restart my mac.. but when i check on phpinfo() no function redis..
i also check on my file /opt/local/var/db/php73/redis.ini also contain extension=redis.so
what is missing from my steps? i still not able to set the PHPredis after that. please help
During 3 days I have been trying to install mongo BD in AWS ec2 instance, today finally managed to install it in Ubuntu, now I can't launch it in AWS environment, after numerous attempts to check the status in aws environment terminal I get errors:
What I have already tried do:
installed mongodb on Ubuntu 16.04 (Xenial)
launch mongo as a service (Ubuntu)
sudo service mongod start
sudo service mongod status
Go to AWS environment and do attempts to check if I'm connected to DB, and get errors:
sudo: mongod: command not found
mongod: unrecognized service
sudo: apt-get: command not found
bash: mongo: command not found
Please help to set my environment
I am pretty sure that Шоира is dealing not with Ubuntu OS but Amazon Linux or so.
So, if she is dealing with Community Edition version of it, the actual docs for every *nix based OS can be found here (MongoDB Docs)
And if I remember this fact correctly, AWS instances comes with Amazon Linux by default, so the documentation guide should been read for Amazon Linux (here), not Ubuntu.
To ensure that she is using Amazon Linus, she must type command grep ^NAME /etc/*release in terminal. If so, the reply should be: Amazon Linux or Amazon Linux AMI
Also, I don't know does it matter or not, but MongoDB Atlas provides also free-tier (as EC2 instance) servers in (almost) every data centers from GCP / Azure / AWS, so sometimes it's better to dealing with Cloud Service (which includes Compass and Realms by default, out of the box) instead of using the Community edition of the -raw DB, and write code and https API for it, later.
I tried to recreate the issue on an EC2 instance with Ubuntu 16.04:
NAME="Ubuntu"
VERSION="16.04.6 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.6 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
I followed the instructions from your link:
Install MongoDB Community Edition on Ubuntu
I had no issues and was able to install mangoDB as described in the link. The mongoDB is working fine on my instance:
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: active (running) since Sun 2020-07-19 08:21:41 UTC; 8s ago
Docs: https://docs.mongodb.org/manual
Main PID: 3214 (mongod)
Tasks: 24
Memory: 69.6M
CPU: 746ms
CGroup: /system.slice/mongod.service
└─3214 /usr/bin/mongod --config /etc/mongod.conf
Thus, please double check and ensure that you follow the instructions from the link. The instructions are correct.
Also please make sure to use Ubuntu 16.04:
This means that, you are trying to connect to the mongod process running on the local host which is binded on the default port of 27017
I have gone through every possible solution on the internet, but I'm unable to make pyobdc get the drivers on heroku.
The steps I have used to create the app are as follows:
heroku create
heroku config:set FLASK_CONFIG=heroku
heroku buildpacks:add heroku/python
heroku buildpacks:add --index 1 heroku-community/apt
git push heroku master
I tried even with odbc buildpack but still no luck:
heroku buildpacks:add https://github.com/iFix/heroku-buildpack-odbc.git
After going through microsoft website, I trimmed down my Aptfile to instuct heroku to install the following packages:
# install msodbcsql17
https://packages.microsoft.com/ubuntu/16.04/prod/pool/main/m/msodbcsql17/msodbcsql17_17.4.2.1-1_amd64.deb
# install mssql-tools
https://packages.microsoft.com/ubuntu/16.04/prod/pool/main/m/mssql-tools/mssql-tools_17.4.1.1-1_amd64.deb
# install unixodbc-dev
unixodbc-dev
This makes pyodbc installation go without error. But when I run pyodbc.drivers(), it returns nothing. The same command on Ubuntu 16.04 returns "ODBC Driver 17 for SQL Server"
The source code for the project is at : https://github.com/IamVNIE/odbcTestHeroku
The hosted app is at : https://pyodbctest.herokuapp.com/
Can someone please provide some pointers to make this work.
I have solved this issue by precompiling ODBC Driver 17 for SQL Server on a machine running Ubuntu 18.04 and copying the libmsodbcsql-17.5.so.2.1 and msodbcsqlr17.rll files into appropriate directories via a Heroku buildpack. This is ODBC Driver 17.5 for SQL Server and I likely won't be compiling other versions of this driver, but I imagine the concept remains the same.
The Heroku buildpack and its requirements can be found here https://github.com/matt-bertoncello/python-pyodbc-buildpack.git
Previous answer worked for me until I had to switch to heroku stack 22. After that I started getting the following error:
pyodbc.OperationalError: ('08001', '[08001] [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection (0) (SQLDriverConnect)')
To solve this issue I switched to another library python pymssql, that handles connections to Microsoft SQL server in azure.
here is a simple example
conn = pymssql.connect(server=xxx,\
user=yyy, \
password=zzz, \
database=xxx)
cursor = conn.cursor(as_dict=True)
cursor.execute(query)
rows = cursor.fetchall()
cursor.close()
conn.close()
I have a laravel 5.2 instance configured to run against MS SQL Server. I have downloaded from microsoft the drivers and the connection runs perfect DB::table('usuarios')->select('*')->get(); returns:
[{"id":"5","username":"jtd","password":"$2y$10$t8RXYy\/afaEuIpE8GIk2bOvbHsQoj0fhGPxmo\/3UqJABKVA4I4pHC","email":""}]
But when I try to php artisan migrate i get the:
[PDOException]
could not find driver
Why this is happening?
Stack trace:
c:\wamp\www\presence\webapp>php artisan migrate --verbose
[PDOException]
could not find driver
Exception trace:
() at C:\wamp\www\presence\webapp\vendor\laravel\framework\src\Illuminate\Datab
ase\Connectors\Connector.php:55
PDO->__construct() at C:\wamp\www\presence\webapp\vendor\laravel\framework\src\
Illuminate\Database\Connectors\Connector.php:55
Illuminate\Database\Connectors\Connector->createConnection() at C:\wamp\www\pre
sence\webapp\vendor\laravel\framework\src\Illuminate\Database\Connectors\SqlServ
erConnector.php:32
Illuminate\Database\Connectors\SqlServerConnector->connect() at C:\wamp\www\pre
sence\webapp\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connect
ionFactory.php:61
Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connector
s\{closure}() at n/a:n/a
call_user_func() at C:\wamp\www\presence\webapp\vendor\laravel\framework\src\Il
luminate\Database\Connection.php:924
Illuminate\Database\Connection->getPdo() at C:\wamp\www\presence\webapp\vendor\
laravel\framework\src\Illuminate\Database\Connection.php:792
Illuminate\Database\Connection->reconnectIfMissingConnection() at C:\wamp\www\p
resence\webapp\vendor\laravel\framework\src\Illuminate\Database\Connection.php:6
77
Illuminate\Database\Connection->run() at C:\wamp\www\presence\webapp\vendor\lar
avel\framework\src\Illuminate\Database\Connection.php:349
Illuminate\Database\Connection->select() at C:\wamp\www\presence\webapp\vendor\
laravel\framework\src\Illuminate\Database\Schema\Builder.php:55
Illuminate\Database\Schema\Builder->hasTable() at C:\wamp\www\presence\webapp\v
endor\laravel\framework\src\Illuminate\Database\Migrations\DatabaseMigrationRepo
sitory.php:141
Illuminate\Database\Migrations\DatabaseMigrationRepository->repositoryExists()
at C:\wamp\www\presence\webapp\vendor\laravel\framework\src\Illuminate\Database\
Migrations\Migrator.php:404
Illuminate\Database\Migrations\Migrator->repositoryExists() at C:\wamp\www\pres
ence\webapp\vendor\laravel\framework\src\Illuminate\Database\Console\Migrations\
MigrateCommand.php:103
Illuminate\Database\Console\Migrations\MigrateCommand->prepareDatabase() at C:\
wamp\www\presence\webapp\vendor\laravel\framework\src\Illuminate\Database\Consol
e\Migrations\MigrateCommand.php:58
Illuminate\Database\Console\Migrations\MigrateCommand->fire() at n/a:n/a
call_user_func_array() at C:\wamp\www\presence\webapp\vendor\laravel\framework\
src\Illuminate\Container\Container.php:507
Illuminate\Container\Container->call() at C:\wamp\www\presence\webapp\vendor\la
ravel\framework\src\Illuminate\Console\Command.php:169
Illuminate\Console\Command->execute() at C:\wamp\www\presence\webapp\vendor\sym
fony\console\Command\Command.php:256
Symfony\Component\Console\Command\Command->run() at C:\wamp\www\presence\webapp
\vendor\laravel\framework\src\Illuminate\Console\Command.php:155
Illuminate\Console\Command->run() at C:\wamp\www\presence\webapp\vendor\symfony
\console\Application.php:794
Symfony\Component\Console\Application->doRunCommand() at C:\wamp\www\presence\w
ebapp\vendor\symfony\console\Application.php:186
Symfony\Component\Console\Application->doRun() at C:\wamp\www\presence\webapp\v
endor\symfony\console\Application.php:117
Symfony\Component\Console\Application->run() at C:\wamp\www\presence\webapp\ven
dor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php:107
Illuminate\Foundation\Console\Kernel->handle() at C:\wamp\www\presence\webapp\a
rtisan:36
I found a solution. I post it for everyone. I use WAMP stack (PHP, Apache and MySQL). The fact is that wamp uses the 5.5.12 version for terminal CLI, so I have to install SQL Server PDO Extensions on the version I am using and (besides this) on the 5.5.12 version (I have several PHP versions installed). Can provide more information if needed.