ModuleNotFoundError: No module named 'workflow' #1

Closed
opened 2025-01-21 07:05:03 +11:00 by SandraCHC · 4 comments
SandraCHC commented 2025-01-21 07:05:03 +11:00 (Migrated from github.com)

Hi
Today I try to use your workflow with the self hostet linkwarden.
I get this error

[21:00:14.228] Linkwarden Search[Script Filter] Queuing argument 'ga'
[21:00:14.304] Linkwarden Search[Script Filter] Script with argv 'ga' finished
[21:00:14.309] ERROR: Linkwarden Search[Script Filter] Code 1: Traceback (most recent call last):
  File "/Users/username/Documents/Software/Alfred/Alfred.alfredpreferences/workflows/user.workflow.2......././alfred-linkwarden.py", line 7, in <module>
    from workflow import Workflow, web, ICON_INFO
ModuleNotFoundError: No module named 'workflow'

Have you an idea how can I fix this?

Hi Today I try to use your workflow with the self hostet linkwarden. I get this error ``` [21:00:14.228] Linkwarden Search[Script Filter] Queuing argument 'ga' [21:00:14.304] Linkwarden Search[Script Filter] Script with argv 'ga' finished [21:00:14.309] ERROR: Linkwarden Search[Script Filter] Code 1: Traceback (most recent call last): File "/Users/username/Documents/Software/Alfred/Alfred.alfredpreferences/workflows/user.workflow.2......././alfred-linkwarden.py", line 7, in <module> from workflow import Workflow, web, ICON_INFO ModuleNotFoundError: No module named 'workflow' ``` Have you an idea how can I fix this?
deafmute1 commented 2025-01-21 10:10:11 +11:00 (Migrated from github.com)

@SandraCHC Please try again using this latest v1.5 alfred workflow package: https://github.com/deafmute1/alfred-linkwarden/releases/tag/1.5.

If that still doesn't work, please try opening the workflow folder in your terminal, run the following and paste the output below.

rm -r env # if folder doesn't exist, just continue to next step
bash ./helper.sh # it should error with a "IndexError: list index out of range" error, but still copy the _entire_ output 
@SandraCHC Please try again using this latest v1.5 alfred workflow package: https://github.com/deafmute1/alfred-linkwarden/releases/tag/1.5. If that still doesn't work, please try opening the workflow folder in your terminal, run the following and paste the output below. ``` rm -r env # if folder doesn't exist, just continue to next step bash ./helper.sh # it should error with a "IndexError: list index out of range" error, but still copy the _entire_ output ```
SandraCHC commented 2025-01-21 19:15:40 +11:00 (Migrated from github.com)

Thank you for your new version.
Now I get a new error

09:12:42.783] ERROR: Linkwarden Search[Script Filter] Code 1: File "/Users/username/Documents/Software/Alfred/Alfred.alfredpreferences/workflows/user.workflow......././alfred-linkwarden.py", line 42
    headers={"Authorization": f"Bearer {os.environ["A_LW_API_KEY"]}"},
                                                   ^

and in the command line

❯ bash ./helper.sh
Collecting alfred-pyworkflow
  Using cached Alfred-PyWorkflow-2.0.0b3.tar.gz (54 kB)
Collecting requests
  Using cached requests-2.32.3-py3-none-any.whl (64 kB)
Collecting idna<4,>=2.5
  Using cached idna-3.10-py3-none-any.whl (70 kB)
Collecting urllib3<3,>=1.21.1
  Using cached urllib3-2.3.0-py3-none-any.whl (128 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2024.12.14-py3-none-any.whl (164 kB)
Collecting charset-normalizer<4,>=2
  Using cached charset_normalizer-3.4.1-cp39-cp39-macosx_10_9_universal2.whl (197 kB)
Using legacy 'setup.py install' for alfred-pyworkflow, since package 'wheel' is not installed.
Installing collected packages: urllib3, idna, charset-normalizer, certifi, requests, alfred-pyworkflow
    Running setup.py install for alfred-pyworkflow ... done
Successfully installed alfred-pyworkflow-2.0.0b3 certifi-2024.12.14 charset-normalizer-3.4.1 idna-3.10 requests-2.32.3 urllib3-2.3.0
WARNING: You are using pip version 21.2.4; however, version 24.3.1 is available.
You should consider upgrading via the '/Users/username/Documents/Software/Alfred/Alfred.alfredpreferences/workflows/user.workflow...../env/bin/python3 -m pip install --upgrade pip' command.
  File "/Users/username/Documents/Software/Alfred/Alfred.alfredpreferences/workflows/user.workflow....././alfred-linkwarden.py", line 42
    headers={"Authorization": f"Bearer {os.environ["A_LW_API_KEY"]}"},
                                                    ^
SyntaxError: f-string: unmatched '['
Thank you for your new version. Now I get a new error ``` 09:12:42.783] ERROR: Linkwarden Search[Script Filter] Code 1: File "/Users/username/Documents/Software/Alfred/Alfred.alfredpreferences/workflows/user.workflow......././alfred-linkwarden.py", line 42 headers={"Authorization": f"Bearer {os.environ["A_LW_API_KEY"]}"}, ^ ``` and in the command line ``` ❯ bash ./helper.sh Collecting alfred-pyworkflow Using cached Alfred-PyWorkflow-2.0.0b3.tar.gz (54 kB) Collecting requests Using cached requests-2.32.3-py3-none-any.whl (64 kB) Collecting idna<4,>=2.5 Using cached idna-3.10-py3-none-any.whl (70 kB) Collecting urllib3<3,>=1.21.1 Using cached urllib3-2.3.0-py3-none-any.whl (128 kB) Collecting certifi>=2017.4.17 Using cached certifi-2024.12.14-py3-none-any.whl (164 kB) Collecting charset-normalizer<4,>=2 Using cached charset_normalizer-3.4.1-cp39-cp39-macosx_10_9_universal2.whl (197 kB) Using legacy 'setup.py install' for alfred-pyworkflow, since package 'wheel' is not installed. Installing collected packages: urllib3, idna, charset-normalizer, certifi, requests, alfred-pyworkflow Running setup.py install for alfred-pyworkflow ... done Successfully installed alfred-pyworkflow-2.0.0b3 certifi-2024.12.14 charset-normalizer-3.4.1 idna-3.10 requests-2.32.3 urllib3-2.3.0 WARNING: You are using pip version 21.2.4; however, version 24.3.1 is available. You should consider upgrading via the '/Users/username/Documents/Software/Alfred/Alfred.alfredpreferences/workflows/user.workflow...../env/bin/python3 -m pip install --upgrade pip' command. File "/Users/username/Documents/Software/Alfred/Alfred.alfredpreferences/workflows/user.workflow....././alfred-linkwarden.py", line 42 headers={"Authorization": f"Bearer {os.environ["A_LW_API_KEY"]}"}, ^ SyntaxError: f-string: unmatched '[' ```
deafmute1 commented 2025-01-22 10:24:43 +11:00 (Migrated from github.com)

Not getting this error on my system despite it being a in-code/syntax issue. I think that it may be an issue with you using a pre-3.12 verison of python that doesn't parse nested quotation marks (fixed in pep701/py3.12). I will release a package that fixes this but you can also just update python to version 3.12 or later using brew.

Not getting this error on my system despite it being a in-code/syntax issue. I think that it may be an issue with you using a pre-3.12 verison of python that doesn't parse nested quotation marks (fixed in pep701/py3.12). I will release a package that fixes this but you can also just update python to version 3.12 or later using brew.
deafmute1 commented 2025-01-22 11:11:11 +11:00 (Migrated from github.com)

New release with better python backwards compatibility: https://github.com/deafmute1/alfred-linkwarden/releases/tag/1.6-hotfix
Tested to work against python3.9, which is the oldest non-EOL version of python currently.

New release with better python backwards compatibility: https://github.com/deafmute1/alfred-linkwarden/releases/tag/1.6-hotfix Tested to work against python3.9, which is the oldest non-EOL version of python currently.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
violet/alfred-linkwarden#1
No description provided.