× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



IBM i V7R2 (most recent groups/cumulative) : sqlalchemy version 1.2.12



I'm trying to get an sqlalchemy test to work and it stops with the
following:

bash-4.4$ python3.6 alchemy_test.py
Traceback (most recent call last):
File "alchemy_test.py", line 3, in <module>
import ibm_db_sa.ibm_db_sa
File "/QOpenSys/pkgs/lib/python3.6/site-packages/ibm_db_sa/init.py", line
22, in <module>
from . import ibm_db, pyodbc, base, zxjdbc
File "/QOpenSys/pkgs/lib/python3.6/site-packages/ibm_db_sa/ibm_db.py", line
20, in <module>
from .base import DB2ExecutionContext, DB2Dialect
File "/QOpenSys/pkgs/lib/python3.6/site-packages/ibm_db_sa/base.py", line
30, in <module>
from . import reflection as ibm_reflection
File "/QOpenSys/pkgs/lib/python3.6/site-packages/ibm_db_sa/reflection.py",
line 26, in <module>
from future.utils import iteritems
ModuleNotFoundError: No module named 'future'

If I am readying this right, the module "future.utils" is part of the
sqalchemy package. The code calling it is:

import sqlalchemy
from sqlalchemy import *
import ibm_db_sa.ibm_db_sa
db2 =
sqlalchemy.create_engine('ibm_db_sa://python:pythonusr@xxxxxxxxxxxxxxx:50000
/python')
metadata = MetaData()
users = Table('users', metadata,
Column('user_id', Integer, primary_key = True),
Column('user_name', String(16), nullable = False),
Column('email_address', String(60), key='email'),
Column('password', String(20), nullable = False)
)
metadata.bind = db2
metadata.create_all()
users_table = Table('users', metadata, autoload=True, autoload_with=db2)
users_table

I think it's the import* that's causing the issue.

This is just a see if it can connect script and I lifted it from the IBM
page on sqlalchemy (which of course has no reference to IBM i)







--

Jim Oberholtzer

Agile Technology Architects




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.