Hi Justin and John,
Thanks for your replies - I appreciate your comments as always.
I think that --system-site-packages would seem to be a decent option for
now, especially since the alternative is not completely straightforward -
for me at least...
In case it's of any use, below are a couple of clarifications that Kevin
sent me in answer to some of my questions re his original response on this
thread:
_______________________________________________________________
- "as long as you have GCC and some other tools installed" How do I know
what those other tools are? What are the implications of them not being
there?
I think that GCC is probably all you need, along with python3-devel
package. If they're not there, you'll just get a build error until you
install the right package.
- Clone from github - fine with that although I'd be assuming I'd clone
it down onto my pc. (as opposed to on the 400)
Nope, on the IBM i. Basic rule of software - build it on the system you
want to run it on.
- Create the wheel file: CFLAGS='-DPASE' python3 setup.py bdist_wheel -
I don't really undersand what is going on here, I assume I'm meant to go
into the top directory of the cloned repo and run that command and a .whl
file will be built?
Correct.
- pip install dist/ibm_db-*.whl If I've cloned the repo to my local PC
(which might not be what you intended) then I assume I've got to put the
wheel file somewhere on the IBMi where pip install can find it?
The wheel file gets built in to the dist sub-directory of the source code.
You just install it from there by specify the path, as in the exact command
that I gave you above.
- You'll probably need to copy the SQLCLI header files as well... and
pass -I/QOpenSys/pkgs/include/sqlcli - not really sure what this is all
about.
The header files are needed to compile the C code that the Python driver
uses to talk to the database. By default, the system only ships them
avialble for ILE use. We shipped a package to make them easily available
for PASE use, but they're not in a standard location for the compiler to
find. You need to add -I/QOpenSys/pkgs/include/cli to the CFLAGS
environment variable shown earlier:
CFLAGS='-DPASE -I/QOpenSys/pkgs/include/cli' python3 setup.py bdist_wheel
------------------------------------------------------------------------------------------------------
regards,
Craig
On Mon, 1 Apr 2019 at 18:05, Justin Taylor <JUSTIN@xxxxxxxxxxxxx> wrote:
What Kevin from IBM had me do was include system packages in my virtual
environment. You do that when you create your venv.
virtualenv /my/venv/here --system-site-packages
HTH
-----Original Message-----
From: Craig Richards [mailto:craig@xxxxxxxxxxxxxxxx]
Sent: Monday, April 01, 2019 9:26 AM
To: IBMi Open Source Roundtable <opensource@xxxxxxxxxxxxxxxxxx>
Subject: [IBMiOSS] ibm-db and itoolkit into venv
Hi All,
I'm running python 3.6.6 (on the IBMi) and have just set up a venv version
which seems to be working fine.
I recall Justin saying he thought that currently there was no easy way to
pip install:
ibm-db
itoolkit
Is this still the case?
If these cannot be pip installed - are there any instructions anyone could
point me to that are complete and exact enough for a newbie to follow?
thanks kindly,
Craig
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/opensource.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.