alexdlaird / pyngrok

A Python wrapper for ngrok
https://pyngrok.readthedocs.io
MIT License
416 stars 59 forks source link

pyngrok 7.0.5 installs unsupported ngrok agent version #131

Closed jneilliii closed 4 months ago

jneilliii commented 4 months ago

Acknowledgements

Operating System

Raspberry Pi OS Buster

Python Version

3.7.3

pyngrok Version

7.0.5

Describe the Bug

Installing pyngrok vesion 7.0.5 (latest supported version based on python version) results in unsupported ngrok agent version 2.3.41. Attempting to run ngrok update results in "No update available, this is the latest version.".

Steps to Reproduce

  1. create a virtual environment using python 3.7.3
  2. pip install pyngrok
  3. /path/to/venv/bin/ngrok -v

Expected Behavior

I would expect a supported version of ngrok agent to be installed.

alexdlaird commented 4 months ago

When you run an ngrok subcommand from the CLI, you're interacting with ngrok, not pyngrok. I don't work for ngrok, so this is just my theory / assumption, but I'm pretty sure the update command won't bump a major version, only minor versions. To install ngrok v3, which is what I assume you're trying to do, you can't use the update command. Just delete the ngrok v2 binary wherever it lives, then execute the ngrok command again—when no subcommand is given, and no ngrok binary exists, pyngrok will intercept this command and download the true latest version for you, which will be v3.

If you installed the ngrok v2 binary yourself, then it's wherever you put it on your path. If you think pyngrok installed it for you, you can find it with the following in a Python console:

from pyngrok import conf
config = conf.PyngrokConfig()
print(config.ngrok_path)

If your system keeps download ngrok v2 via pyngrok, know that the version of pyngrok you're running by default will install ngrok v3, so if it's not, perhaps your code is changing the default behavior: https://pyngrok.readthedocs.io/en/latest/#ngrok-version-compatibility

jneilliii commented 4 months ago

Thank you so much for this tip. It was installed by the module and I was able to find the binary and manually remove it and run ngrok -v to get the latest version.