I recently found the Twisted python library and was trying to set it up with a test script.
from twisted.internet.protocol import Protocol, Factory
from twisted.internet import reactor
self.transport.write("HTTP/1.0 200 OK\r\nContent-Length: 5\r\n\r\nPong!\r\n")
# Start the reactor
factory = Factory()
factory.protocol = Pong
AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'
OP_NO_TLSv1_1 is an attribute in pyOpenSSL. This means your version of pyOpenSSL is too old.
pip install -U pyopenssl or
pip install twisted[tls] should resolve this, but I'd highly recommend doing all of this in a virtual environment if you aren't already.