Python的问题
在ubuntu16.04上用下面的命令安装pip,可能会出现下面的问题
sudo apt-get install python-pip
刚开始发现虽然用pip install python-igraph安装了python-igraph,但是import的时候还是显示没有这个igraph,最后发现是pip的问题
bo@bo-FX80GD:~/Downloads$ python -m pip --version
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/bo/.local/lib/python2.7/site-packages/pip/__main__.py", line 21, in <module>
from pip._internal.cli.main import main as _main
File "/home/bo/.local/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
python2和python3都重新安装一下pip
wget https://bootstrap.pypa.io/3.5/get-pip.py
python get-pip.py
wget https://bootstrap.pypa.io/3.5/get-pip.py
python3 get-pip.py