Discussion Forum

ModuleNotFoundError

Running the python migration script, using Grakn Core version 1.5.0 I encounter the error: ModuleNotFoundError: No module named ‘grakn.client’. Any work around this? I have python installed alright

1 Like

@mchipeta

which migration script are you running?

Have you updated your Python client to the latest version? https://pypi.org/project/grakn-client/
You will need it to work with Grakn 1.5

Thanks @Marco, I have updated Python client to the latest version but still have the error preventing migrator to run

@mchipeta

have you updated the import statement and the APIs?
you can check how to use the new version of the client here http://dev.grakn.ai/docs/client-api/python

@Marco, thats also up to date and am using the latest version of the client as per the website you provided here

Can you check if grakn-client is installed by running pip show grakn-client. If grakn-client isn’t found, please run pip install grakn-client. I suspect you may have installed an older version that was previously named grakn.

I’m having this same problem and tried every solution listed in the answers here.

When I use pip show grakn-client, I get the following results:

Name: grakn-client
Version: 1.5.4
Summary: Grakn Client for Python
Home-page: https://github.com/graknlabs/grakn/tree/master/client-python
Author: Grakn Labs
Author-email: community@grakn.ai
License: Apache-2.0
Location: /usr/local/lib/python3.7/site-packages
Requires: protobuf, grpcio, six, enum-compat
Required-by:

Server is running, yet when I do from grakn.client import GraknClient I get a ModuleNotFoundError: No module named 'grakn'

Please help

Hi - do you mind running python --version to see that the pip install (which apepars to have installed for python3) matches the python version you are running?

python --version
Python 3.7.3

How about running

python -m pip list

tip: if you use backticks (`) you can do inline code blocks and triple backticks (```) can do blocks like above

I changed my Java version to 8, by taking the following steps:

  1. Making the following edit to my bash profile:
    export JAVA_HOME=/usr/libexec/java_home -v 1.8

  2. Source and check that I have the correct version of java
    source .bash_profile
    java -version

  3. Reinstalled grakn
    brew tap graknlabs/tap
    brew install graknlabs/tap/grakn-core
    brew reinstall grakn-core

  4. Started server
    grakn server start

  5. Installed grakn-client again with pip
    pip install grakn-client

And then ran from grakn.client import GraknClient in a Jupyter Notebook and it worked, thank you so much!