LoginSignup
0
3

More than 3 years have passed since last update.

conda-forgeのgeopandasをインストールするときは、チャネルプライオリティをstrictにする

Posted at

結論

チャネルプライオリティをstrictに設定してから、conda仮想環境を作成し、geopandasパッケージをインストールする。

$ conda config --set channel_priority strict

問題

conda-forgeのgeopandasを使用したい。
condaバージョン4.7で作成したconda仮想環境では、geopandasをインストールしてimportすると、ImportErrorが発生した。

$ conda --version
conda 4.7.12
$ conda config --get channels
--add channels 'defaults'   # lowest priority
--add channels 'conda-forge'   # highest priority
$ python -c "import geopandas"
ImportError: libpoppler.so.76: cannot open shared object file: No such file or directory

condaバージョン4.5で作成したconda仮想環境では、geopandasをインストールしてimportしてもエラーにならなかった。
condaバージョン4.7で作成したconda仮想環境では、geopandasをインストールしたときに、defaultsチャネルのfionaパッケージがインストールされてしまって、エラーになっているようだ。

解決

参考URL Using multiple channels

condaバージョン4.6から、チャネルプライオリティの設定方法が増えている。
チャネルプライオリティを strict に設定し、conda仮想環境を作り直したところ、エラーが発生しなくなった。

(base) $ conda config --add channels conda-forge
(base) $ conda config --set channel_priority strict

この設定のもと、作成したconda仮想環境では、エラーが発生しなくなった。

(base) $ conda create -n myenv2 python=3.6
(base) $ conda install -n myenv2 geopandas
(base) $ conda activate myenv2
(myenv2) $ python -c "import geopandas"
(myenv2) $
0
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
3