python

From AIXTOOLS
Jump to: navigation, search

Packages|Tools|aixtools.python.2.7.12.3.I
Report Issues (via Forums) and/or TWEET:@rootvgnet

MD5 Checksum

DA641821962517C0AE3362EA66BB0771 aixtools.python.2.7.12.3.I

Contents

Package Details

VERSION: 2.7.12
Sources from: https://www.python.org/downloads
Depends on: >= openssl.base.rte.1.0.1.515

Looking for Python3?

Goto the new page at python3

AIXTOOLS is packaging Python2 as aixtools.python and Python3 as aixtools.python3.

This allows you to have both python and python3 installed. Note: the new convention is to add a 3 to (all?) commands, e.g., python3 and pip3 for the version3 versions.

Have fun!

Notes

--Michael Felt (talk) 13:47, 9 November 2016 (UTC) Will soon add a Python3 page, after I have changed the package name to aixtools.pyhton3 - so that python(2) and python3 can be installed side-by-side.

--Michael Felt (talk) 19:10, 29 September 2016 (UTC)

Just a day apart, but found a small bug that kept some packages from installing with pip. Easy to patch internally and so much better to work with! See https://bugs.python.org/issue28311 for details. Should be official in Python-2.7.13 (expected around December 2016)

--Michael Felt (talk) 15:27, 28 September 2016 (UTC)-- Patched Lib/ctypes (see http://download.aixtools.net/test/python/Python2.7.Lib.ctypes.160928.patch)

The latest packaging has a new and prettier patch (closer to Python Style Document).

New and Improved =

Starting with Python3.4 pip has been embedded into Python. AND - starting with Python-2.7.9 it has also been embedded in Python2 - but not activated by design on *NIX systems. I have modified the installp scripts to automatically activate during installation and "uninstall" when removed.

* What is PIP
pip is a package management system used to install and manage software packages written in Python.

If you know (of) CPAN for perl - PIP is like that, but for Python. Enjoy! I know it is going to make my next packaging of cloudinit much easier!

What it does

Before the patch Lib/ctypes is effectively 40% useful for AIX. Yes, it can call dlopen() but those only succeed if the shared_library is not in an archive. So, foreign shared libraries (that are not packaged in .a archives might be loaded) but 64-bit support is tricky (getting the default LIBPATH right).

What is 100% fail - without the patch is ctypes.util.find_library(). For AIX it will always return "None".

BEFORE aka no patch

python -m ctypes/util
None
None
None
Traceback (most recent call last):
  File "/opt/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/opt/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/opt/lib/python2.7/ctypes/util.py", line 271, in <module>
    test()
  File "/opt/lib/python2.7/ctypes/util.py", line 266, in test
    print cdll.LoadLibrary("libm.so")
  File "/opt/lib/python2.7/ctypes/__init__.py", line 440, in LoadLibrary
    return self._dlltype(name)
  File "/opt/lib/python2.7/ctypes/__init__.py", line 362, in __init__
    self._handle = _dlopen(self._name, mode)
OSError:        0509-022 Cannot load module .
        0509-026 System error: A file or directory in the path name does not exist.

AFTER - patched

root@x065:[/data/prj/aixtools/python/python-2.7.12.1]python -m ctypes/util
None
libc.a(shr.o)
libbz2.a(libbz2.so.1)
<CDLL 'libc.a(shr.o)', handle b at 300fa9b0>
libcrypt.a(shr.o)

--Michael Felt (talk) 21:56, 23 August 2016 (UTC) Posted the latest packaging of Python2.7

file /opt/bin/python
/opt/bin/python: 64-bit XCOFF executable or object module not stripped
python --version
Python 2.7.12

--Michael Felt (talk) 16:29, 10 May 2016 (UTC) Ported ctypes modifications to Python3(.5.1) and have similar (identical) patches for both Python3 and Python2 (took more time than I could have wished for to remove "degraded" Python2 ways of doing ways - to preferred ways supported in both versions. Version (packaging as 2.7.11.3) very soon!

--Michael Felt (talk) 19:32, 21 March 2016 (UTC) Python-2.7.11.2 includes a patch to load shared files (.so) files from an archive, rather than forcing you to unpack archives to make the .so files visible.

Bootstrapping

python-2.7.X does not include setuptools and pip by default; however python-3.X version do! (but the command is pip3, not pip !) Remember - you to be "online" to use "pip search" and "pip install".

To get setuptools and pip for python-2.X - here are some hints.

  • You will need setuptools. The first link to follow is:
https://pypi.python.org/pypi/setuptools#unix-wget

and you will need wget to use that method (and guess where to get wget for AIX. Not you will also need gettext - it is GNU after all.

Once you have setuptools installed you will need to download pip. I got mine from

https://pypi.python.org/pypi/pip

and it was version 7.1.2 when I tested. (as of 3 March 2016 version 8.0.3 is the latest)

After this you should be well on your way to doing wonderful things!

My steps looked like this

# installp -d /data/aixtools/tools aixtools.python.rte

# cd /data/prj/aixtools/python/
# ls -l setuptools
total 672
-rw-r--r-- 1 root system  11458 Nov  3 13:21 ez_setup.py
-rw-r--r-- 1 root system 670884 Nov  2 00:20 setuptools-18.5.zip

# cd setuptools
# python ./ez_setup.py
# cd ..
# ls -l pip
total 1036
drwxr-xr-x 7 michael felt    4096 Nov  3 17:19 pip-7.1.2
-rw-r--r-- 1 michael felt 1049170 Aug 22 22:48 pip-7.1.2.tar.gz

# cd pip/*2
# python ./setup.py install

Old Versions

EB835227D935FF57AA2ADE108DE3C80D aixtools.python.2.7.12.2.I
1A32249A4DDF42402070BFD0881DF3BD aixtools.python.2.7.12.1.I
9A05664704AD6730F7684EB3B43B47A6 aixtools.python.2.7.12.0.I
E2713B9DBBD657A47C7D96C7B069DB07 aixtools.python.2.7.11.4.I
2507EFEAB414D855A532D93955683368 aixtools.python.3.4.4.1.I
86D38449E2DEFCF8DB3704E8EA76333F aixtools.python.3.5.1.1.I
111840A6D787AD4143CD7E54F97952BA aixtools.python.3.5.1.0.I
BDB57F7CCB805D80650643D19C4EAF0C aixtools.python.3.4.4.0.I
C2E972601E781A489E987A8EA4151C04 aixtools.python.2.7.11.0.I
26DC0F9C37598F5C2D3AC33986B6911A aixtools.python.2.7.10.0.I

Bootstrapping before Python-2.7.9

python-2.7.X does not include setuptools and pip by default; however python-3.X version do! (but the command is pip3, not pip !) Remember - you to be "online" to use "pip search" and "pip install".

To get setuptools and pip for python-2.X - here are some hints.

  • You will need setuptools. The first link to follow is:
https://pypi.python.org/pypi/setuptools#unix-wget

and you will need wget to use that method (and guess where to get wget for AIX. Not you will also need gettext - it is GNU after all.

Once you have setuptools installed you will need to download pip. I got mine from

https://pypi.python.org/pypi/pip

and it was version 7.1.2 when I tested. (as of 3 March 2016 version 8.0.3 is the latest)

After this you should be well on your way to doing wonderful things!

My steps looked like this

# installp -d /data/aixtools/tools aixtools.python.rte

# cd /data/prj/aixtools/python/
# ls -l setuptools
total 672
-rw-r--r-- 1 root system  11458 Nov  3 13:21 ez_setup.py
-rw-r--r-- 1 root system 670884 Nov  2 00:20 setuptools-18.5.zip

# cd setuptools
# python ./ez_setup.py
# cd ..
# ls -l pip
total 1036
drwxr-xr-x 7 michael felt    4096 Nov  3 17:19 pip-7.1.2
-rw-r--r-- 1 michael felt 1049170 Aug 22 22:48 pip-7.1.2.tar.gz

# cd pip/*2
# python ./setup.py install
Personal tools
Namespaces

Variants
Actions
Navigation
Downloads
Toolbox