I think my issue is I just didn't have mysql+pymysql :facepalm: . Will 
continue to update in case others want to do this. 

On Saturday, May 18, 2019 at 5:40:58 PM UTC-4, mkwyche wrote:
>
> Hi,
>
> I'm trying to run a Beam Pipeline with SQLAlchemy. Google DataFlowRunner 
> doesn't allow me to add MySQLdb to my pipeline running on the cloud. You 
> can see a description of the issue here 
> https://stackoverflow.com/questions/56202734/python-mysql-in-cloud-dataflowrunner
>  . 
> It seems like every time I try to create an engine the engine requires 
> `MySQLdb`
>
> ```
> Traceback (most recent call last):
>   File "phy/uploader/season_stat_calculator/pipeline.py", line 10, in 
> <module>
>     from phy.uploader.season_stat_calculator.upload_season_stats_rocky 
> import get_batters_for_season, \
>   File 
> "/Users/mkwyche/workspace/python/phy/uploader/season_stat_calculator/upload_season_stats_rocky.py",
>  
> line 12, in <module>
>     from phy.shared.models.season_stats.season_stats import SeasonStats
>   File "/Users/mkwyche/workspace/python/phy/shared/models/__init__.py", 
> line 19, in <module>
>     _ENGINE_PHIL_DATA = get_mysql_engine(database=PHIL_DATA, 
> echo=SQL_DEBUG)
>   File 
> "/Users/mkwyche/workspace/python/phy/shared/utils/sqlalchemy_utils.py", 
> line 22, in get_mysql_engine
>     return create_engine(db_url, echo=echo, pool_recycle=1000)
>   File 
> "/Users/mkwyche/workspace/python/.beam_env/lib/python2.7/site-packages/sqlalchemy/engine/__init__.py",
>  
> line 435, in create_engine
>     return strategy.create(*args, **kwargs)
>   File 
> "/Users/mkwyche/workspace/python/.beam_env/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py",
>  
> line 87, in create
>     dbapi = dialect_cls.dbapi(**dbapi_args)
>   File 
> "/Users/mkwyche/workspace/python/.beam_env/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/mysqldb.py",
>  
> line 118, in dbapi
>     return __import__("MySQLdb")
> ImportError: No module named MySQLdb
> ```
>
> Is there anyway around needing MySQLdb when using SQLAlchemy?
>
> Thanks,
>
> Marcus Wyche
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/5e737468-af5d-4c3f-ba47-3c6f179d7fc3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to