tchar / ulauncher-albert-calculate-anything

A ULauncher/Albert extension that supports currency, units and date time conversion, as well as a calculator that supports complex numbers and functions.
MIT License
103 stars 13 forks source link

[bug] If pint is not installed, suggest user restarts ulauncher after install #43

Open mattalxndr opened 1 year ago

mattalxndr commented 1 year ago

Describe the bug

The message reminding the user to install pint does not also suggest that the user restarts ulauncher to get around the error, but it is necessary (at least is was for me).

To Reproduce

Steps to reproduce the behavior:

  1. Install extension but do not install pint
  2. Open ulauncher and type =
  3. Notice a message saying something like "Install pint by running pip install pint"
  4. Install pint by running pip install pint.
  5. Open ulauncher and type =

Expected behavior

I expect newly installed pint to be recognized, since I followed the directions.

What happened instead

  1. Got the same message saying "Install pint by running pip install pint"
  2. Start fiddling with it to get it to work, which starts with restarting ulauncher process.
  3. Notice that there is no more error message about pint

Logs

Sorry I don't have logs, please let me know if you actually need them for this.

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information)

~ % uname --all
Linux m 6.0.12-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 08 Dec 2022 11:03:38 +0000 x86_64 GNU/Linux
~ % cat /etc/os-release
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo
~ % lsb_release -a
LSB Version:    n/a
Distributor ID: Arch
Description:    Arch Linux
Release:        rolling
Codename:       n/a
~ % hostnamectl
Static hostname: m
Icon name: computer-laptop
Chassis: laptop 💻Machine ID: ac2d7008d3874e7292bcc4dfcb25d7d7
Boot ID: 17c682032a2147a88df688bb7d6b5fd7
Operating System: Arch Linux
Kernel: Linux 6.0.12-arch1-1
Architecture: x86-64
Hardware Vendor: Dell Inc.
Hardware Model: XPS 13 9300
Firmware Version: 1.15.0

Additional context

Add any other context about the problem here.

github-actions[bot] commented 1 year ago

Issue has been marked as stale due to no activity

Danie10 commented 1 year ago

I'm seeing the same on Manjaro KDE. But although Python says the requirement is already satisfied, restarting ULauncher just shows the same message needing pint installed.

guvkon commented 6 months ago

I'm seeing the same on Linux Mint 21.3 Cinnamon. Python requirements are installed like so:

$ pip install Pint simpleeval parsedatetime pytz
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: Pint in ./.local/lib/python3.10/site-packages (0.23)
Requirement already satisfied: simpleeval in ./.local/lib/python3.10/site-packages (0.9.13)
Requirement already satisfied: parsedatetime in ./.local/lib/python3.10/site-packages (2.6)
Requirement already satisfied: pytz in /usr/lib/python3/dist-packages (2022.1)
Requirement already satisfied: typing-extensions in /usr/lib/python3/dist-packages (from Pint) (3.10.0.2)

Re-launching Ulauncher doesn't help at all.

kitnerboy commented 6 months ago

I've met this same problem on my Ubuntu 22.04.4 LTS Everything looks like packet is yet installed but it somehow fails. What i discovered is if I just run python interactive console i can import pint with no problem. Finally what I discovered is that i had two installs of pint - one from pip install and one from apt. I deleted pint that was from apt (as it was quite old and couldn't handle import Self from typing_extensions) and reinstalled or upgraded the one from pip. And I now can use this plugin flawlessly.

tchar commented 5 months ago

How did you install the plugin?

Depending on your system and python version pip may refer to pip for python2 and pip for python 3. You may have installed pint for the wrong python version.

To make sure you use the proper one try using python3 -m pip install pint.

Let me know if this helps.

EDIT: The extension tells you to restart the launcher. EIDT2: #51 changes these suggestions to /usr/bin/python3 -m pip install. The reason is that ulauncher uses #!/usr/bin/python3 to run.

guvkon commented 5 months ago

Didn't help.

$ /usr/bin/python3 -m pip install pint 
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pint in ./.local/lib/python3.10/site-packages (0.23)
Requirement already satisfied: typing-extensions in /usr/lib/python3/dist-packages (from pint) (3.10.0.2)

EDIT:

$ which python3
/usr/bin/python3
runew0lf commented 3 months ago

yeah i cant get it to work no matter what on linux mint too

Requirement already satisfied: pint in /usr/local/lib/python3.10/dist-packages (0.23) Requirement already satisfied: typing-extensions in ./.local/lib/python3.10/site-packages (from pint) (4.11.0)

same as the guys above, wont detect pint at all

beau4236 commented 3 months ago

Not working on Mint... halp!

tchar commented 3 months ago

Could this be due to Ulauncher using a different Python version than your system? Did you install it via Flatpak or another way other than the .deb file?

I don't have Mint, but it looks like the Ulauncher you run possibly runs via a different Python interpreter that does not have Pint installed.

runew0lf commented 3 months ago

Ulauncher 5.15.7 system package for Ulauncher Python 3.10.2

tchar commented 3 months ago

@runew0lf I have installed Mint on a VirtualBox machine and I have tried some things to figure out what is the problem.

So on a first note when I run

python3
import pint

I get the following error:

image

I am not sure how this issue came to be. It looks like it is an issue others face, as well as other projects. I updated the typing-extensions like this:

python3 -m pip install --upgrade typing-extensions

This allows pint to be imported, but it is still not working on Ulauncher. I then removed it and upgraded the system package (generally not recommended)

sudo python3 -m pip install --upgrade typing-extensions

I can still import it if I run Python3 from the terminal, but Ulauncher refuses to cooperate.

I will need some time to dig into what is happening here because Ulauncher probably messes up with the sys /usr/bin/launcher. If, in the meantime, you have any idea we can go forward with this, feel free to comment.

Finyti commented 2 months ago

Linux Mint 21.3 Cinnamon Ulauncher 5.15.7 Python 3.10.12

Same issue. No matter where or how pint is installed.