그냥 tar.gz 패키지를 다운로드하고 python setup.py install
을 실행하여 oauth2를 설치했습니다.ImportError : oauth2 모듈이 없습니다.
PYTHOHPATH=$PYTHONPATH:/Users/me/Downloads/oauth2-1.5.211/
그러나 : 나는에 ~/.bashrc에이 라인을 추가 그러나 나는 OAuth2를 경로가 PYTHONPATH에이 오류
bash-3.2$ python
Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import oauth2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named oauth2
>>>
(그래서이 문제가되지 않을한다)을 받고 있어요 , 이렇게하면 :
bash-3.2$ cd /System/Library/Frameworks/Python.framework/Versions/2.7/
bash-3.2$ ls
Extras Headers Mac Python Resources _CodeSignature bin include lib
bash-3.2$ Python
Python 2.7.1 (r271:86882M, Nov 30 2010, 09:39:13)
[GCC 4.0.1 (Apple Inc. build 5494)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import oauth2
>>>
잘 작동합니다. 어떤 생각을 어떻게 oauth2 python
에서 ImportError 피하기 위해 설치해야합니까?
P/s의 :이 사용자가 설치 파이썬의 두 가지 버전이있는 것 같습니다 python
명령
python -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
패키지를 설치 한 경우'PYTHONPATH'를 수정할 필요가 없습니다. (또한 맞춤법 오류가 있지만 C & P 오류 일 수 있습니다.) – Julian
'python setup.py install'을 사용하여 다른 패키지를 설치할 수 있습니까? – Lenna