rafguns / linkpred

Easy link prediction tool
Other
140 stars 46 forks source link

Error when clling linkpred in linux #22

Closed YasCoMa closed 5 years ago

YasCoMa commented 5 years ago

I am trying to use it but when I call, it shows the following error: /usr/bin/env: ‘python\r’: No such file or directory

rafguns commented 5 years ago

Thanks for the report!

Did you install with pip? It seems that this is not an issue in the GitHub repo but just with the package on PyPI, caused by preparing it on Windows sigh. I'll look into better ways of preparing packages.

If you need it urgently, you can probably fix manually for now by finding the linkpred executable and fixing line endings (e.g., with dos2unix).

YasCoMa commented 5 years ago

Yes, I've installed with pip. But I have to do this command (dos2unix) for every file?

rafguns commented 5 years ago

I cannot easily test this at the moment but I think this just needs to happen for the linkpred executable script. You should be able to locate it with which linkpred (I think).

rafguns commented 5 years ago

To properly solve this, the best way is probably to let Travis deploy to PyPI.

YasCoMa commented 5 years ago

I did this for the executable linkpred...The python module worked but the command on terminal gives the following error: ImportError: No module named linkpred.cli

rafguns commented 5 years ago

Ouch, sorry about the trouble! I'll get my hands on a Linux box and figure out what the problem is.

rafguns commented 5 years ago

As far as I can see, the problem may arise if multiple Python versions (or environments) are installed. I encounter this on Ubuntu when linkpred is installed using Python3/pip3, but #!/usr/bin/env python resolves to Python 2.7. Changing it to #!/usr/bin/env python3 solves the problem for my case but would cause problems for someone who installed linkpred in Python 2...

The best way to solve all this, including the original problem, is probably to start using the console_scripts entry point. I will work on that soon, unless someone else wants to take a crack at it first. If so, please comment here.

rafguns commented 5 years ago

Fixed in ce33b09.

rafguns commented 5 years ago

I just released version 0.4, which contains the fix.

@YasCoMa Can you verify that this works on your end? You should be able to upgrade by running

pip install --upgrade linkpred

Thanks!

rafguns commented 5 years ago

As far as I can tell, this is fixed. Feel free to reopen if this still pops up.