Giving module error

from together import Together
from helper import get_together_api_key,load_env

client = Together(api_key=get_together_api_key())

output = client.chat.completions.create(
model=“meta-llama/Llama-3-70b-chat-hf”,
messages=[
{“role”: “system”, “content”: system_prompt},
{“role”: “user”, “content”: world_prompt}
],
)

dont know why whenever i run this chunk of code it always gives me this error

----> [7](file:///C:/Users/Lenovo/AppData/Local/Programs/Python/Python312/Lib/site-packages/helper/unix.py:7) import grp [8](file:///C:/Users/Lenovo/AppData/Local/Programs/Python/Python312/Lib/site-packages/helper/unix.py:8) import logging [9](file:///C:/Users/Lenovo/AppData/Local/Programs/Python/Python312/Lib/site-packages/helper/unix.py:9) import os ModuleNotFoundError: No module named ‘grp’

You are on a Windows system and for some reason, something in the Python software ensemble thinks you are on Un*x.

Can you post the whole stack trace not only the last message?

But I haven’t imported any module named grp and also the problem is caused because of the import helper thing.

What version of “Together” do you have?

pip show together

Should be the command to determine that,

Latest one I did uninstall and reinstalled it plus also checked its path
Name: together
Version: 1.4.6
Summary: Python client for Together’s Cloud Platform!
Home-page:
Author: Together AI
Author-email: support@together.ai
License: Apache-2.0

So what is in that file?

Could it be this one?

It can only be used on Un*x, so it shouldn’t be there, what uses it?

The author says:

Normally, helper would be installed as a dependency from another application or package.

Don’t know any of it uses in the course the instructor also didn’t elaborate about it.


But it seems to be running on Jupyter here.

Well, if the Jupyter Notebook is running in the cloud environment, the Python code will be running on a remote server, not on your Windows machine, and the remote server will probably be running a Linux environment and thus the unix.py will make sense on the remote server. But it won’t make sense on your local machine.

Incidentally, if you run !uname -a in one of the Notebook cells, you will get a string telling you about the server’s system.

Now, if you want to run the Notebook locally … I don’t know, how did you install the elements needed? (I have not yet attempted to do any of that, farthest I have got is to run programs locally in PyCharm)