2017-03-08 10 views
2

enter image description here는 "ImportError를 : 없음 모듈 이름 zope.interface"하지만 난 이미 내를 CentOS 나는이 코드를 실행 캔트 왜 7

에 설치되어 있습니까? 나는 이미 zope.interface를 가지고있다. 경로를 업데이트하려고 시도했지만 여전히 작동하지 않는다. 왜 그런지 모르겠다. 위의 이미지를 참조하십시오.

import paho.mqtt.client as mqtt 
from twisted.internet import reactor, protocol 
from txws import WebSocketFactory 
import json 

답변

1

핏으로 설치 한 경우 설치가 잘못되었을 수 있습니다.

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.

는이 문제를 해결하려면 나는 그렇게처럼 심볼릭 링크하려고 할 것입니다 :

cd /usr/local/lib/python2.7/dist-packages/zope 
sudo ln -s /usr/share/pyshared/zope/interface/ 
+0

에는 디렉토리 **는/usr/share/pyshared/조프/인터페이스/** 내 CentOS는뿐만 없다 **/usr/lib64/python2.7/site-packages/zope/interface/** 같은가요? 나는 시도하지만 doesnt 일 –

+0

나는 벌써 링크를 만들지 만 여전히 일하지 않는다, 어떤 제안? –

+0

예 그들은 동일합니다./your/path/to/dist-packages/zope이 어디에 있는지 cd 한 다음 sudo ln -s /usr/lib64/python2.7/site-packages/zope/interface/ –