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 9006675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:28:34+00:00 2026-06-16T01:28:34+00:00

I am trying to implement a TCP server and using python script. So I

  • 0

I am trying to implement a TCP server and using python script. So I created a server.py on my desktop and imported the following modules:

from twisted.internet.protocol import Factory,Protocol

It’s already failing at that point, because if I run: python server.py, I got the following output:

Traceback (most recent call last):
  File "server.py", line 4, in <module>
    from twisted.internet.protocol import Factory,Protocol
ImportError: No module named twisted.internet.protocol

I also use sys.path to print my Python directories and I got these outputs:

['/Users/Alfred/Desktop',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages',
'/Library/Python/2.7/site-packages']

What could have gone wrong with my python setup?

Is it because of the privilege of my account? I logged in as the admin on this machine.

  • 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-06-16T01:28:35+00:00Added an answer on June 16, 2026 at 1:28 am

    Based on your sys.path, you’ve installed Python from python.org, or compiled your own, rather than using the built-in Python that has Twisted pre-installed. If you install your own Python, you have to install your own version of Twisted into that version of Python. You can use pip or easy_install or download directly from the Twisted site and run setup.py.

    type -p python in a shell will tell you which version you’re using; I suspect it will be in /usr/local/bin/.

    /usr/bin/python2.7 -c 'from twisted.internet.protocol import Factory,Protocol' ought to succeed. If not, then I don’t know what you’ve done to your sytem Python installation :).

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

Sidebar

Related Questions

I'm trying to implement a TCP connection, everything works fine from the server's side
After painstakingly trying to implement TCP file transfer in my conference chat application using
I am trying to implement a (T)LV protocol over TCP sending protocol buffers from
I am trying to implement a TCP echo server and client program in Ubuntu
I am trying to implement a minimal chat server in java over regular TCP
I am trying to implement my own remote desktop solution in java. Using sockets
I am trying to implemante a client- server program communication using TCP socket programming
I'm trying to implement a very simple proxy server with the following code. You
I am trying to implement a TCP server which is a part of a
I'm trying to implement TCP hole punching with windows socket using mingw toolchain. I

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.