Please login or register. December 15, 2019, 08:31:09 PM

Author Topic: PYTHON INSTALLATION  (Read 6293 times)

0 Members and 1 Guest are viewing this topic.

tbramha

  • Full Member
  • ***
  • Posts: 15
  • Karma: +0/-0
Re: PYTHON INSTALLATION
« Reply #20 on: November 15, 2019, 07:59:57 PM »
Hello Michael,

I have couple of queries. How do I make sure I have installed correctly? I have followed above link.

How to get the ansible version ?
How to validate whether ansble installation is proper or not?

Please provide couple of examples.

Regards,
Brahma.T

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1195
  • Karma: +0/-0
Re: PYTHON INSTALLATION
« Reply #21 on: November 16, 2019, 06:14:42 PM »
To provide instructions - there are a number of things I need to know.

Output of:

# lslpp -L | grep aixtools

# lslpp -Lc bos.mp64

Assuming my packaging of Python3 is installed:

# /opt/bin/pip3 list

Also:

# ls -l /opt/lib

Once I have that, in steps, we can work through the process of installing python and the bdist (binary distribution) packages.

tbramha

  • Full Member
  • ***
  • Posts: 15
  • Karma: +0/-0
Re: PYTHON INSTALLATION
« Reply #22 on: November 16, 2019, 08:18:09 PM »
Hello Michael,

Please find the below output . I have installed 32 bit python.

soa@ztapp08:/home/soa #  lslpp -L | grep aixtools
  aixtools.libffi.man.en_US  3.2.1.1    C     F    aixtools libffi man pages
  aixtools.libffi.rte        3.2.1.1    C     F    aixtools libffi 14-Mar-2017
  aixtools.libffi.share      3.2.1.1    C     F    aixtools libffi universal
  aixtools.python3.adt       3.6.9.0    C     F    python3 ADT files
  aixtools.python3.man.en_US
  aixtools.python3.rte       3.6.9.0    C     F    python3 06-Nov-2019



soa@ztapp08:/home/soa #  lslpp -Lc bos.mp64
#Package Name:Fileset:Level:State:PTF Id:Fix State:Type:Description:Destination Dir.:Uninstaller:Message Catalog:Message Set:Message Number:Parent:Automatic:EFIX Locked:Install Path:Build Date
bos.mp64:bos.mp64:7.1.5.17: : :A:F:Base Operating System 64-bit Multiprocessor Runtime: : : : : : :0:0:/:1831



soa@ztapp08:/home/soa #  /opt/bin/pip3 list
Package    Version
---------- -------
pip        19.3.1
setuptools 40.6.2
virtualenv 16.7.7
wheel      0.33.6



soa@ztapp08:/home/soa #  ls -l /opt/lib
total 9360
-r-xr-xr-x    1 bin      bin         4781679 Nov 06 11:13 libpython3.6m.a
drwxr-xr-x    2 bin      bin             256 Nov 15 20:32 pkgconfig
drwxr-xr-x   35 bin      bin            8192 Nov 06 11:17 python3.6



Regards,
Brahma.T
« Last Edit: November 17, 2019, 03:03:48 PM by Michael »

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1195
  • Karma: +0/-0
Re: PYTHON INSTALLATION
« Reply #23 on: November 17, 2019, 03:02:50 PM »
a) to start, you should no longer need aixtools.libffi. That was needed to build cffi on your own, which you will not do now.

# installp -u aixtools.libffi

I'll have more soon.

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1195
  • Karma: +0/-0
Re: PYTHON INSTALLATION
« Reply #24 on: November 17, 2019, 04:01:52 PM »
OK. Finishing up.

b) make sure you have enough space in the filesystem /opt (or /opt/lib)

Code: [Select]
# chfs -a size=+512M /opt
c) You will need to download the wheels CURRENTLY located in http://download/aixtools/test/wheels/5307 as these are the "any" pure Python wheels AND the AIX 32-bit wheels. Their current tagging shows they were built on AIX 5.3 TL7.

