Cannot install package zmq

All other Source.Python topics and issues.
User avatar
copyerfiled
Junior Member
Posts: 16
Joined: Wed Jan 23, 2019 9:40 am

Cannot install package zmq

Postby copyerfiled » Wed Jan 23, 2019 11:08 am

source-python 3.6.1 (default, Jun 16 2017, 09:50:37)

$ pip3 -V
pip 18.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
$ python3
Python 3.6.1 (default, Jan 23 2019, 10:20:59)
$ pwd
/home/steam/csgo/csgo/addons/source-python/packages/custom
$ pip install -t . zmq
$ cat /home/steam/csgo/csgo/addons/source-python/plugins/zzz/zzz.py
import zmq

Code: Select all

[SP] Caught an Exception:
Traceback (most recent call last):
  File "../addons/source-python/packages/source-python/plugins/command.py", line 162, in load_plugin
    plugin = self.manager.load(plugin_name)
  File "../addons/source-python/packages/source-python/plugins/manager.py", line 194, in load
    plugin._load()
  File "../addons/source-python/packages/source-python/plugins/instance.py", line 74, in _load
    self.module = import_module(self.import_name)
  File "../addons/source-python/plugins/zzz/zzz.py", line 1, in <module>
    import zmq
  File "../addons/source-python/packages/custom/zmq/__init__.py", line 47, in <module>
    from zmq import backend
  File "../addons/source-python/packages/custom/zmq/backend/__init__.py", line 40, in <module>
    reraise(*exc_info)
  File "../addons/source-python/packages/custom/zmq/utils/sixcerpt.py", line 34, in reraise
    raise value
  File "../addons/source-python/packages/custom/zmq/backend/__init__.py", line 27, in <module>
    _ns = select_backend(first)
  File "../addons/source-python/packages/custom/zmq/backend/select.py", line 27, in select_backend
    mod = __import__(name, fromlist=public_api)
  File "../addons/source-python/packages/custom/zmq/backend/cython/__init__.py", line 6, in <module>
    from . import (constants, error, message, context,

ImportError: cannot import name 'constants'


[SP] Plugin 'zzz' was unable to be loaded.


how to fix this error?
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Cannot install package zmq

Postby Ayuto » Wed Jan 23, 2019 4:23 pm

What's the output of pip install -t . zmq? Maybe it failed to build some of the cpython libraries.
User avatar
copyerfiled
Junior Member
Posts: 16
Joined: Wed Jan 23, 2019 9:40 am

Re: Cannot install package zmq

Postby copyerfiled » Wed Jan 23, 2019 6:24 pm

Ayuto wrote:What's the output of pip install -t . zmq? Maybe it failed to build some of the cpython libraries.

installed well

Code: Select all

Collecting zmq
  Using cached https://files.pythonhosted.org/packages/6e/78/833b2808793c1619835edb1a4e17a023d5d625f4f97ff25ffff986d1f472/zmq-0.0.0.tar.gz
Collecting pyzmq (from zmq)
  Using cached https://files.pythonhosted.org/packages/48/93/59592cb294761aaa40589b544eaa5175446d687ff95beeeb666de60f3274/pyzmq-17.1.2-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: pyzmq, zmq
  Running setup.py install for zmq ... done
Successfully installed pyzmq-17.1.2 zmq-0.0.0




Code: Select all

[steam@csgo1:~/csgo/csgo/addons/source-python/packages/custom/zmq/backend/cython]$ ll
total 748
drwxr-xr-x 3 steam steam   4096 Jan 23 18:16 ./
drwxr-xr-x 5 steam steam   4096 Jan 23 18:16 ../
-rw-r--r-- 1 steam steam    894 Jan 23 18:16 checkrc.pxd
-rw-r--r-- 1 steam steam   4950 Jan 23 18:16 constant_enums.pxi
-rwxr-xr-x 1 steam steam  67608 Jan 23 18:16 constants.cpython-36m-x86_64-linux-gnu.so*
-rw-r--r-- 1 steam steam   8596 Jan 23 18:16 constants.pxi
-rwxr-xr-x 1 steam steam  83144 Jan 23 18:16 context.cpython-36m-x86_64-linux-gnu.so*
-rw-r--r-- 1 steam steam   1778 Jan 23 18:16 context.pxd
-rwxr-xr-x 1 steam steam  61856 Jan 23 18:16 _device.cpython-36m-x86_64-linux-gnu.so*
-rwxr-xr-x 1 steam steam  40280 Jan 23 18:16 error.cpython-36m-x86_64-linux-gnu.so*
-rw-r--r-- 1 steam steam    627 Jan 23 18:16 __init__.py
-rw-r--r-- 1 steam steam   4221 Jan 23 18:16 libzmq.pxd
-rwxr-xr-x 1 steam steam 105544 Jan 23 18:16 message.cpython-36m-x86_64-linux-gnu.so*
-rw-r--r-- 1 steam steam   2398 Jan 23 18:16 message.pxd
-rwxr-xr-x 1 steam steam  78904 Jan 23 18:16 _poll.cpython-36m-x86_64-linux-gnu.so*
drwxr-xr-x 2 steam steam   4096 Jan 23 18:16 __pycache__/
-rwxr-xr-x 1 steam steam 162176 Jan 23 18:16 socket.cpython-36m-x86_64-linux-gnu.so*
-rw-r--r-- 1 steam steam   2104 Jan 23 18:16 socket.pxd
-rwxr-xr-x 1 steam steam  49168 Jan 23 18:16 utils.cpython-36m-x86_64-linux-gnu.so*
-rwxr-xr-x 1 steam steam  35872 Jan 23 18:16 _version.cpython-36m-x86_64-linux-gnu.so*


The zmq in the system is installed and works correctly, but not work in sp.

If i use bad hack. Removing zmq from custom. Pre-load the plugin that adds the path for example:

Code: Select all

import sys
sys.path.append('/usr/local/lib/python3.6/site-packages')

It doesn't work either, same problem.
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Cannot install package zmq

Postby L'In20Cible » Wed Jan 23, 2019 6:58 pm

First result on SO propose to upgrade it:
I encountered a similar problem. pip install --upgrade pyzmq did the trick for me

Tried that?
User avatar
copyerfiled
Junior Member
Posts: 16
Joined: Wed Jan 23, 2019 9:40 am

Re: Cannot install package zmq

Postby copyerfiled » Wed Jan 23, 2019 8:38 pm

L'In20Cible wrote:First result on SO propose to upgrade it:
I encountered a similar problem. pip install --upgrade pyzmq did the trick for me

Tried that?

Yes of course.
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Cannot install package zmq

Postby Ayuto » Thu Jan 24, 2019 5:13 pm

Is your Python installation a 64 bit version? If so, pip installed the 64 bit version of zmq, but Source.Python requires it in 32 bit.
User avatar
copyerfiled
Junior Member
Posts: 16
Joined: Wed Jan 23, 2019 9:40 am

Re: Cannot install package zmq

Postby copyerfiled » Sat Jan 26, 2019 8:53 am

Ayuto wrote:Is your Python installation a 64 bit version? If so, pip installed the 64 bit version of zmq, but Source.Python requires it in 32 bit.

Thank you very much, you were right! I reinstalled Python x32 and the zmq module was able to be imported, with a few errors, but it works!
(apt install python3:i386)

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 27 guests