I have two versions of python, /usr/bin/python
(version 2.7.10 in MacOS ) & /usr/local/bin/python
(version 2.7.13 installed via brew
).
I use pip
(installed by brew install python
)to install a module protobuf
!
but /usr/bin/python
cannot find the module protobuf
,whereas the /usr/local/bin/python
could find it.
how can I make the /usr/bin/python
to find the module
update
@RNB
according to the installation, sudo python get-pip.py
I have errors like
:Collecting pip
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 640kB/s
Collecting wheel
Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
100% |████████████████████████████████| 71kB 6.3MB/s
Installing collected packages: pip, wheel
Found existing installation: pip 8.1.2
Uninstalling pip-8.1.2:
Successfully uninstalled pip-8.1.2
Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
File "/tmp/tmpW2v8kJ/pip.zip/pip/basecommand.py", line 215, in main
.....
File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 235, in _compile
cachekey = (type(key[0]),) + key
RuntimeError: maximum recursion depth exceeded while calling a Python object
solution
according to @RNB's advice, first clean all pip
packages,uninstall brew python+pip, install pip
for sys's python by python get-pip.py
, maybe it gives error with wheel
, so set options --no-setuptools
&--no-wheel
for python get-pip.py
,install or upgrade setuptools
& wheel
via pip
.At last install protobuf
,problem solved!