Closed StefanBloemheuvel closed 5 years ago
It seems like you're running an older version of linkpred with a newer version of networkx. Can you upgrade linkpred like this? That should solve the problem you're encountering.
$ pip install --upgrade linkpred
hmm, i upgraded but now i can't get the linkpred --help command running. i should be in /anaconda3/lib/linkpred/ right? going to /anaconda/lib/python3.7/site-packages/linkpred/ won't work either. I am also quite new to using the command line (normally work in python and r) so if i am missing something crucial let me know! thanks for the help in advance!
Hi Stefan, the linkpred executable should be located in the directory for Python executables on your system/environment. Where exactly that is depends on your system and Python installation. Judging by the traceback you posted earlier, it seems like it should be here: /Users/stefan/anaconda3/bin/linkpred
.
Can you run /Users/stefan/anaconda3/bin/linkpred --help
for instance?
Closing for now. Please reopen if this issue is not resolved.
Hi Rafguns,
I get an error when trying to run linkpred from the mac terminal. The errors says: object of type generator has no len().
the complete error is this:
Stefans-MacBook-Air:lib stefan$ linkpred /Users/stefan/linkprediction/network1.graphml -p SimRank --output recall-precision 14:50:06 - INFO - Reading file '/Users/stefan/linkprediction/network1.graphml'... 14:50:06 - INFO - Successfully read file. 14:50:06 - INFO - Starting preprocessing... Traceback (most recent call last): File "/Users/stefan/anaconda3/bin/linkpred", line 64, in
main()
File "/Users/stefan/anaconda3/bin/linkpred", line 57, in main
linkpred.preprocess()
File "/Users/stefan/anaconda3/lib/python3.7/site-packages/linkpred/linkpred.py", line 169, in preprocess
self.training = preprocessed(self.training)
File "/Users/stefan/anaconda3/lib/python3.7/site-packages/linkpred/linkpred.py", line 163, in
without_selfloops(G), minimum=self.config['min_degree'])
File "/Users/stefan/anaconda3/lib/python3.7/site-packages/linkpred/preprocess.py", line 85, in without_selfloops
"Removing...".format(len(loops)))
TypeError: object of type 'generator' has no len()
Stefans-MacBook-Air:lib stefan$
Do you perhaps know what i am doing wrong here?
Kind regards,
Stefan Bloemheuvel