Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to import from smpp.twisted.client #11

Open
sbilly-qmedic opened this issue Dec 15, 2016 · 6 comments
Open

Unable to import from smpp.twisted.client #11

sbilly-qmedic opened this issue Dec 15, 2016 · 6 comments

Comments

@sbilly-qmedic
Copy link

Hello,

For some reason, I can't get past the third line (import from smpp.twisted.client). Here is the stacktrace:

Traceback (most recent call last):
  File "test.py", line 3, in <module>
    from smpp.twisted.client import SMPPClientTransceiver, SMPPClientService
  File "/usr/local/lib/python2.7/site-packages/smpp/twisted/client.py", line 21, in <module>
    from smpp.twisted.protocol import SMPPClientProtocol, DataHandlerResponse
  File "/usr/local/lib/python2.7/site-packages/smpp/twisted/protocol.py", line 21, in <module>
    from smpp.pdu.operations import *
  File "/usr/local/lib/python2.7/site-packages/smpp/pdu/operations.py", line 16, in <module>
    from smpp.pdu.pdu_types import CommandId, PDU, PDURequest, PDUResponse, PDUDataRequest
  File "/usr/local/lib/python2.7/site-packages/smpp/pdu/pdu_types.py", line 20, in <module>
    CommandId = Enum(*constants.command_id_name_map.keys())
TypeError: __call__() takes at most 6 arguments (28 given)

I think the issue may come from the enum module? I have pyOpenSSL (v0.13), enum (v0.4.6), Twisted (v16.6.0), smpp.pdu (v0.3), and smpp.twisted (v0.4) installed.

Not sure why it would fail, though?

@prem-narain
Copy link

Are you using virtual environment ?

@sbilly-qmedic
Copy link
Author

Yes, actually - I tried to set it up on an Amazon EC2 instance. Is this a known issue with the Enum module and virtual environments, by any chance?

@gagandce
Copy link

gagandce commented Jun 2, 2017

I am having the same issue. Is there a fix for this ?
Actually I am surprised that using virtual environment will break Enum ???

@davidjmorris
Copy link

I have the same issue using python 2.7.12
I think this happens because smpp.twisted required enum
PyOpenSSL requires enum34 and this clashes with enum
smpp.twisted requires PyOpenSSL so then we have a clash between enum and enum34

@mexicarne
Copy link

I tried to remove enum34 and leave enum alone. Getting the following error

Traceback (most recent call last):
  File "tw-smpp.py", line 2, in <module>
    from twisted.internet import reactor, defer
  File "/somedir/smpp2/lib/python2.7/site-packages/twisted/internet/reactor.py", line 38, in <module>
    from twisted.internet import default
  File "/somedir/smpp2/lib/python2.7/site-packages/twisted/internet/default.py", line 56, in <module>
    install = _getInstallFunction(platform)
  File "/somedir/smpp2/lib/python2.7/site-packages/twisted/internet/default.py", line 48, in _getInstallFunction
    from twisted.internet.pollreactor import install
  File "/somedir/smpp2/lib/python2.7/site-packages/twisted/internet/pollreactor.py", line 25, in <module>
    from twisted.internet import posixbase
  File "/somedir/smpp2/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 18, in <module>
    from twisted.internet import error, udp, tcp
  File "/somedir/smpp2/lib/python2.7/site-packages/twisted/internet/tcp.py", line 28, in <module>
    from twisted.internet._newtls import (
  File "/somedir/smpp2/lib/python2.7/site-packages/twisted/internet/_newtls.py", line 21, in <module>
    from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
  File "/somedir/smpp2/lib/python2.7/site-packages/twisted/protocols/tls.py", line 41, in <module>
    from OpenSSL.SSL import Error, ZeroReturnError, WantReadError
  File "/somedir/smpp2/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/somedir/smpp2/lib/python2.7/site-packages/OpenSSL/crypto.py", line 12, in <module>
    from cryptography import x509
  File "/somedir/smpp2/lib/python2.7/site-packages/cryptography/x509/__init__.py", line 8, in <module>
    from cryptography.x509.base import (
  File "/somedir/smpp2/lib/python2.7/site-packages/cryptography/x509/base.py", line 16, in <module>
    from cryptography.x509.extensions import Extension, ExtensionType
  File "/somedir/smpp2/lib/python2.7/site-packages/cryptography/x509/extensions.py", line 24, in <module>
    from cryptography.x509.general_name import GeneralName, IPAddress, OtherName
  File "/somedir/smpp2/lib/python2.7/site-packages/cryptography/x509/general_name.py", line 18, in <module>
    from cryptography.x509.name import Name
  File "/somedir/smpp2/lib/python2.7/site-packages/cryptography/x509/name.py", line 28, in <module>
    _ASN1_TYPE_TO_ENUM = dict((i.value, i) for i in _ASN1Type)
TypeError: 'type' object is not iterable

Python version is 2.7.14, pip freeze is

asn1crypto==0.24.0
attrs==17.4.0
Automat==0.6.0
cffi==1.11.4
constantly==15.1.0
cryptography==2.1.4
enum==0.4.6
hyperlink==18.0.0
idna==2.6
incremental==17.5.0
ipaddress==1.0.19
pycparser==2.18
pyOpenSSL==17.5.0
six==1.11.0
smpp.pdu==0.3
smpp.twisted==0.4
sqlite3==0.0.0
Tkinter==0.0.0
Twisted==17.9.0
zope.interface==4.4.3

@georgiana-gligor
Copy link

I'm getting the same error. Removed enum34 with no success.
Has anyone been past this point?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants