[英]python script ImportError: No module named 'webbot' when running shell script in Automator
[英]importError in Automator while running Python 3 script in shell /bin/bash
我正在嘗試使用 shell /bin/bash 將我的 python3 腳本添加到 Automator,但不斷收到錯誤消息:
"ImportError: No module named watchdog.observers”"
我認為這是因為它運行 Python 2 而不是 3。在互聯網上搜索后,我想出了以下./bash_profile 和 shebang 行,但它似乎仍然不起作用。 這就是我對自動機感到厭倦的地方:
然后當我運行 Automator 時,我收到以下錯誤消息:
為什么我會收到導入錯誤,我該如何解決?
好的,那我解決了。 在 Automator (shell /bin/bash) 中,我做了:
/Users/username/Documents/categorize_downloads.py
在此之前,我對要運行的文件具有更改權限,因此:
chmod 755 filename
最后我將shebang更改為:
#!/usr/local/bin/python3
似乎可以使用“env python3”代替,但在這種情況下,我必須刪除“env”。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.