Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use command instead of locate #13

Open
EricDeveaud opened this issue Nov 15, 2019 · 4 comments
Open

use command instead of locate #13

EricDeveaud opened this issue Nov 15, 2019 · 4 comments

Comments

@EricDeveaud
Copy link

Hello,

you may want to use 'command' instead of locate in order to find the path of auxiliary binaries
command is posix and available on all unices.

locate is not always available, eg on our cluster it is not, and won't be.

@444thLiao
Copy link

maybe replace sh.locate with sh.find in phigaro/helper.py would fix your problem..

@EricDeveaud
Copy link
Author

nop find is not acceptable

to check for binaries, just check on the PATH

@snayfach
Copy link

snayfach commented Jul 12, 2020

$ phigaro-setup --no-updatedb
Traceback (most recent call last):
  File "/global/home/users/snayfach/.conda/envs/phigaro_env/bin/phigaro-setup", line 8, in <module>
    sys.exit(main())
  File "/global/home/users/snayfach/.conda/envs/phigaro_env/lib/python3.7/site-packages/phigaro/cli/helper.py", line 121, in main
    force=args.force,
  File "/global/home/users/snayfach/.conda/envs/phigaro_env/lib/python3.7/site-packages/phigaro/cli/helper.py", line 29, in create_config
    config = helper.setup()
  File "/global/home/users/snayfach/.conda/envs/phigaro_env/lib/python3.7/site-packages/phigaro/helper.py", line 160, in setup
    prodigal_params = self._setup_prodigal()
  File "/global/home/users/snayfach/.conda/envs/phigaro_env/lib/python3.7/site-packages/phigaro/helper.py", line 143, in _setup_prodigal
    raise_if_not_found=ProdigalNotFound.message,
  File "/global/home/users/snayfach/.conda/envs/phigaro_env/lib/python3.7/site-packages/phigaro/helper.py", line 123, in _find_binary
    '-b', '-r', '^{}$'.format(name)
  File "/global/home/users/snayfach/.conda/envs/phigaro_env/lib/python3.7/site-packages/phigaro/helper.py", line 117, in _locate
    return [s.rstrip() for s in sh.locate(*args, **kwargs)]
  File "/global/home/users/snayfach/.conda/envs/phigaro_env/lib/python3.7/site-packages/sh.py", line 3581, in __getattr__
    return self.__env[name]
  File "/global/home/users/snayfach/.conda/envs/phigaro_env/lib/python3.7/site-packages/sh.py", line 3378, in __getitem__
    raise CommandNotFound(k)
sh.CommandNotFound: locate

@444thLiao
Copy link

the command sh.locate rely on the binary file locate in your PATH. Maybe it doesn't install at your OS. @snayfach Just install it or replace sh.locate with sh.find

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants