HPUX安装Python、cx_Oracle、mysql和MySQLdb

1. 安装依赖包

expat-2.2.3-ia64_64-11.31.depot.gz
下载地址:http://hpux.connect.org.uk/hppd/hpux/Development/Tools/expat-2.2.3/

# gunzip expat-2.2.3-ia64_64-11.31.depot.gz
# swinstall -s /tmp/expat-2.2.3-ia64_64-11.31.depot expat

=======  03/26/18 14:37:32 EAT  BEGIN swinstall SESSION
        (non-interactive) (jobid=bcbsswx-0096)

      * Session started for user "root@bcbsswx".
        
      * Beginning Selection
      * Target connection succeeded for "bcbsswx:/".
      * Source:                /tmp/expat-2.2.3-ia64_64-11.31.depot
      * Targets:                bcbsswx:/
      * Software selections:
            expat.expat-RUN,r=2.2.3,a=HP-UX_B.11.31_64
      * Selection succeeded.
        
        
      * Beginning Analysis and Execution
      * Session selections have been saved in the file
        "/.sw/sessions/swinstall.last".
      * The analysis phase succeeded for "bcbsswx:/".
      * The execution phase succeeded for "bcbsswx:/".
      * Analysis and Execution succeeded.
        
        
NOTE:    More information may be found in the agent logfile using the
        command "swjob -a log bcbsswx-0096 @ bcbsswx:/".

=======  03/26/18 14:37:37 EAT  END swinstall SESSION (non-interactive)
        (jobid=bcbsswx-0096)

2. 安装过程

下载地址:http://hpux.connect.org.uk/hppd/hpux/Languages/python-2.7.13/
下载文件:python-2.7.13-ia64_64-11.31.depot.gz

# gunzip python-2.7.13-ia64_64-11.31.depot.gz
# swinstall -s /tmp/python-2.7.13-ia64_64-11.31.depot python

=======  03/26/18 14:28:23 EAT  BEGIN swinstall SESSION
        (non-interactive) (jobid=bcbsswx-0094)

      * Session started for user "root@bcbsswx".
        
      * Beginning Selection
      * Target connection succeeded for "bcbsswx:/".
      * Source:                /tmp/python-2.7.13-ia64_64-11.31.depot
      * Targets:                bcbsswx:/
      * Software selections:
            python.python-INC,r=2.7.13,a=HP-UX_B.11.31_64
            python.python-RUN,r=2.7.13,a=HP-UX_B.11.31_64
      * Selection succeeded.
        
        
      * Beginning Analysis and Execution
      * Session selections have been saved in the file
        "/.sw/sessions/swinstall.last".
      * The analysis phase succeeded for "bcbsswx:/".
      * The execution phase succeeded for "bcbsswx:/".
      * Analysis and Execution succeeded.
        
        
NOTE:    More information may be found in the agent logfile using the
        command "swjob -a log bcbsswx-0094 @ bcbsswx:/".

=======  03/26/18 14:28:43 EAT  END swinstall SESSION (non-interactive)
        (jobid=bcbsswx-0094)

# python
Python 2.7.13 (default, Aug 22 2017, 12:47:12) [C] on hp-ux11
Type "help", "copyright", "credits" or "license" for more information.
>>>

3.安装cx_Oracle

包:cx_Oracle-6.2.1.tar.gz

Oracle客户端必须要为11.2及以上

# gunzip cx_Oracle-6.2.1.tar.gz
# tar xvf cx_Oracle-6.2.1.tar
# cd cx_Oracle-6.2.1
# export ORACLE_BASE=/oracle/app/oracle
# export ORACLE_HOME=/oracle/app/oracle/product/10.2/db_1
# export SHLIB_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:$ORACLE_HOME/rdbms/lib
# python setup.py install 

查看模块

>>> help('modules')

Please wait a moment while I gather a list of all available modules...

