2013-10-20 2 views
2

나는 cefpython의 64 비트 패키지를 우분투 12.04 LTS (http://code.google.com/p/cefpython/)에 설치했습니다. 문제는 예제를 실행할 수 없다는 것입니다. wx라는 모듈이 없다고합니다. 그러나 /usr/local/lib/python2.7/dist-packages/cefpython1 디렉토리로 이동하여 wx를 가져 오면 작동합니다. 기본적으로 wx를 해당 디렉토리 외부로 가져올 수 없습니다. 터미널에서 파이썬 인터프리터를 사용하고 있습니다. cefpython의 설치 64 비트 패키지를 우분투 12.04 LTS (http://code.google.com/p/cefpython/) :설치 디렉토리 안에 파이썬 모듈을 가져올 수 있습니다.

rishi:cefpython1 ls 
cefclient   cefpython_py27.pyc chrome.pak    examples  __init__.pyc LICENSE.txt wx 
cefpython_py27.py cefpython_py27.so devtools_resources.pak __init__.py libcef.so  locales 
rishi:cefpython1 python 
Python 2.7.3 (default, Sep 26 2013, 20:03:06) 
[GCC 4.6.3] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import wx 
>>> 
[2]+ Stopped     python 
rishi:cefpython1 cd .. 
rishi:dist-packages python 
Python 2.7.3 (default, Sep 26 2013, 20:03:06) 
[GCC 4.6.3] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import wx 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named wx 
>>> 
KeyboardInterrupt 
>>> 

내 PATH는 다음과 PYTHONPATH가 비어 같습니다. 문제는 예제를 실행할 수 없다는 것입니다. wx라는 모듈이 없다고합니다. 하지만 /usr/local/lib/python2.7/dist-packages/cefpython1 디렉토리로 이동하여 wx를 가져 오면 작동합니다. 기본적으로 wx를 해당 디렉토리 외부로 가져올 수 없습니다. 터미널에서 파이썬 인터프리터를 사용하고 있습니다. 여기

rishi:dist-packages echo $PATH 
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games 
rishi:dist-packages echo $PYTHONPATH 

rishi:dist-packages echo $PYTHONPATH 

rishi:dist-packages 
+0

'PATH'와'PYTHONPATH'는 어떻게 생겼습니까? –

+0

@SnakesandCoffee가 업데이트되었습니다. PYTHONPATH가 비어 있습니다. – rishiag

+0

내 PYTHONPATH도 비어 있으며 예제가 제대로 작동합니다. Ubuntu Software Center를 통해 "python-wxtools"패키지를 설치하여 wx 라이브러리를 설치했습니다. 시도해 볼 수 있습니다. –

답변

1

귀하의 문제는 파이썬 당신이에서 가져 아무 생각이없는 것입니다. 지침은 This post을 참조하십시오. 기본적으로, 당신이 디렉토리에있을 때, 파이썬은 그것을 찾는다 (디렉토리에서 파이썬 파일과 패키지를 찾는다). Python 라이브러리를 PYTHONPATH에 추가해야합니다.