KxSystems / pyq

PyQ — Python for kdb+
http://code.kx.com/q/interfaces
Apache License 2.0
191 stars 49 forks source link

Pyq on 64-bit Centos 7 failes with Invalid ELF header #128

Closed perfecto25 closed 4 years ago

perfecto25 commented 4 years ago

Questions


- [ ] Which version of PyQ are you running? Please provide output of  `pyq --versions`, if PyQ isn't operational, please provide Python interpreter version and PyQ version `python -V; python3 -V; pip list | grep pyq`:
cannot run pyq, 

mreider@qbreport-us1:~ $ python -V Python 2.7.5

mreider@qbreport-us1:~ $ python3 -V Python 3.6.8

mreider@qbreport-us1:~ $ pip list | grep pyq pyq 4.2.1


- [ ] Which version of kdb+ are you using, is it 32-bit or 64-bit?
64 professional

  - [ ] If on 64-bit, is your `QLIC` set? Please provide output `env | grep QLIC` on linux
    mreider@qbreport-us1:~ $ env | grep QLIC

QLIC=/opt/qb/q3.6


- [ ] Did you use virtual environment to install PyQ? If not, why?

   - no, need system wide pyq

- [ ] Where is your `QHOME`? Please provide output `env | grep QHOME` on linux/macOS
mreider@qbreport-us1:~ $ env | grep QHOME
 QHOME=/opt/qb/q3.6

- [ ] Do you use Conda? If so, what version?
no

## Steps to reproduce the issue
install pyq

pip install pyq

chmod +x /usr/bin/pyq  (pyq is not executable after pip installs it)

try running pyq,

mreider@qbreport-us1:~ $ pyq '2020.02.27T15:24:25.615 /usr/local/lib/libpython3.7m.a: invalid ELF header [4] /opt/qb/q3.6/p.k:2: (:./pyq 2:(p_init;1)).pyq.python_dll ^



## Expected result
pyq shell

## Actual result
getting ELF error 

'2020.02.27T15:24:25.615 /usr/local/lib/libpython3.7m.a: invalid ELF header
  [4]  /opt/qb/q3.6/p.k:2: (`:./pyq 2:(`p_init;1)).pyq.python_dll

## Workaround

If you know workaround, please provide it here.
perfecto25 commented 4 years ago

I think I got it to work by uninstalling all versions of pyq (py2, py3, py3.6, py3.7, etc)

then reinstalling, copied the Q files from /usr/local/q (not sure what install this), to our default Q installation,

python3.6 -m pip install pyq
chmod +x /usr/local/bin/pyq

cp -R /usr/local/q/* /opt/qb/q3.6/

now pyq opens up a python shell correctly,

 root@qbreport-us1:q3.6 $ /usr/local/bin/pyq
Python 3.6.8 (default, Aug  7 2019, 17:28:10) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> 
>>> quit()
sashkab commented 4 years ago

This is user error. pip is linked to python 3.7 /usr/local/lib/libpython3.7m.a, but user uses Python 3.6. Proper way to install is

python3.6 -mpip install pyq

And don't install PyQ as root user. This is not supported.