Closed scottlittle closed 2 years ago
I had an issue with numpy and gensim for chapter 3 (first chapter that I ran examples). This was the error specifically:
numpy
gensim
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject "gensim"
My solution was to use a conda environment. I set up an environment.yml file as below
environment.yml
name: packt_graphml_env channels: - conda-forge - defaults dependencies: - python==3.8.* - pip - ipykernel - pandas - gensim==3.8.3 - numpy==1.19.5 - networkx==2.5.* - matplotlib==3.2.* - node2vec==0.3.* - karateclub==1.0.* - scipy==1.6.* - tensorflow==2.4.1 - scikit-learn==0.24.* - stellargraph::stellargraph - pip: #- "--editable=git+https://github.com/stellargraph/stellargraph.git#egg=stellargraph" - "--editable=git+https://github.com/palash1992/GEM.git#egg=GEM"
and install/update with: mamba env update -f environment.yml
mamba env update -f environment.yml
Of course, replace mamba with conda if you don't have mamba. And I added ipykernel for a Jupyter kernel, which was already installed in my base conda environment.
mamba
conda
ipykernel
base
Hope this helps someone.
I had an issue with
numpy
andgensim
for chapter 3 (first chapter that I ran examples). This was the error specifically:My solution was to use a conda environment. I set up an
environment.yml
file as belowand install/update with:
mamba env update -f environment.yml
Of course, replace
mamba
withconda
if you don't havemamba
. And I addedipykernel
for a Jupyter kernel, which was already installed in mybase
conda environment.Hope this helps someone.