question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`sh: 1: [COMMAND]: not found` when executing command

See original GitHub issue

I’m running into these errors on Debian 11

copilot show history
>  history
    execute
    copy
    explain shell

execute :

sh: 1: history: not found

copy :

> history
> copied
Traceback (most recent call last):
  File "/home/[USER]/.local/bin/copilot", line 8, in <module>
    sys.exit(main())
  File "/home/[USER]/.local/lib/python3.9/site-packages/copilot/copilot.py", line 95, in main
    subprocess.run(["pbcopy"], input=cmd, encoding="utf-8")
  File "/usr/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'pbcopy'

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
JoelKronandercommented, Dec 16, 2022

Awesome!

0reactions
MostHatedcommented, Dec 16, 2022

I put together a pull request for this change here: https://github.com/Methexis-Inc/terminal-copilot/pull/19

Read more comments on GitHub >

github_iconTop Results From Across the Web

Shell script not running, command not found
Is the location of MigrateNshell.sh in your PATH ? If trying to run it from the current directory, try ./MigrateNshell.sh . – Anders...
Read more >
sh: 1: program not found
The solution to that is to give the full path to the program, or make sure it's in the scripts PATH . Though...
Read more >
How to fix a "Command not found" error in Linux
5 ways to fix "Command not found" errors · 1. Include the path · 2. Add a new path · 3. Copy a...
Read more >
Troubleshooting "Bash: Command Not Found" Error in Linux
Fixing “bash: command not found” error · Method 1: Double check the command name (no, seriously) · Method 2: Ensure that the command...
Read more >
Linux / UNIX: Command Not Found Error and Solution
It means either program is not installed or PATH variable in your environment is not pointing to it. Learn how to fix command...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found