Import Error : No module named mysql
Hello stackers:
This issue happens on Havana
I'm seeing the issue while stack install using devstack on Ubuntu VM. Everything was fine, I had the stack up and running, but I wanted to get the clean setup of devstack, so in an attempt to clean the devstack I did the following ./clean.sh ./unstack.sh
After that I have been seeing this issue of no module named 'mysql' whenever I do ./stack.sh and hence the keystone is not getting started, so the devstack install is failing. Could someone help me know what is the issue here?
I have the mysqldb-python package installed and mysql service is up and running.
Following are the stack installation logs.
/opt/stack/devstack/lib/database: line 100: recreate_database_: command not found
+ /opt/stack/keystone/bin/keystone-manage db_sync
Traceback (most recent call last):
File "/opt/stack/keystone/bin/keystone-manage", line 16, in <module>
from keystone import cli
File "/opt/stack/keystone/keystone/cli.py", line 23, in <module>
from migrate import exceptions
File "/usr/lib/python2.7/dist-packages/migrate/__init__.py", line 9, in <module>
from migrate.changeset import *
File "/usr/lib/python2.7/dist-packages/migrate/changeset/__init__.py", line 21, in <module>
from migrate.changeset.schema import *
File "/usr/lib/python2.7/dist-packages/migrate/changeset/schema.py", line 15, in <module>
from migrate.changeset.databases.visitor import (get_engine_visitor,
File "/usr/lib/python2.7/dist-packages/migrate/changeset/databases/visitor.py", line 7, in <module>
from migrate.changeset.databases import (sqlite,
File "/usr/lib/python2.7/dist-packages/migrate/changeset/databases/sqlite.py", line 9, in <module>
from sqlalchemy.databases import sqlite as sa_base
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/databases/__init__.py", line 14, in <module>
from sqlalchemy.dialects.mysql import base as mysql
ImportError: No module named mysql
+ [[ PKI == \P\K\I ]]
+ rm -rf /etc/keystone/ssl
+ /opt/stack/keystone/bin/keystone-manage pki_setup
Traceback (most recent call last):
File "/opt/stack/keystone/bin/keystone-manage", line 16, in <module>
from keystone import cli
File "/opt/stack/keystone/keystone/cli.py", line 23, in <module>
from migrate import exceptions
File "/usr/lib/python2.7/dist-packages/migrate/__init__.py", line 9, in <module>
from migrate.changeset import *
File "/usr/lib/python2.7/dist-packages/migrate/changeset/__init__.py", line 21, in <module>
from migrate.changeset.schema import *
File "/usr/lib/python2.7/dist-packages/migrate/changeset/schema.py", line 15, in <module>
from migrate.changeset.databases.visitor import (get_engine_visitor,
File "/usr/lib/python2.7/dist-packages/migrate/changeset/databases/visitor.py", line 7, in <module>
from migrate.changeset.databases import (sqlite,
File "/usr/lib/python2.7/dist-packages/migrate/changeset/databases/sqlite.py", line 9, in <module>
from sqlalchemy.databases import sqlite as sa_base
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/databases/__init__.py", line 14, in <module>
from sqlalchemy.dialects.mysql import base as mysql
ImportError: No module named mysql
+ sudo mkdir -p /var/cache/keystone
+ sudo chown stack /var/cache/keystone
+ rm -f '/var/cache/keystone/*'
+ start_keystone
+ local service_port=5000
+ is_service_enabled tls-proxy
+ services=tls-proxy
+ for service ...
Following is the piece of Traceback error showing no module named mysql ----------------------------------------------------------- from sqlalchemy.databases import sqlite as sa_base File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/databases/__init__.py", line 14, in <module> from sqlalchemy.dialects.mysql import base as mysql ImportError: No module named mysql
From the screen -x attach, I see the following logs,
(keystone-all): 2014-01-30 04:34:36,004 DEBUG cfg log_opt_values identity.max_password_length = 4096 (keystone-all): 2014-01-30 04:34:36,004 DEBUG cfg log_opt_values ec2.driver = keystone.contrib.ec2.backends.sql.Ec2 (keystone-all): 2014-01-30 04:34:36,004 DEBUG cfg log_opt_values *************************************************************************** ***** (keystone): 2014-01-30 04:34:36,981 CRITICAL log logging_excepthook No module named mysql key failed to start
install mysql and also python client for mysql. This should set everything alright.
Dheeru: I have mysql and python-mysqldb installed *apt-get install python-mysqldb mysql-server* Are you suggesting to install more? When I checked the /usr/local/lib/python2.7/dist-packages/sqlalchemy/dialects, I dont find the mysql folder there, I think that is the cause for the issue, how could I get it installed? Is copying mysql folder from the sqlalchemy solves the issue?