d) read through the following - PAY SPECIAL ATTENTION - to the mv commands that chenge the tag of the AIX binary wheels.
Code: [Select]
root@x062:[/home/root/ansible/wheels]pip3 list
Package    Version
---------- -------
pip        18.1
setuptools 40.6.2
You are using pip version 18.1, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.0
root@x062:[/home/root/ansible/wheels]echo $PATH
/opt/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java6/jre/bin:/usr/java6/bin
root@x062:[/home/root/ansible/wheels]ls -l pip*
-rw-r--r--    1 199      1954        1415262 Nov 05 10:15 pip-19.3.1-py2.py3-none-any.whl
root@x062:[/home/root/ansible/wheels]pip3 install --upgrade pip*.whl
Processing ./pip-19.3.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 18.1
    Uninstalling pip-18.1:
      Successfully uninstalled pip-18.1
Successfully installed pip-19.3.1
root@x062:[/home/root/ansible/wheels]pip3 install virtual*.whl wheel*.whl
Processing ./virtualenv-16.7.7-py2.py3-none-any.whl
Processing ./wheel-0.33.6-py2.py3-none-any.whl
Installing collected packages: virtualenv, wheel
Successfully installed virtualenv-16.7.7 wheel-0.33.6
root@x062:[/home/root/ansible/wheels]pip3 list
Package    Version
---------- -------
pip        19.3.1
setuptools 40.6.2
virtualenv 16.7.7
wheel      0.33.6
root@x062:[/home/root/ansible/wheels]## Willaproceedpandtinstalltansible - must rename the AIX wheels
root@x062:[/home/root/ansible/wheels]## based on "pip debug" output
root@x062:[/home/root/ansible/wheels]pip debug
WARNING: This command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without notice.
pip version: pip 19.3.1 from /opt/lib/python3.6/site-packages/pip (python 3.6)
sys.version: 3.6.9 (default, Nov  6 2019, 09:11:18) [C]
sys.executable: /opt/bin/python3.6
sys.getdefaultencoding: utf-8
sys.getfilesystemencoding: utf-8
locale.getpreferredencoding: UTF-8
sys.platform: aix5
sys.implementation:
  name: cpython
Compatible tags: 18
  cp36-cp36m-AIX_7105_1731_32
  cp36-abi3-AIX_7105_1731_32
  cp36-none-AIX_7105_1731_32
  cp35-abi3-AIX_7105_1731_32
  cp34-abi3-AIX_7105_1731_32
  cp33-abi3-AIX_7105_1731_32
  cp32-abi3-AIX_7105_1731_32
  py3-none-AIX_7105_1731_32
  cp36-none-any
  cp3-none-any
  ...
  [First 10 tags shown. Pass --verbose to show all.]
