'Code from github clone doesn't search in right local repository and ModuleNotFoundError on MacOS

Very basic question. I am completely new to github and I see that similar questions have been asked but they don't seem to solve my problem.

I have tried downloading the following github repository https://github.com/chrsmrrs/k-gnn (I only want the code working locally on my machine). I used git clone https://github.com/chrsmrrs/k-gnn.git to download the contents of the github repository on locally so I can run some other code for which this package is necessary. I then went through the installation steps of this github repository and ran python setup.py install in the root directory of the git clone I made. When I tried to test the code, I typed in the following in command line as suggested in the github repo:

cd examples
python 1-2-3-proteins.py

However I get the following response from the command line terminal on my mac.

Traceback (most recent call last):
  File "/Users/Tom/Documents/300. MASTERS/MASTERS/THESIS/CODE/k-gnn/examples/1-2-3-proteins.py", line 18, in <module>
    from k_gnn import DataLoader, GraphConv, avg_pool
ModuleNotFoundError: No module named 'k_gnn'

However, as far as I understand my sys.path is not looking for the module k_gnn as I did the following experiment

print(type(sys.path))
i = 1
for path in sys.path:
    print(i)
    print(path)
    i += 1

and got the following response

1
/Users/Tom/Documents/300. MASTERS/MASTERS/THESIS/CODE/k-gnn/examples
2
/usr/local/anaconda3/envs/gnn-test-env/lib/python39.zip
3
/usr/local/anaconda3/envs/gnn-test-env/lib/python3.9
4
/usr/local/anaconda3/envs/gnn-test-env/lib/python3.9/lib-dynload
5
/usr/local/anaconda3/envs/gnn-test-env/lib/python3.9/site-packages

As you can see it does search in /Users/Tom/Documents/300. MASTERS/MASTERS/THESIS/CODE/k-gnn/examples but not in /Users/Tom/Documents/300. MASTERS/MASTERS/THESIS/CODE/k-gnn where k-gnn is located. Is this due to my faulty download of the git repository or is this a fault of the code? If it's the former any help/reading material would be appreciated.

Thanks in advance for the help and let me know if anything is unclear.

KR, Tom



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source