KxSystems / pyq

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

MacOS 'pip install pyq' shows ' RuntimeError: no python dll' #57

Closed superidylle closed 6 years ago

superidylle commented 6 years ago

Questions

i tried install by pip install pyq and from source code, they all show runtime error?

      File "/private/var/folders/k1/5yp6mmxd1_g2x57_qf_29f980000gn/T/pip-build-6ls07tww/pyq/setup.py", line 264, in get_python_dll
        raise RuntimeError('no python dll')
    RuntimeError: no python dll

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/k1/5yp6mmxd1_g2x57_qf_29f980000gn/T/pip-build-6ls07tww/pyq/

i see someone else have some error? but cannot find how to solve.

MaxHoefl commented 6 years ago

getting same error on Linux RedHat_6.6 (6.6-1) - 2.6.32-696.20.1.el6.x86_64 as discussed in #32 tried both q 64-bit and 32-bit using anaconda 4.4.10 (not using virtual env)

@sashkab: Are the changes of the 4.1.3 release where this issue was addressed already part of the pyq that is installed by pip?

sashkab commented 6 years ago

@MaxHoefl 4.1.3 is what served by pypi.org when you run pip install.

Could you please provide detailed steps you use to install PyQ? Did you use virtualenv?

MaxHoefl commented 6 years ago

@sashkab sure, see below:

  1. install anaconda 4.4.10 (latest release)

  2. create pip.conf in ~/.config/pip/ where I set

[global]
proxy=https://user:password@proxy:port
  1. install q in ~/ (i have tried both licensed 64-bit and unlicensed 32-bit version for linux x86) and set QHOME=/home/user/q/.

  2. pip install --upgrade pip (all fine); pip install pyq

-bash-4.1$ pip install pyq
Collecting pyq
  Using cached pyq-4.1.3.tar.gz
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/pyq.egg-info
    writing pip-egg-info/pyq.egg-info/PKG-INFO
    writing dependency_links to pip-egg-info/pyq.egg-info/dependency_links.txt
    writing requirements to pip-egg-info/pyq.egg-info/requires.txt
    writing top-level names to pip-egg-info/pyq.egg-info/top_level.txt
    writing manifest file 'pip-egg-info/pyq.egg-info/SOURCES.txt'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-59nktpll/pyq/setup.py", line 679, in <module>
        run_setup(METADATA)
      File "/tmp/pip-build-59nktpll/pyq/setup.py", line 675, in run_setup
        setup(**keywords)
      File "/home/hoeflm/anaconda3/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/home/hoeflm/anaconda3/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/home/hoeflm/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/hoeflm/anaconda3/lib/python3.6/site-packages/setuptools/command/egg_info.py", line 278, in run
        self.find_sources()
      File "/home/hoeflm/anaconda3/lib/python3.6/site-packages/setuptools/command/egg_info.py", line 293, in find_sources
        mm.run()
      File "/home/hoeflm/anaconda3/lib/python3.6/site-packages/setuptools/command/egg_info.py", line 524, in run
        self.add_defaults()
      File "/home/hoeflm/anaconda3/lib/python3.6/site-packages/setuptools/command/egg_info.py", line 560, in add_defaults
        sdist.add_defaults(self)
      File "/home/hoeflm/anaconda3/lib/python3.6/site-packages/setuptools/command/py36compat.py", line 36, in add_defaults
        self._add_defaults_ext()
      File "/home/hoeflm/anaconda3/lib/python3.6/site-packages/setuptools/command/py36compat.py", line 119, in _add_defaults_ext
        build_ext = self.get_finalized_command('build_ext')
      File "/home/hoeflm/anaconda3/lib/python3.6/distutils/cmd.py", line 299, in get_finalized_command
        cmd_obj.ensure_finalized()
      File "/home/hoeflm/anaconda3/lib/python3.6/distutils/cmd.py", line 107, in ensure_finalized
        self.finalize_options()
      File "/tmp/pip-build-59nktpll/pyq/setup.py", line 471, in finalize_options
        ('define', 'define'))
      File "/home/hoeflm/anaconda3/lib/python3.6/distutils/cmd.py", line 287, in set_undefined_options
        src_cmd_obj.ensure_finalized()
      File "/home/hoeflm/anaconda3/lib/python3.6/distutils/cmd.py", line 107, in ensure_finalized
        self.finalize_options()
      File "/tmp/pip-build-59nktpll/pyq/setup.py", line 406, in finalize_options
        ('q_version', 'q_version'))
      File "/home/hoeflm/anaconda3/lib/python3.6/distutils/cmd.py", line 287, in set_undefined_options
        src_cmd_obj.ensure_finalized()
      File "/home/hoeflm/anaconda3/lib/python3.6/distutils/cmd.py", line 107, in ensure_finalized
        self.finalize_options()
      File "/tmp/pip-build-59nktpll/pyq/setup.py", line 306, in finalize_options
        self.python_dll = get_python_dll(sys.executable)
      File "/tmp/pip-build-59nktpll/pyq/setup.py", line 264, in get_python_dll
        raise RuntimeError('no python dll')
    RuntimeError: no python dll
sashkab commented 6 years ago

@MaxHoefl did you attempt to use workaround from #32?

MaxHoefl commented 6 years ago

@sashkab Just tried workaround from #32 when using 32-bit q and 64-bit q. Both gave me Successfully installed pyq-4.1.3 that's nice but

  1. when I start $ pyq with the 32-bit q installation it gives me
-bash-4.1$ pyq
Welcome to kdb+ 32bit edition
For support please see http://groups.google.com/d/forum/personal-kdbplus
Tutorials can be found at http://code.kx.com/q
To exit, type \\
To remove this startup msg, edit q.q
'2018.04.13T14:10:26.287 /home/hoeflm/q-linux-x86/l32/p.so: wrong ELF class: ELFCLASS64
  [4]  /home/hoeflm/q-linux-x86/p.k:3: (`p 2:(`p_init;1))python_dll
  1. when I start $ pyq with the 64-bit licensed q installation it gives me
-bash-4.1$ pyq
'2018.04.13T14:17:32.953 /home/hoeflm/q//l32/py.so: cannot open shared object file: No such file or directory
@
"q"
"py:PYSO 2:(`py;3)"

I checked, the py.so file was installed to q/l64 but it's trying to find it in l32.

sashkab commented 6 years ago

When starting 32-bit version of PyQ — do you use 32-bit Python? From error it seems, you have 64-bit version of Python.

MaxHoefl commented 6 years ago

@sashkab Yes I am using python 3.6.4 Would it be hard to make it look both in l32 and l64 when searching for py.so ?

abalkin commented 6 years ago

Starting with release, 4.1.4 use

conda install -c kx -c enlnt pyq

to install both kdb+ and PyQ.