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



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)...
import site


site.getsitepackages()>>>


['/QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/python3.4/site-packages',
'/QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/site-python']

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


_markerlib pip-1.5.6.dist-info
setuptools-2.1.dist-info


Aaron Bartell
litmis.com - Services for open source on IBM i


On Mon, Jun 20, 2016 at 9:00 PM, John Yeung <gallium.arsenide@xxxxxxxxx>
wrote:

On Mon, Jun 20, 2016 at 1:53 PM, Aaron Bartell <aaronbartell@xxxxxxxxx>
wrote:
*>(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
site-packages[1].

I guess for now the simplest way to import them is to manually add the
necessary directory to the search path from within Python:

import sys
sys.path.append('/QOpenSys/QIBM/ProdData/OPS/Python-pkgs')
import ibm_db

But really, this is something that should be fixed.

[1]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):

import site
site.getsitepackages()

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 of adopting
open source on IBM i**. The key is ~documenting~ our progress so the
next
person doesn't have to go through the same hoops. Documenting can happen
in many locations (stackoverflow.com, github gists, blogs, wikis, etc).
Also, feel free to make a new Python page at the following link to
document
resolutions: https://bitbucket.org/ibmi/opensource/wiki/Home

Totally agree. I will see what I can do, though I can't promise
anything as my time is even more limited than usual.

John Y.
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/opensource.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.