2

enter image description here

Why I cant run this code? I already have zope.interface I have try update the path but still doesn't work, I don't know why. See the image above:

import paho.mqtt.client as mqtt
from twisted.internet import reactor, protocol
from txws import WebSocketFactory
import json
halfer
  • 19,824
  • 17
  • 99
  • 186
Akbar Pandu
  • 51
  • 1
  • 3

1 Answers1

1

If you installed with pip there's a good chance it broke the installation.

After installing the zope module using pip, for example: z3c.password, your zope installation breaks.

This is because pip installs the module in /usr/local/lib/python2.7/dist-packages/zope and the original module zope.interface is in /usr/share/pyshared/zope/interface/ and has minor relevance when importing.

To fix this I would try symlinking it like so:

cd /usr/local/lib/python2.7/dist-packages/zope
sudo ln -s /usr/share/pyshared/zope/interface/
Sam Gomena
  • 1,450
  • 11
  • 21
  • there is no directory **/usr/share/pyshared/zope/interface/** in my centos but **/usr/lib64/python2.7/site-packages/zope/interface/** is it same? i try but doesnt work – Akbar Pandu Mar 08 '17 at 08:18
  • Yes they're the same, you would cd to wherever/your/path/to/dist-packages/zope is and then sudo ln -s /usr/lib64/python2.7/site-packages/zope/interface/ – Sam Gomena Mar 09 '17 at 19:03
  • thanks, it works but i have new problem **importeror: no module named incremental** any suggest? – Akbar Pandu Mar 10 '17 at 11:36
  • Perhaps the same thing has happened with incremental? Can you see it in your `dist-packages/` folder or in `/usr/shared/pyshared/`? – Sam Gomena Mar 12 '17 at 00:23
  • All run normally after downgrade the twisted version, thanks – Akbar Pandu Mar 15 '17 at 06:01