Jump to content

Y1ng

Member
  • Posts

    4
  • Joined

  • Last visited

Posts posted by Y1ng

  1. 55 minutes ago, deanishe said:

     

    It's not a standard package, so you should bundle it with the workflow. Asking non-technical users to install software libraries when you could easily bundle them isn't great.

     

    And, that's not a great way to install requests, either. You should always call pip via /path/to/python -m pip, so you know which Python you’re installing the packages in. There’s no telling what will get called if you just run pip because different Pythons all want to use /usr/local/bin/pip and will overwrite each other.

     

    Alfred also doesn’t use the same PATH as your shell, so python won’t be the same command in Alfred as in a shell. So use the full path to the Python executable.

     

    Finally, you shouldn’t install packages globally like that. Install them in your user-specific library folder, so you aren’t changing the system and don’t need admin rights: /path/to/python -m pip install --user requests

    You are right, thank you !

     

    I just use Alfred for 1 week and it is my first workflow, so it may have lots of issues, i will optimize it when im familiar with writing workflows

  2. If Afread Debug saild "ImportError: No module named requests" and `pip install requests` dont work, Try there steps:

     

    First, check if you have python and pip on you Mac, or use brew to install. 

     

    Second, you may still get ImportError when you have already `pip install requests`, that may because you have many python(such as 2.7 3.5 3.7 3.9), The python which installed requests module is different from the python alfred use. Then you can find the right python's path by using `whereis python` `which python` or other ways,  then edit the workflow:

    WeChat43ede7f9b99a8b97def040d2094a8105.png.6f3a0eb4e2a62feea6415814f3e4eecc.pngWX20220312-171352.png.37f6da43b3b1bcb38898cf5d6c6f92fd.pngWX20220312-171352.png.37f6da43b3b1bcb38898cf5d6c6f92fd.png

  3. 5 hours ago, leophegor said:

    Here's the output of debugger.

     

    [11:28:17.241] Currency Converter[Script Filter] Queuing argument '1'

    [11:28:17.354] Currency Converter[Script Filter] Script with argv '1' finished

    [11:28:17.356] ERROR: Currency Converter[Script Filter] Code 1: Traceback (most recent call last):

      File "run.py", line 1, in <module>

        import requests

    ImportError: No module named requests

    [11:28:17.534] Currency Converter[Script Filter] Queuing argument '10'

    [11:28:17.601] Currency Converter[Script Filter] Script with argv '10' finished

    [11:28:17.604] ERROR: Currency Converter[Script Filter] Code 1: Traceback (most recent call last):

      File "run.py", line 1, in <module>

        import requests

    ImportError: No module named requests

    [11:28:19.306] Currency Converter[Script Filter] Queuing argument '100'

    [11:28:19.380] Currency Converter[Script Filter] Script with argv '100' finished

    [11:28:19.384] ERROR: Currency Converter[Script Filter] Code 1: Traceback (most recent call last):

      File "run.py", line 1, in <module>

        import requests

    ImportError: No module named requests

    [11:28:20.709] Currency Converter[Script Filter] Queuing argument '100U'

    [11:28:20.851] Currency Converter[Script Filter] Script with argv '100U' finished

    [11:28:20.857] ERROR: Currency Converter[Script Filter] Code 1: Traceback (most recent call last):

      File "run.py", line 1, in <module>

        import requests

    ImportError: No module named requests

    [11:28:20.904] Currency Converter[Script Filter] Queuing argument '100US'

    [11:28:21.027] Currency Converter[Script Filter] Script with argv '100US' finished

    [11:28:21.033] ERROR: Currency Converter[Script Filter] Code 1: Traceback (most recent call last):

      File "run.py", line 1, in <module>

        import requests

    ImportError: No module named requests

    [11:28:21.214] Currency Converter[Script Filter] Queuing argument '100USD'

    [11:28:21.288] Currency Converter[Script Filter] Script with argv '100USD' finished

    [11:28:21.293] ERROR: Currency Converter[Script Filter] Code 1: Traceback (most recent call last):

      File "run.py", line 1, in <module>

        import requests

    ImportError: No module named requests

    [11:28:21.951] Currency Converter[Script Filter] Queuing argument '100USD '

    [11:28:22.021] Currency Converter[Script Filter] Script with argv '100USD ' finished

    [11:28:22.028] ERROR: Currency Converter[Script Filter] Code 1: Traceback (most recent call last):

      File "run.py", line 1, in <module>

        import requests

    ImportError: No module named requests

    [11:28:22.314] Currency Converter[Script Filter] Queuing argument '100USD C'

    [11:28:22.445] Currency Converter[Script Filter] Script with argv '100USD C' finished

    [11:28:22.455] ERROR: Currency Converter[Script Filter] Code 1: Traceback (most recent call last):

      File "run.py", line 1, in <module>

        import requests

    ImportError: No module named requests

    [11:28:22.650] Currency Converter[Script Filter] Queuing argument '100USD CN'

    [11:28:22.792] Currency Converter[Script Filter] Script with argv '100USD CN' finished

    [11:28:22.801] ERROR: Currency Converter[Script Filter] Code 1: Traceback (most recent call last):

      File "run.py", line 1, in <module>

        import requests

    ImportError: No module named requests

    [11:28:22.871] Currency Converter[Script Filter] Queuing argument '100USD CNY'

    [11:28:22.994] Currency Converter[Script Filter] Script with argv '100USD CNY' finished

    [11:28:23.003] ERROR: Currency Converter[Script Filter] Code 1: Traceback (most recent call last):

      File "run.py", line 1, in <module>

        import requests

    ImportError: No module named requests

    That is because your python miss requests module. use `pip install requests` to install it 

  4. This tool helps you with currency conversion

     

    For example, convert 100 USD to EUR:

    2022-03-11-080455.thumb.png.d058c0c688a38fb5b3968be51c20b4ef.png

     

    check here: https://github.com/y1nglamore/AlfredCurrencyConverter

     

    btw, it needs your python has requests module. you can try `python -c "import requests"` on bash , if it don't tell you 'ImportError: No module named requests' that means you have the `requests` module. Otherwise, use `pip install requests` to install it

×
×
  • Create New...