How to install PyQ at RHEL

Hi, Dear all:
  According to the PyQ installation guide. the command: “pip install <path to the source>” can be used to install PyQ. But I got error message and failed.

[root@ETAPP1 pyq-pyq-3.8.3]#pip install /home/et/Python-3.6.0/pyq-pyq-3.8.3

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

Processing /home/et/Python-3.6.0/pyq-pyq-3.8.3

    Complete output from command python setup.py egg_info:

    Traceback (most recent call last):

      File “<string>”, line 1, in <module>

      File “/tmp/pip-npfrv5hm-build/setup.py”, line 783, in <module>

        **metadata)

      File “/home/et/Python-3.6.0/Lib/distutils/core.py”, line 108, in setup

        _setup_distribution = dist = klass(attrs)

      File “/tmp/pip-npfrv5hm-build/setup.py”, line 693, in __init__

        _Distribution.__init__(self, attrs)

      File “/usr/local/lib/python3.6/site-packages/setuptools/dist.py”, line 318, in __init__

        _Distribution.__init__(self, attrs)

      File “/home/et/Python-3.6.0/Lib/distutils/dist.py”, line 281, in __init__

        self.finalize_options()

      File “/tmp/pip-npfrv5hm-build/setup.py”, line 733, in finalize_options

        path = os.path.join(os.getenv(‘VIRTUAL_ENV’), ‘q’)

      File “/home/et/Python-3.6.0/Lib/posixpath.py”, line 78, in join

        a = os.fspath(a)

    TypeError: expected str, bytes or os.PathLike object, not NoneType

    

    ----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-npfrv5hm-build/

[root@ETAPP1 pyq-pyq-3.8.3]# more /tmp/pip-npfrv5hm-build/

*** /tmp/pip-npfrv5hm-build/: directory ***

  Do you have any suggestions? Thanks v m!

Zheng

On Wednesday, January 4, 2017 at 2:46:46 AM UTC-5, hzad...@gmail.com wrote:

  According to the PyQ installation guide. the command: “pip install <path to the source>” can be used to install PyQ. But I got error message and failed.

This would typically happen if your system python is linked statically. Try running ldd command with your python executable as an argument.  You should see something like

$ ldd $(which python)

linux-vdso.so.1 =>  (0x00007ffdfcf59000)

libpython2.7.so.1.0 => <…>/lib/libpython2.7.so.1.0 (0x00007f6a8c639000)

libpthread.so.0 => /lib64/libpthread.so.0 (0x00000034f7000000)

libdl.so.2 => /lib64/libdl.so.2 (0x00000034f6400000)

libutil.so.1 => /lib64/libutil.so.1 (0x0000003507400000)

libm.so.6 => /lib64/libm.so.6 (0x00000034f6c00000)

libc.so.6 => /lib64/libc.so.6 (0x00000034f6800000)

/lib64/ld-linux-x86-64.so.2 (0x00000034f6000000)

If you don’r see libpythonX.Y.so in the list of libraries - you need to recompile your python with --enable-shared option passed to the configure script.

Zheng,

 Please try one of these two workarounds:

  1. Use virtualenv for installing PyQ, i.e.:

$ python3.6 -m venv path/to/venv

$ source path/to/venv/bin/activate

$ pip install path/to/pyq

  1. If you don’t want to use virtual environment, pass VIRTUAL_ENV variable for setup to pass:

$ VIRTUAL_ENV=1 pip install path_to_pyq

This issue has been fixed internally and we should release patch shortly (probably later next week). 

Please note, you need to have kdb+ installed on your system either in $HOME/q or $QHOME variable should be set to the path of kdb+.

-Aleks

Hi, Sasha:
  Many thanks!

  Yes, I can’t find the libpythonX.Y.so at my site. So recompile with you mentioned parameter, and I also add the LD_LIBRARY_PATH. Then it can be found, such as:

  [root@ETAPP1 Python-3.6.0]# ldd $(which python)
linux-vdso.so.1 =>  (0x00007ffcb6bf7000)

libpython3.6m.so.1.0 => /home/et/Python-3.6.0/libpython3.6m.so.1.0 (0x00007f6f2d327000)

libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f6f2d0f4000)

libdl.so.2 => /lib64/libdl.so.2 (0x00007f6f2cef0000)

libutil.so.1 => /lib64/libutil.so.1 (0x00007f6f2cced000)

libm.so.6 => /lib64/libm.so.6 (0x00007f6f2c9ea000)

libc.so.6 => /lib64/libc.so.6 (0x00007f6f2c629000)

/lib64/ld-linux-x86-64.so.2 (0x00005617ece7f000)

? 2017?1?6??? UTC+8??8:41:45?Sasha???

Hi, Aleks:
  Thanks for your help!

  Yes, it’s a virtual env. I followed your steps, got a message like:

  [root@ETAPP1 Python-3.6.0]# python3.6 -m venv /home/et/Python-3.6.0/venv

  [root@ETAPP1 Python-3.6.0]# source /home/et/Python-3.6.0/venv/bin/activate
  (venv) [root@ETAPP1 Python-3.6.0]# pip install /home/et/Python-3.6.0/pyq-pyq-3.8.3

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

Processing ./pyq-pyq-3.8.3

Collecting pytest>=2.6.4 (from pyq==3.8.3)

  Could not fetch URL https://pypi.python.org/simple/pytest/: There was a problem confirming the ssl certificate: Can’t connect to HTTPS URL because the SSL module is not available. - skipping

  Could not find a version that satisfies the requirement pytest>=2.6.4 (from pyq==3.8.3) (from versions: )

No matching distribution found for pytest>=2.6.4 (from pyq==3.8.3)

  Why my pyq=3.8.3 does not match pytest>=2.6.4

Zheng

? 2017?1?7??? UTC+8??8:10:36?Aleks Bunin???

Zheng,

 Please try one of these two workarounds:

  1. Use virtualenv for installing PyQ, i.e.:

$ python3.6 -m venv path/to/venv

$ source path/to/venv/bin/activate

$ pip install path/to/pyq

  1. If you don’t want to use virtual environment, pass VIRTUAL_ENV variable for setup to pass:

$ VIRTUAL_ENV=1 pip install path_to_pyq

This issue has been fixed internally and we should release patch shortly (probably later next week). 

Please note, you need to have kdb+ installed on your system either in $HOME/q or $QHOME variable should be set to the path of kdb+.

-Aleks

On Tuesday, January 10, 2017 at 2:49:31 AM UTC-5, hzad...@gmail.com wrote:

Collecting pytest>=2.6.4 (from pyq==3.8.3)

  Could not fetch URL https://pypi.python.org/simple/pytest/: There was a problem confirming the ssl certificate: Can’t connect to HTTPS URL because the SSL module is not available. - skipping

  Could not find a version that satisfies the requirement pytest>=2.6.4 (from pyq==3.8.3) (from versions: )

No matching distribution found for pytest>=2.6.4 (from pyq==3.8.3)

  Why my pyq=3.8.3 does not match pytest>=2.6.4

The root of this problem is shown a few lines above: “the SSL module is not available.”  Please make sure you have all the necessary dependencies to build python. Try

$ sudo yum install yum-utils$ sudo yum-builddep python3

 See <https://docs.python.org/devguide/setup.html#build-dependencies\> for details.