root@x062:[/home/root/ansible/wheels]ls *AIX*
MarkupSafe-1.1.1-cp36-cp36m-AIX_5307_0747_32.whl  cffi-1.13.2-cp36-cp36m-AIX_5307_0747_32.whl
PyYAML-5.1.2-cp36-cp36m-AIX_5307_0747_32.whl      cryptography-2.8-cp36-cp36m-AIX_5307_0747_32.whl
root@x062:[/home/root/ansible/wheels]mv MarkupSafe-1.1.1-cp36-cp36m-AIX_5307_0747_32.whl MarkupSafe-1.1.1-cp36-cp36m-AIX_7105_1731_32.whl
root@x062:[/home/root/ansible/wheels]mv PyYAML-5.1.2-cp36-cp36m-AIX_5307_0747_32.whl PyYAML-5.1.2-cp36-cp36m-AIX_7105_1731_32.whl
root@x062:[/home/root/ansible/wheels]mv cffi-1.13.2-cp36-cp36m-AIX_5307_0747_32.whl cffi-1.13.2-cp36-cp36m-AIX_7105_1731_32.whl
root@x062:[/home/root/ansible/wheels]mv cryptography-2.8-cp36-cp36m-AIX_5307_0747_32.whl cryptography-2.8-cp36-cp36m-AIX_7105_1731_32.whl
root@x062:[/home/root/ansible/wheels]## Installing all wheels into system.
root@x062:[/home/root/ansible/wheels]pip install *.whl
Processing ./Jinja2-2.10.3-py2.py3-none-any.whl
Processing ./MarkupSafe-1.1.1-cp36-cp36m-AIX_7105_1731_32.whl
Processing ./PyYAML-5.1.2-cp36-cp36m-AIX_7105_1731_32.whl
Processing ./ansible-2.9.1-py3-none-any.whl
Processing ./cffi-1.13.2-cp36-cp36m-AIX_7105_1731_32.whl
Processing ./cryptography-2.8-cp36-cp36m-AIX_7105_1731_32.whl
Requirement already satisfied: pip==19.3.1 from file:///home/root/ansible/wheels/pip-19.3.1-py2.py3-none-any.whl in /opt/lib/python3.6/site-packages (19.3.1)
Processing ./pycparser-2.19-py2.py3-none-any.whl
Processing ./six-1.13.0-py2.py3-none-any.whl
Requirement already satisfied: virtualenv==16.7.7 from file:///home/root/ansible/wheels/virtualenv-16.7.7-py2.py3-none-any.whl in /opt/lib/python3.6/site-packages (16.7.7)
Requirement already satisfied: wheel==0.33.6 from file:///home/root/ansible/wheels/wheel-0.33.6-py2.py3-none-any.whl in /opt/lib/python3.6/site-packages (0.33.6)
Installing collected packages: MarkupSafe, Jinja2, PyYAML, pycparser, cffi, six, cryptography, ansible
Successfully installed Jinja2-2.10.3 MarkupSafe-1.1.1 PyYAML-5.1.2 ansible-2.9.1 cffi-1.13.2 cryptography-2.8 pycparser-2.19 six-1.13.0
e) after the command "pip install *.whl" finishes you should have a working ansible. I do not know ansible, so the only test I can suggest is:
# which ansible ## (should be /opt/bin/ansible, you can create a symbolic from /usr/bin if you need it)

# ansible --version ## or /opt/bin/ansible --version

e.g.:
Code: [Select]
root@x062:[/home/root]which ansible
/opt/bin/ansible
root@x062:[/home/root]ansible --version
ansible 2.9.1
  config file = None
  configured module search path = ['/home/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/lib/python3.6/site-packages/ansible
  executable location = /opt/bin/ansible
  python version = 3.6.9 (default, Nov  6 2019, 09:11:18) [C]

Hope this helps!
Michael

tbramha

  • Full Member
  • ***
  • Posts: 15
  • Karma: +0/-0
Re: PYTHON INSTALLATION
« Reply #25 on: November 17, 2019, 04:35:41 PM »
Hello Michael,

Thanks for your reply. Do you want me to run  installp -u aixtools.libffi now ?

Could you please help me with below queries

1. Under troubleshooting Based on the output from pip3 in debug we will run below command right?


root@x066:[/data/prj/python/wheels/AIX-5307]ln  MarkupSafe-1.1.1-cp36-cp36m-AIX_5307_0747_64.whl MarkupSafe-1.1.1-cp36-cp36m-AIX_6106_1043_64.whl

2. I have executed below and ended got below errors. Could you please tell me was it successful installation or not?

(ansible) root@ztapp08:/home/exttbra # ln MarkupSafe-1.1.1-cp36-cp36m-AIX_5307_0747_32 MarkupSafe-1.1.1-cp36-cp36m-AIX_6106_1043_64.whl
ln: MarkupSafe-1.1.1-cp36-cp36m-AIX_5307_0747_32: No such file or directory

ansible) root@ztapp08:/home/exttbra # pip install Mark*6106*whl
ERROR: MarkupSafe-1.1.1-cp36-cp36m-AIX_6106_1043_64.whl is not a supported wheel on this platform.

3. You mentioned  under point 7 " Later, when you are satisfied as root, go back and install the wheels into the "SYSTEM" python libraries" .  Could you please explain it in detail

4. If I have to install 64bit python 3.6 then I should get wheels from http://download.aixtools.net/test/wheels/6106/ right?


Thanks in advance for bearing many queries from me. I have followed http://www.rootvg.net/content/view/847/169/ and waiting for my development team to test their code.

Regards,
Brahma.T

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1195
  • Karma: +0/-0
Re: PYTHON INSTALLATION
« Reply #26 on: November 17, 2019, 06:20:59 PM »
Since you installed the 32-bit version, you need the wheels from the 5307 directory.

