I have a problem that started by trying to execute
some_aws_command = 'aws s3 <do some stuff>' # the real command has been purposefully obfuscated but that doesn't matter here
subprocess.Popen(some_aws_command.split()).wait()
Which resulted in a weird error:
FileNotFoundError: [Errno 2] No such file or directory: 'aws'
After some digging, I found that through the execution environment (I'm using PyCharm's run functionality) there's no longer access to the aws
cli executable.
The following code behaves differently from the terminal than from PyCharm's Run:
import shutil
shutil.which('aws')
Via the terminal it returns the expected path - '/usr/local/bin/aws'
, but via PyCharm's Run, it just returns None
. This was working previously, and I can't figure out what change caused the break.
Any ideas on how to get it to work again?