'SAM CLI executable not found - Pycharm

I'm trying to configure PyCharm in order to run a Lambda Function.

First of all in AWS Toolkit I select the SAM CLI executable, and it goes well: enter image description here

Anyway, when I want to add a Lambda run configuration pycharm says: Invalid sam executable: "The system couldn't find the specific route." enter image description here

My system PATH variable: enter image description here

Someone could help me here please, I really don't know what else to do.

Many thanks! Xevi



Solution 1:[1]

Actually, I encountered same problem and solved as following;

I assume that you use mac and write in terminal this;

which sam

This gives you the path where sam installed.

Then copy this and paste into sam cli executable path like below;

enter image description here

Solution 2:[2]

To help people like me: which sam should give a path to the SAM executable, like: /opt/homebrew/bin/sam

Then in Pycharm, open preferences (?,) Tools -> AWS, the the first input field should be 'SAM CLI Executable'.Or Put 'SAM' (uppercase) in the settings search bar.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tuncay Elvanağaç
Solution 2 Doha Simon