BaseHTTPServer      asynchat            ihooks              sgmllib
Bastion            asyncore            imaplib            sha
CGIHTTPServer      atexit              imghdr              shelve
Canvas              audiodev            imp                shlex
ConfigParser        audioop            importlib          shutil
Cookie              base64              imputil            signal
Dialog              bdb                inspect            site
DocXMLRPCServer    binascii            io                  smtpd
FileDialog          binhex              itertools          smtplib
FixTk              bisect              json                sndhdr
HTMLParser          bsddb              keyword            socket
IN                  bz2                lib2to3            sqlite3
MimeWriter          cPickle            linecache          sre
Queue              cProfile            locale              sre_compile
ScrolledText        cStringIO          logging            sre_constants
SimpleDialog        calendar            macpath            sre_parse
SimpleHTTPServer    cgi                macurl2path        ssl
SimpleXMLRPCServer  cgitb              mailbox            stat
SocketServer        chunk              mailcap            statvfs
StringIO            cmath              markupbase          string
Tix                cmd                marshal            stringold
Tkconstants        code                math                stringprep
Tkdnd              codecs              md5                strop
Tkinter            codeop              mhlib              struct
UserDict            collections        mimetools          subprocess
UserList            colorsys            mimetypes          sunau
UserString          commands            mimify              sunaudio
_LWPCookieJar      compileall          mmap                symbol
_MozillaCookieJar  compiler            modulefinder        symtable
__builtin__        contextlib          multifile          sys
__future__          cookielib          multiprocessing    sysconfig
_abcoll            copy                mutex              syslog
_ast                copy_reg            netrc              tabnanny
_bisect            crypt              new                tarfile
_codecs            csv                nis                telnetlib
_codecs_cn          ctypes              nntplib            tempfile
_codecs_hk          curses              ntpath              termios
_codecs_iso2022    cx_Oracle          nturl2path          test
_codecs_jp          datetime            numbers            textwrap
_codecs_kr          dbhash              opcode              this
_codecs_tw          decimal            operator            thread
_collections        difflib            optparse            threading
_csv                dircache            os                  time
_ctypes            dis                os2emxpath          timeit
_ctypes_test        distutils          parser              tkColorChooser
_curses            doctest            pdb                tkCommonDialog
_curses_panel      dumbdbm            pickle              tkFileDialog
_elementtree        dummy_thread        pickletools        tkFont
_functools          dummy_threading    pipes              tkMessageBox
_hashlib            email              pkgutil            tkSimpleDialog
_heapq              encodings          platform            toaiff
_hotshot            ensurepip          plistlib            token
_io                errno              popen2              tokenize
_json              exceptions          poplib              trace
_locale            fcntl              posix              traceback
_lsprof            filecmp            posixfile          ttk
_multibytecodec    fileinput          posixpath          tty
_multiprocessing    fnmatch            pprint              turtle
_osx_support        formatter          profile            types
_pyio              fpformat            pstats              unicodedata
_random            fractions          pty                unittest
_socket            ftplib              pwd                urllib
_sqlite3            functools          py_compile          urllib2
_sre                future_builtins    pyclbr              urlparse
_ssl                gc                  pydoc              user
_strptime          gdbm                pydoc_data          uu
_struct            genericpath        pyexpat            uuid
_symtable          getopt              quopri              warnings
_sysconfigdata      getpass            random              wave
_testcapi          gettext            re                  weakref
_threading_local    glob                readline            webbrowser
_warnings          grp                repr                whichdb
_weakref            gzip                resource            wsgiref
_weakrefset        hashlib            rexec              xdrlib
abc                heapq              rfc822              xml
aifc                hmac                rlcompleter        xmllib
antigravity        hotshot            robotparser        xmlrpclib
anydbm              htmlentitydefs      runpy              xxsubtype
argparse            htmllib            sched              zipfile
array              httplib            select              zipimport
ast                idlelib            sets                zlib

# 4. 安装MySQLdb模块

安装zlib
下载地址:http://hpux.connect.org.uk/hppd/hpux/Misc/zlib-1.2.8/

# gunzip zlib-1.2.11-ia64_64-11.31.depot.gz
# swinstall -s /tmp/zlib-1.2.11-ia64_64-11.31.depot zlib

安装libffi
下载地址:http://hpux.connect.org.uk/hppd/hpux/Development/Libraries/libffi-3.2.1/

# gunzip libffi-3.2.1-ia64_64-11.31.depot.gz
# swinstall -s /tmp/libffi-3.2.1-ia64_64-11.31.depot libffi

安装依赖模块 setuptools
下载地址:https://pypi.python.org/pypi/setuptools/39.0.1

# unzip setuptools-39.0.1.zip
# python setup.py install

安装MySQL模块
下载地址:http://hpux.connect.org.uk/hppd/hpux/Development/Languages/mysql-5.1.73/
安装MySQL的依赖包

# gunzip openssl-1.0.2n-ia64_64-11.31.depot.gz
# swinstall -s /tmp/openssl-1.0.2n-ia64_64-11.31.depot openssl
# gunzip ncurses-6.1-ia64_64-11.31.depot.gz
# swinstall -s /tmp/ncurses-6.1-ia64_64-11.31.depot ncurses

安装MySQL

# gunzip mysql-5.1.73-ia64_64-11.31.depot.gz
# swinstall -s /tmp/mysql-5.1.73-ia64_64-11.31.depot mysql

测试连接

# export SHLIB_PATH=/usr/local/lib/hpux64:/usr/local/mysql/lib/mysql
# export PATH=$PATH:/usr/local/mysql/bin
# mysql -uroot -pxxxxx -h192.168.139.13

安装MySQLdb模块

# export PATH=$PATH:/usr/local/mysql/bin
# unzip MySQL-python-1.2.5.zip
# cd MySQL-python-1.2.5
# python setup.py build
# python setup.py install
# 

关于紫砂壶

感悟技术人生
此条目发表在Python分类目录,贴了标签。将固定链接加入收藏夹。