3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

networkxでバージョン問題が出たのでメモ

Last updated at Posted at 2020-07-13

networkxでバージョン問題が出たのでメモ

・networkは環境依存しているモジュールがあり、バージョンにより関数が見つからずエラーを吐いてしまうので、解決方法を書いておくことにしました。

環境

python 3.7.7

anaconda 4.8.3

os1 windows10

os2 ubuntu 18.04

networkx 2.4

# 問題となった関数

nx.connected_component_subgraphs(G)

nx.draw(SG)

自分は、今回この二つの関数でエラーが出てしまった。 # 解決方法 コマンドプロンプトもしくは、ターミナルから
pip install networkx==2.3

を実行しバージョンを下げることでエラーを回避することができた。

ubuntuとwindow両方で動作を確認できたため、networkx側の問題だと考えられる。

考察

networkxのstable版が公開されたのが約半年前のため、大きな問題があればstable版を2.3に戻していると考えられるので、
代替えになる関数が用意されていると考えたが特に見つけることができなかった。

3
0
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
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?