Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7029983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:36:37+00:00 2026-05-28T00:36:37+00:00

Am getting the below error when executing python protocols/smpp/test/test_post_upgrade.py: Traceback (most recent call last):

  • 0

Am getting the below error when executing python protocols/smpp/test/test_post_upgrade.py:

Traceback (most recent call last):
  File "protocols/smpp/test/test_post_upgrade.py", line 1, in <module>
    from protocols.smpp.proto import *
  File "/tmp/Wass/protocols/smpp/proto.py", line 1, in <module>
    from twisted.internet import defer, reactor
ImportError: No module named internet

Here’s my tree:

/tmp/Wass$ tree
.
├── __init__.py
└── protocols
    ├── __init__.py
    ├── __init__.pyc
    └── smpp
        ├── __init__.py
        ├── __init__.pyc
        ├── proto.py
        ├── proto.pyc
        └── test
            ├── __init__.py
            └── test_post_upgrade.py

3 directories, 10 files

Here’s the content of the principal files:

/tmp/Wass$ cat protocols/smpp/proto.py
from twisted.internet import defer, reactor

/tmp/Wass$ cat protocols/smpp/test/test_post_upgrade.py 
from protocols.smpp.proto import *

/tmp/Wass$ cat protocols/smpp/__init__.py
__import__('pkg_resources').declare_namespace(__name__)

For information, i can resolve this issue by one of these actions:

  • Emptying protocols/smpp/__init__.py, but this is usefull for the whole project so i can just empty this file, my project will no more run ..
  • Renaming protocols/smpp to anything else, for example protocols/toto will work (with changing protocols/smpp/test/test_post_upgrade.py to from protocols.toto.proto import *

The second solution is so confusing as i dont have any smpp/proto.py in my system that can cause a conflict …

Here’s a simpler representation of the issue:

Wass/
Wass/__init__.py
Wass/protocols/
Wass/protocols/smpp/
Wass/protocols/smpp/__init__.py
Wass/protocols/smpp/test/
Wass/protocols/smpp/test/__init__.py
Wass/protocols/__init__.py

Wass/protocols/smpp/test/test_post_upgrade.py:
> from Wass.protocols.smpp.proto import SMPPClientProtocol

Wass/protocols/smpp/proto.py
> from twisted.internet import defer, reactor
>
> class SMPPClientProtocol:
>     pass

Execution outcome:

$ echo $PYTHONPATH
:/opt/smpp.twisted/:/opt/smpp.pdu/:/tmp/Wass/
python /tmp/Wass/protocols/smpp/test/test_post_upgrade.py
> Returns the same problem above
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:36:38+00:00Added an answer on May 28, 2026 at 12:36 am

    There are a number of potential issues here.

    1. Is Wass really supposed to be a package, or is it an entry on sys.path? If it’s really a package, you should be adding /tmp to your PYTHONPATH; if it’s a path entry, you should be adding /tmp/Wass to PYTHONPATH, and deleting /tmp/Wass/__init__.py*.
    2. Don’t run python on modules within a hierarchy directly. It confuses the issue.
    3. If Wass is going to continue to be a package (i.e. contain an __init__.py), you should adjust your imports to be from Wass.protocols.smpp.proto import ....
    4. Don’t use import *. It’s just confusing; someone reading your code has no idea what names are supposed to come from what module.
    5. Try to simplify this as much as possible, and upload a complete, runnable example of a set of files that causes the problem. Since I don’t know what’s inside those .py files, I have to guess at the cause.

    Ultimately I think that the problem you’re seeing is caused by the combination of a top-level module named protocols, which conflicts with several modules within Twisted, and the use of import * which is probably pulling in another name like basic or smtp or pop3 into that namespace and clashing with something, then the magic of namespace packages combines with it all to create an explosion. I can’t be more specific than that without seeing the actual code that triggers the problem :).

    Whenever faced with an issue like this though, it’s good to take a step back and make sure that the working directory, the script directory, and PYTHONPATH are all separated out so you know exactly how your code is being imported. Specifically, I’d recommend doing something like this:

    $ cd /tmp
    $ mkdir runstuff
    $ cd runstuff
    $ PYTHONPATH=/tmp/Wass trial protocols
    

    Hopefully that will work out better for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting the below error when executing my application on a Windows XP
I am getting the error below when I call my WCF service. What am
I have problem executing below stored procedure. I am getting error of ORA-00932: inconsistent
While executing the code below I am getting HTTP 500 Internal Server Error. public
I am executing a program in PHP and getting the below error sometimes.Is this
While executing the code below i am getting javascript error expected object though i
I was changing the vc++ include directory with new paths suddenly getting below error
i'm getting the below error, When compiling the Asp.Net web deploy project Could not
We are getting the error below calling c:\windows\syswow64\regsvr32.exe on Windows Server 2008 R2 x64.
I'm getting the error below for this SQL statement in VB.Net 'Fill in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.