Please read - carefully - in my previous post - the section labeled:

d) read through the following - PAY SPECIAL ATTENTION - to the mv commands that change the tag of the AIX binary wheels.

If you have any additional issues - please provide the output of
Code: [Select]
pip debug

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1195
  • Karma: +0/-0
Re: PYTHON INSTALLATION
« Reply #27 on: November 18, 2019, 08:06:40 AM »
Sounded like you were almost there. Would like to hear how things are progressing!

tbramha

  • Full Member
  • ***
  • Posts: 15
  • Karma: +0/-0
Re: PYTHON INSTALLATION
« Reply #28 on: November 18, 2019, 08:17:39 AM »
Hello Michael,

We are not able to install cx_Oracle now. Please find the below error. It seems compiler issue again.

soa@ztapp08:/home/soa # pip3 install cx_Oracle
Collecting cx_Oracle
  Downloading https://files.pythonhosted.org/packages/d0/00/2d4b1e27da6dda2408dcfe4e192b26c2e190be573c6aadb0c97739f15774/cx_Oracle-7.2.3.tar.gz (303kB)
     |################################| 307kB 1.2MB/s
Building wheels for collected packages: cx-Oracle
  Building wheel for cx-Oracle (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tz_tokf2/cx-Oracle/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tz_tokf2/cx-Oracle/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-c080b36e --python-tag cp36
       cwd: /tmp/pip-install-tz_tokf2/cx-Oracle/
  Complete output (12 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'cx_Oracle' extension
  creating build
  creating build/temp.AIX.7105.1831.32-3.6
  creating build/temp.AIX.7105.1831.32-3.6/src
  creating build/temp.AIX.7105.1831.32-3.6/odpi
  creating build/temp.AIX.7105.1831.32-3.6/odpi/src
  xlc_r -DNDEBUG -O -I/opt/include -O2 -qmaxmem=-1 -qarch=pwr5 -I/opt/include -O2 -qmaxmem=-1 -qarch=pwr5 -DCXO_BUILD_VERSION=7.2.3 -Iodpi/include -Iodpi/src -I/opt/include/python3.6m -c src/cxoBuffer.c -o build/temp.AIX.7105.1831.32-3.6/src/cxoBuffer.o -DAIX5
  unable to execute 'xlc_r': Permission denied
  error: command 'xlc_r' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for cx-Oracle
  Running setup.py clean for cx-Oracle
Failed to build cx-Oracle
Installing collected packages: cx-Oracle
    Running setup.py install for cx-Oracle ... error
    ERROR: Command errored out with exit status 1:
     command: /opt/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tz_tokf2/cx-Oracle/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tz_tokf2/cx-Oracle/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-8fqeqwg2/install-record.txt --single-version-externally-managed --compile
         cwd: /tmp/pip-install-tz_tokf2/cx-Oracle/
    Complete output (12 lines):
    running install
    running build
    running build_ext
    building 'cx_Oracle' extension
    creating build
    creating build/temp.AIX.7105.1831.32-3.6
    creating build/temp.AIX.7105.1831.32-3.6/src
    creating build/temp.AIX.7105.1831.32-3.6/odpi
    creating build/temp.AIX.7105.1831.32-3.6/odpi/src
    xlc_r -DNDEBUG -O -I/opt/include -O2 -qmaxmem=-1 -qarch=pwr5 -I/opt/include -O2 -qmaxmem=-1 -qarch=pwr5 -DCXO_BUILD_VERSION=7.2.3 -Iodpi/include -Iodpi/src -I/opt/include/python3.6m -c src/cxoBuffer.c -o build/temp.AIX.7105.1831.32-3.6/src/cxoBuffer.o -DAIX5
    unable to execute 'xlc_r': Permission denied
    error: command 'xlc_r' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tz_tokf2/cx-Oracle/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tz_tokf2/cx-Oracle/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-8fqeqwg2/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.


Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1195
  • Karma: +0/-0
Re: PYTHON INSTALLATION
« Reply #29 on: November 18, 2019, 08:36:19 AM »
Had a moment - and have the wheel in http://download.aixtools.net/test/wheels/5307

You will need to link/move to a new name in order to load - same as the other wheels.