ProtonVPN / linux-cli

Official ProtonVPN Linux app (CLI)
https://protonvpn.com/download-linux
GNU General Public License v3.0
335 stars 43 forks source link

cli.py points to the wrong module and constant name #25

Open autogris opened 3 years ago

autogris commented 3 years ago

Trying to run it on a Slackware machine I got some problems. The first one is python breaking by not finding "proton.constants" module in a cli.py call. It is fixed by changing cli.py by pointing to the right module: protonvpn_cli.constants. Then it breaks again by not finding VERSION constant. It is also fixed by changing cli.py corresponding line to APP_VERSION instead. It eventually gives an error again, but in protonvpn-nm-lib side, I opened an issue in that repo too.

todoleza commented 3 years ago

I experience this also on Fedora 34 due to module name clash with python3-qpid-proton.x86_64:

$ protonvpn-cli
Traceback (most recent call last):
  File "/usr/bin/protonvpn-cli", line 33, in <module>
    sys.exit(load_entry_point('protonvpn-cli==3.7.2', 'console_scripts', 'protonvpn-cli')())
  File "/usr/lib/python3.9/site-packages/protonvpn_cli/main.py", line 20, in main
    from .cli import ProtonVPNCLI
  File "/usr/lib/python3.9/site-packages/protonvpn_cli/cli.py", line 4, in <module>
    from proton.constants import VERSION as proton_version
ModuleNotFoundError: No module named 'proton.constants'

There are two packages providing proton module where this applicaton resides in /usr/lib/python3.9/site-packages/proton and qpid-proton in /usr/lib64/python3.9/site-packages/proton (note the lib64). On my system the qpid-proton wins and obviously does not satisfy the caller:

$ python3 -c 'import proton; print(proton.__path__)' 
['/usr/lib64/python3.9/site-packages/proton']

I am not sure how to resolve this in other way than doing manual rename to a more unique module name. I need qpid-proton on my system, otherwise I'd get rid of the other package. DNF repo query bellow.

# dnf rq --whatprovides /usr/lib\*/python3.9/site-packages/proton/
python3-proton-client-0:0.5.1-3.noarch
python3-qpid-proton-0:0.33.0-3.fc34.x86_64
python3-qpid-proton-0:0.34.0-1.fc34.x86_64
calexandru2018 commented 3 years ago

Interesting @todoleza . @autogris can you confirm that this is also the case for you ?

autogris commented 3 years ago

Sorry, as it was pointed out to me in the other repo this software is not compatible with my distro so i removed it. I can confirm though that i do not have any package with a similar name to proton.

Dyrimon commented 3 years ago

@calexandru2018 Hi, I'm facing the same issue as @todoleza "ModuleNotFoundError". I should clarify I'm using a third party reposity for openSUSE Tumbleweed since there's no official one. I've installed the cli from this repo: https://build.opensuse.org/package/show/home%3Aahjolinna/protonvpn-cli

GabrielRavier commented 1 year ago

I've also had this issue on my laptop - removing the python3-qpid-proton.x86_64 package as a workaround appears to work, but the name clash is gonna be an issue if anybody needs both the packages at once...