Stream: python
Topic: Python help required
Grahame Grieve (Apr 26 2019 at 04:12):
I want to send some process notifications to Zulip. The Zulip people have told me to use https://github.com/zulip/python-zulip-api/blob/master/zulip/zulip/send.py#L3 but I don't know how to get that running on windows. I have Python, and I tell it to run that python code, and I get ModuleNotFound 'zulip' - presumably I have to do something but I don't know what...
Grahame Grieve (Apr 26 2019 at 04:12):
python c:\tools\zulip-api\zulip\zulip\send.py
Pascal Pfiffner (Apr 26 2019 at 04:14):
It looks like you need the complete "zulip" package for this script to run (it imports that in line 31). So you either download the whole repo and configure it, or you install the package via PIP.
Grahame Grieve (Apr 26 2019 at 04:15):
i ddi download the whole repo but I don't know what 'configure it' means, nor do I know what 'install the package via PIP
Grahame Grieve (Apr 26 2019 at 04:15):
means. Which should I do?
Pascal Pfiffner (Apr 26 2019 at 04:15):
PIP is Python's preferred package manager, I'm sure you'll find tons of tutorials on how to get set up with it on Windows. I'd recommend trying that.
Pascal Pfiffner (Apr 26 2019 at 04:16):
Once you have PIP installed, you do pip install zulip
and you're good to go.
Pascal Pfiffner (Apr 26 2019 at 04:16):
If you encounter something called virtualenv
, set that up, too. This will set up mini environments contained in the directory you choose to, rather than install stuff systemwide.
Pascal Pfiffner (Apr 26 2019 at 04:18):
pip is already installed if you are using Python 2 >=2.7.9 or Python 3 >=3.4 downloaded from python.org or if you are working in a Virtual Environment created by virtualenv or pyvenv. Just make sure to upgrade pip.
Grahame Grieve (Apr 26 2019 at 04:18):
awesome - thanks.
Pascal Pfiffner (Apr 26 2019 at 04:18):
^ says PIP
Pascal Pfiffner (Apr 26 2019 at 04:18):
https://pip.pypa.io/en/stable/installing/
Grahame Grieve (Apr 26 2019 at 04:29):
ok all sorted nicely. My release batch files can now send zulip notifications
Pascal Pfiffner (Apr 26 2019 at 04:34):
That was quick :grinning_face_with_smiling_eyes:
Grahame Grieve (Apr 26 2019 at 04:44):
the pip piece was the missing bit. the Zulip part was very easy
Josh Mandel (May 02 2019 at 03:15):
Do you pack credentials in the public script, or ask users to enter their own api key?
Grahame Grieve (May 02 2019 at 16:51):
provide your own key - there's a file format for that - they've thought that through - it's very nice
Grahame Grieve (May 02 2019 at 16:52):
you download the file from your settings. Sweet
Last updated: Apr 12 2022 at 19:14 UTC