1. 程式人生 > >[Python3.6/pip/安裝一些模組出現的常見問題]

[Python3.6/pip/安裝一些模組出現的常見問題]

本機環境:

作業系統:Mac OS
Python版本:Python3.6
pip版本:pip3.6

當我嘗試去安裝 python-memcache的時候就會出現一些奇怪的問題

pip3 install python-memcached

Collecting python-memcached
Using cached python-memcached-1.58.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File “”, line 1, in
File “/private/var/folders/lj/lzh02v9s14vbcn90m2qc5x600000gn/T/pip-build-aekw3i_w/python-memcached/setup.py”, line 8, in
version=get_module_constant(‘memcache’, ‘version

‘),
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/depends.py”, line 164, in get_module_constant
return extract_constant(code, symbol, default)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/depends.py”, line 195, in extract_constant
const = code.co_consts[arg]
IndexError: tuple index out of range

----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in /private/var/folders/lj/lzh02v9s14vbcn90m2qc5x600000gn/T/pip-build-aekw3i_w/python-memcached/

這個報錯資訊雖然比較發雜最後都 出現了索引問題 但是這個問題 真的很常見

解決方法:

pip3.   install --upgrade setuptools