× 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.



Ah well that make sense and thanks for posting the answer

On Thu, Sep 27, 2018 at 3:00 AM Jim Oberholtzer <midrangel@xxxxxxxxxxxxxxxxx>
wrote:

Kevin Adler responded on Ryver (where I cross posted) and had me:

"pip3 install future"

That fixed the issue. Apparently there was an update to ibm_db_sa where
the
future module is needed, however the install.py script had not be updated
to
include it.


--
Jim Oberholtzer
Agile Technology Architects


-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Evan Harris
Sent: Tuesday, September 25, 2018 4:18 PM
To: Web Enabling the AS400 / iSeries <web400@xxxxxxxxxxxx>
Subject: Re: [WEB400] sqlalchemy on IBM i.

Hi Jim

sure looks to me like it's the import; it seems interesting to me that it
can't find module "future" rather than "future.utils" - almost like the
name
resolution is a problem.

I see you have "from ." in your other import statements so it seems there
is
some relationship to path in the import statements that I have not struck
in
my python scripts yet (all on windows)

On Wed, Sep 26, 2018 at 5:27 AM Jim Oberholtzer
<midrangel@xxxxxxxxxxxxxxxxx>
wrote:

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



--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400)
mailing list To post a message email: WEB400@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/web400.



--

Regards
Evan Harris
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list To post a message email: WEB400@xxxxxxxxxxxx To subscribe,
unsubscribe,
or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/web400.


--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.