from importlib.machinery import SourceFileLoader
"/QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/python3.4/urllib/request.py").load_module()foo = SourceFileLoader("module.name",
"/QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/python3.4/site-packages/pip/_vendor/distlib/util.py").load_module()foo = SourceFileLoader("module.name",
Excellent feedback, John. To date Litmis Spaces has been used mostly for
Node.js and RubyOnRails. Python not so much. Today we follow the same
directory structure as IBM.
Concerning multiple versions; developers will want easy switching from one
version of language to another. And then in production there should
(hopefully) be only one. I accomplish the multiple version in Node.js
using a custom shell script and run it as follows:
% . node_litmis.sh node-0.12.9
Btw, here's the result of the site-package code for those that are lurking
(this is a Python REPL session)...
And the contents of that directory...
% ls /QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/python3.4/site-packages
README easy_install.py pkg_resources.py
__pycache__ pip setuptools
litmis.com - Services for open source on IBM i
On Mon, Jun 20, 2016 at 9:00 PM, John Yeung <gallium.arsenide@xxxxxxxxx>
On Mon, Jun 20, 2016 at 1:53 PM, Aaron Bartell <aaronbartell@xxxxxxxxx>
*>(A huge step would be to install ibm_db and itoolkit.)*
Both should be installed on Litmis Spaces. Run the following command to
see: ls -all /QOpenSys/QIBM/ProdData/OPS/Python-pkgs
I think you meant either -al or -alF, rather than -all (each letter is
its own switch; there's no advantage to repeating a switch).
I was expecting those packages to be installed in Litmis Spaces
already, and indeed they do show up in the directory you've shown. But
I had no idea that was where they were until you told me. Anyone
familiar with Python will be looking for a directory called
I guess for now the simplest way to import them is to manually add the
necessary directory to the search path from within Python:
But really, this is something that should be fixed.
Python comes with a module called site. It has functions that
affect how the interpreter searches for packages to import. You can
see where Python is expecting to find installed packages as follows
(from the Python prompt):
If those directories don't exist, they don't make it into sys.path.
I think something probably has to be done about the directory
structure anyway, because you absolutely have to have different
site-packages for different versions of Python. Sure, a Litmis space
can probably be configured to only have one version of Python, but
that seems like an artificial limitation.
Also, we can expect some extra effort in these initial stages ofadopting
open source on IBM i**. The key is ~documenting~ our progress so thenext
person doesn't have to go through the same hoops. Documenting canhappen
in many locations (stackoverflow.com, github gists, blogs, wikis, etc).document
Also, feel free to make a new Python page at the following link to
Totally agree. I will see what I can do, though I can't promise
anything as my time is even more limited than usual.
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: OpenSource-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives