Python Forum

Full Version: Running python scripts from github etc
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi.
I sometimes find some python scripts on github for example that I want to try out, but the documentation doesn't include instructions how to run the script. For me as a newbie I don't where to turn, maybe you can point me in the right direction?

So for example, i want to run this https://github.com/molobrakos/tellsticknet .
I've downloaded the source as a zip file and extracted it, and I've tried invoking the different py-files from console by typing python3 xxx.py but I just run into "no module named '...'" errors.
How do I get these missing modules?
(Mar-03-2021, 08:18 PM)pacmyc Wrote: [ -> ]Hi.
I sometimes find some python scripts on github for example that I want to try out, but the documentation doesn't include instructions how to run the script. For me as a newbie I don't where to turn, maybe you can point me in the right direction?

So for example, i want to run this https://github.com/molobrakos/tellsticknet .
I've downloaded the source as a zip file and extracted it, and I've tried invoking the different py-files from console by typing python3 xxx.py but I just run into "no module named '...'" errors.
How do I get these missing modules?
Well, if you told us what the module names were, it might help. Are they modules of the files you downloaded, or standard modules?
Repo has requirements.txt and there are following modules listed:

docopt
setuptools
requests
pyyaml
hbmqtt
Yes, where do I get them?
(Mar-03-2021, 08:31 PM)perfringo Wrote: [ -> ]Repo has requirements.txt and there are following modules listed:

docopt
setuptools
requests
pyyaml
hbmqtt

Yes, where do I get them?
I did "pip3 install xxx " for all the requirements but still get errors;

~/tellstick/tellsticknet-master/tellsticknet$ python3 discovery.py
Traceback (most recent call last):
File "discovery.py", line 7, in <module>
from .util import sock_sendto, sock_recvfrom
ImportError: attempted relative import with no known parent package



~/tellstick/tellsticknet-master/tellsticknet$ python3 __main__.py
Traceback (most recent call last):
File "__main__.py", line 39, in <module>
from tellsticknet import __version__, const
ModuleNotFoundError: No module named 'tellsticknet'
There is setup.py in Repo,that usually mean that is also on PyPi.
tellsticknet 0.1.2
The you install with pip install tellsticknet

There is an issue Any development still on?
So it may not work,they discuss alternatives there.
Thanx!