Question
· Nov 23, 2023

Need Help Resolving Python Tiktoken Module Issue in IRISHealth

I'm currently facing an issue with a Python script in my IRISHealth environment and would appreciate your insights.

I've written a class method, `getTokenCount`, in Python, which uses the `tiktoken` module. However, when I run the script in the terminal using `do ##class(python.openaiUtils).getTokenCount("")`, I encounter the following error:

```
<THROW> *%Exception.PythonException <THROW> 230 ^^0^DO ##CLASS(python.openaiUtils).Test() <class 'ModuleNotFoundError'>: No module named 'tiktoken.core' -
```

I have already installed `tiktoken` in the correct directory (`C:\InterSystems\IRISHealth\bin>`), and running `irispip list` confirms its presence:

```
Package           Version
------------------ ---------
...
tiktoken           0.5.1
...
```

Despite this, I'm unable to resolve the issue, and the error persists. Has anyone encountered a similar problem or has insights on how to fix this? Your assistance would be greatly appreciated!

Discussion (3)2
Log in or sign up to continue