Win環境下Pycharm安裝igraph
準備在Pycharm的venv裡面安裝python-igraph,直接通過IDE安裝很有可能遇到如下錯誤:
If the compilation fails and you are sure that igraph is installed on your machine, adjust the following two variables in setup.py accordingly and try again: - LIBIGRAPH_FALLBACK_INCLUDE_DIRS - LIBIGRAPH_FALLBACK_LIBRARY_DIRS Continuing in 10 seconds; press Enter to continue immediately. Traceback (most recent call last): File "<string>", line 1, in <module> File "C:UserseikeAppDataLocalTemppycharm-packagingpython-igraphsetup.py", line 886, in <module> setup(**options) File "C:UserseikePycharmProjects est2venvlibsite-packagessetuptools\__init__.py", line 129, in setup return distutils.core.setup(**attrs) File "C:Python27Libdistutilscore.py", line 151, in setup dist.run_commands() File "C:Python27Libdistutilsdist.py", line 953, in run_commands self.run_command(cmd) File "C:Python27Libdistutilsdist.py", line 972, in run_command cmd_obj.run() File "C:UserseikePycharmProjects est2venvlibsite-packagessetuptoolscommandinstall.py", line 61, in run return orig.install.run(self) File "C:Python27Libdistutilscommandinstall.py", line 563, in run self.run_command(build) File "C:Python27Libdistutilscmd.py", line 326, in run_command self.distribution.run_command(command) File "C:Python27Libdistutilsdist.py", line 972, in run_command cmd_obj.run() File "C:Python27Libdistutilscommanduild.py", line 127, in run self.run_command(cmd_name) File "C:Python27Libdistutilscmd.py", line 326, in run_command self.distribution.run_command(command) File "C:Python27Libdistutilsdist.py", line 972, in run_command cmd_obj.run() File "C:UserseikeAppDataLocalTemppycharm-packagingpython-igraphsetup.py", line 578, in run buildcfg.use_educated_guess() File "C:UserseikeAppDataLocalTemppycharm-packagingpython-igraphsetup.py", line 777, in use_educated_guess rlist, _, _ = select([sys.stdin], [], [], 1) select.error: (10038, )
Google搜索一圈後,解決方案如下:
1. 下載安裝包
從https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-igraph下載安裝包
如果是python2.7版本下載python_igraph-0.7.1.post6-cp27-none-win32.whl
如果是python3.5版本下載python_igraph-0.7.1.post6-cp35-none-win32.whl
2. 打開cmd命令行界面,激活venv
cd <ProjectPath>venvScriptsactivate.bat
其中ProjectPath為工程所在目錄
3. 安裝Python-igraph
#python2.7venvScriptspip.exe <DownloadPath>python_igraph-0.7.1.post6-cp27-none-win32.whl#python3.5venvScriptspip.exe <DownloadPath>python_igraph-0.7.1.post6-cp35-none-win32.whl
enjoy~
推薦閱讀:
※ELEMENTARY.03.First Word
※十分鐘入門pandas(下)【解讀pandas官方文檔】
※相比於 Django、Pylon 等 Python 框架,Ruby on Rails 是否有很大的技術優勢?
※從零基礎開始一步步用python製作遊戲外掛!
※pandas筆記(一)——入門