m0ss
m0ss

Reputation: 462

Cannot install stellargraph

I am trying to install stellargraph package. I created a new conda environment with python 3.6 and tried to install it with pip install stellargraph but when I try to write import stellargraph in jupyter, it says ModuleNotFoundError: No module named 'stellargraph'.

I also tried it with PyCharm to create a new conda enironment with python 3.6 and then use its package manager to install stellargraph. It installs successfully but when I import it, I get this error:

Traceback (most recent call last):
  File "/home/hossein/Desktop/Univ/Computer/10th/Network/Project/pycharm/main.py", line 1, in <module>
    import stellargraph
  File "/home/hossein/anaconda3/envs/pycharm/lib/python3.6/site-packages/stellargraph/__init__.py", line 39, in <module>
    from stellargraph import (
  File "/home/hossein/anaconda3/envs/pycharm/lib/python3.6/site-packages/stellargraph/data/__init__.py", line 26, in <module>
    from .loader import from_epgm
  File "/home/hossein/anaconda3/envs/pycharm/lib/python3.6/site-packages/stellargraph/data/loader.py", line 23, in <module>
    from stellargraph.data.epgm import EPGM
  File "/home/hossein/anaconda3/envs/pycharm/lib/python3.6/site-packages/stellargraph/data/epgm.py", line 24, in <module>
    import chardet
ModuleNotFoundError: No module named 'chardet'

Upvotes: 1

Views: 1331

Answers (1)

AKX
AKX

Reputation: 169308

This is apparently a known packaging bug in the library; it inadvertently imports chardet but doesn't actually use it.

To work around this, install chardet by hand too: pip install chardet.

(It's likely that this is just an oversight caused by the fact that chardet did generally get installed with requests before they switched to charset-normalizer; chardet was used in some commented-out code in stellargraph.)

This has been fixed in this (unrelated) commit that hasn't been released yet.

Upvotes: 4

Related Questions