0

I have a shell script action that has the following command:

python /Users/my_name/Desktop/webbot/do_something.py

but I get the following error:

Traceback (most recent call last): File "/Users/my_name/Desktop/webbot/do_something.py", line 1, in <module> from webbot import Browser ImportError: No module named webbot

I've ran this python script manually and it works fine, but in Automator I keep hitting this error. Both pip and python versions are 3.6.

Edit:

The python script

python script

The shell script + traceback of error message shell script + traceback of error message

I have checked where pip installs my packages and webbot is with all the other ones. I tried importing other packages in the python script and running it in Automator and packages like matplotlib work fine.

5
  • The python script which works fine manually, is that running on Virtual Environment ? Commented Feb 7, 2021 at 7:15
  • No it’s just on my local machine. Commented Feb 7, 2021 at 8:53
  • Well, i could not reproduce this issue here. Its working fine. You need to give more information. Like share your python script and shell script Commented Feb 7, 2021 at 9:35
  • pip install webbot? Commented Feb 7, 2021 at 11:18
  • Yes that's what I used to install it in my terminal and is why it works when I run it manually from a terminal tab. But running it through Automator seems to be different. Even running pip install webbot in the shell script within Automator throws an error stating: command not found: pip Commented Feb 7, 2021 at 11:30

1 Answer 1

1

Turns out that Automator doesn't use python 3.6 by default and therefore it wasn't able to find the modules pip installed in the 3.6 folder. Following this link's answer Specify which version of Python runs in Automator? it shows how you specify to Automator which python version to use before then running the python script.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.