Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot import name ETLAlchemySource #32

Open
nitin23c opened this issue Mar 29, 2018 · 3 comments
Open

cannot import name ETLAlchemySource #32

nitin23c opened this issue Mar 29, 2018 · 3 comments

Comments

@nitin23c
Copy link

Trying to create a docker image based on debian ,

However when executing the script ( Using your first example )

`#!/root/project/migrate/bin/python

from etlalchemy import ETLAlchemySource, ETLAlchemyTarget

mssql_db_source = ETLAlchemySource("mssql+pyodbc://sa:password@SQLServer")
mysql_db_target = ETLAlchemyTarget("mysql://root:password@192.168.0.101:12345/dbname", drop_database=True)
mysql_db_target.addSource(mssql_db_source)
mysql_db_target.migrate()`

Below is the trace

(migrate)root@a7e70412e776:~/project/migrate# ./migrate.py Traceback (most recent call last): File "./migrate.py", line 3, in <module> from etlalchemy import ETLAlchemySource, ETLAlchemyTarget File "/root/project/migrate/local/lib/python2.7/site-packages/etlalchemy/__init__.py", line 1, in <module> from ETLAlchemySource import ETLAlchemySource File "/root/project/migrate/local/lib/python2.7/site-packages/etlalchemy/ETLAlchemySource.py", line 6, in <module> from migrate.changeset.constraint import ForeignKeyConstraint File "/root/project/migrate/migrate.py", line 3, in <module> from etlalchemy import ETLAlchemySource, ETLAlchemyTarget ImportError: cannot import name ETLAlchemySource

Kindly help.

@original-heart
Copy link

@nitin23c please try to python2.7, it works well for me

@seanharr11
Copy link
Owner

@nitin23c - I would suggest creating a new Python2.7 virtual environment, activating the virtual environment, and then install etlalchemy in the fresh environment. This seems to be an error with the migrate.changeset.constraint module import. You can also try to run pip install sqlalchemy_migrate, as that has fixed this problem in the past.

@dalec-vi
Copy link

dalec-vi commented Aug 6, 2018

I had the same issue. Renaming your script from migrate.py to something else will resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants