2

I'm trying to develop software using Jython and SOCKS5, so I installed PySocks, but I'm receiving the following import error:

Jython 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_31
Type "help", "copyright", "credits" or "license" for more information.
>>> import socks
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "socks.py", line 117, in <module>
TypeError: Error when calling the metaclass bases
    function() argument 1 must be code, not str

How can I correctly use PySocks in Jython?

Dan Getz
  • 8,774
  • 6
  • 30
  • 64

2 Answers2

0

“The Jython project strives to make all Python modules run on the JVM, but there are a few differences between the implementations. Perhaps the major difference between the two implementations is that Jython does not work with C extensions. Therefore, most of the Python modules will run without changes under Jython, but if they use C extensions then they will probably not work.”

According to the jython doc, it seems jython doesn't support C entensions.

-1

you can install this lib by this cmd:

# sudo apt-get install python-socksipy

I found the response in :

How do I install Socks / SocksIPy on Ubuntu?

Community
  • 1
  • 1
khelili miliana
  • 3,730
  • 2
  • 15
  • 28