티스토리 뷰
$ which python
/usr/bin/python
$
$ python
Python 2.7.10 (default, Feb 7 2017, 00:08:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named gi
>>>
a1000990:/usr/lib/python2.7$ cd /usr/lib/python2.7/
a1000990:/usr/lib/python2.7$ ls gi
ls: gi: No such file or directory
$ cd /usr/local/bin/
$ ls python
python2 python2.7-config python3.6 python3.6m-config
python2-config python3 python3.6-config pythonw2
python2.7 python3-config python3.6m
/usr/local/lib폴더로 가보자. 역시나 gi 라이브러리는 여기에 설치가 되었구나.
그래서, 기본적으로 PATH설정시 /usr/local/bin을 우선순위를 높게 준다. ex) PATH=/usr/local/bin:/usr/bin
$ cd /usr/local/lib/python2.7/site-packages/
$ ls gi/
__init__.py _gi_cairo.so docstring.py pygtkcompat.py
_constants.py _option.py importer.py repository
_error.py _propertyhelper.py module.py types.py
_gi.so _signalhelper.py overrides
$
$ export PATH=/usr/local/bin:$PATH
'Back-ends > python' 카테고리의 다른 글
정규식 (Regular Expression) (0) | 2018.12.30 |
---|---|
Python 가상환경 (0) | 2018.09.12 |