KxSystems / pyq

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

pyq doesn't pick up 64bit q on OSX #25

Closed gerrymanoim closed 6 years ago

gerrymanoim commented 6 years ago

Perhaps I'm doing something wrong, but no matter what I try I can't get pyq to recognize that it should be looking for q in the m64 directory. It seems like setup.py is reading QHOME and doing the right thing, so I'm not quite sure what the problem is:

>> pip install --no-cache-dir pyq
Collecting pyq
  Downloading pyq-4.1.2-cp36-cp36m-macosx_10_12_intel.whl (123kB)
    100% |████████████████████████████████| 133kB 1.7MB/s
Installing collected packages: pyq
Successfully installed pyq-4.1.2
>> pyq
qbinpath = /Users/g/dev/q/m32/q
qbinpath = /Users/g/anaconda/q/m32/q
qbinpath = /Users/g/q/m32/q
No such file or directory
>> ls $QHOME/m64
ffi.so      ffi.so.dSYM q
>> ls $QHOME/m32
ffi.so      ffi.so.dSYM
abalkin commented 6 years ago

We currently only have a 32-bit binary wheel for macOS on PyPI. Please try specifying --no-binary pyq option for pip:

pip install --no-binary pyq pyq

Please note that you will need to have either xcode or "Command Line Tools" installed because with the --no-binary option pip will have to compile pyq for you.

gerrymanoim commented 6 years ago

Ah got it! I've tried running the above and seem to hit a RuntimeError: no python dll.

I've managed to trace this to output = subprocess.check_output(['otool', '-L', executable]) in get_python_dll in setup.py. On my system this has the following output (none of which matches the if condition):

In [53]: output.splitlines()
Out[53]:
[b'/Users/g/anaconda/bin/python:',
 b'\t/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 855.17.0)',
 b'\t@rpath/libpython3.6m.dylib (compatibility version 3.6.0, current version 3.6.0)',
 b'\t/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)']

In [54]: for line in output.splitlines():
    ...:     print(b'Python' in line)
    ...:
False
False
False
False

I do manage my python environment through anaconda, which is not necessarily the default on the mac. But I would match the if condition you have for the linux systems.

Is there something off on my system?

abalkin commented 6 years ago

We are working on improving the situation for conda users. Meanwhile, the workaround is to add a setup.cfg file to the root of the source tree with the following contents:

[config]
python_dll=libpython3.6m.so

See Installing from source code for details on how to obtain PyQ source code.

gerrymanoim commented 6 years ago

Perfect - thanks!