-
Notifications
You must be signed in to change notification settings - Fork 1k
pyinstaller has some bug that results in improper packaging of tiktoken #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
How did you install tiktoken? |
Maybe similar case here. C:\Users\Administrator\Downloads>wechatGPT_Turbo.exe btw, tiktoken was installed via "pip3 install tiktoken" and imported to revChatGPT_Turbo.py as below: But when I run "python wechatGPT_Turbo.py ", everything was OK. |
Same question as above.When I made it executable,the question came out. |
I haven't ever used Maybe see if pyinstaller people know what the issue is. I'm willing to make minor adjustments to how tiktoken specifies packaging metadata to support the use case. |
Thank you for response. Seems there's a bug in pyinstaller. I'll open an issues there. |
Have no idea of package metadata. But pyinstaller do have an option --copy-metadata PACKAGENAME . If minor changes are made, I'm glad to make a try and feed back. Thank you. |
I have solved it using methods below: 1.Add 2.delete the code Hope it works on you. |
Many thanks! I created a dir named dll and put tls-client-64.dll in it, then added option below and finally solved the problem. |
It looks like some of the issue here is the blobfile dependency. Most people won't need that; I can make that an optional dependency. |
I've made blobfile an optional dependency in 0.3.1. Based on Jeremy-ttt's message, it sounds like the rest of this can be handled by pyinstaller's Let me know if there's anything else I can do here, if not, I'll close this issue soon. |
This answer prevented me from going totally loco. Worked like a charm, I was trying --hidden-import method for tiktoken_ext but not for --hidden-import=tiktoken_ext.openai_public and this seems to fixed the issue completely! Thanks a lot! |
thank you very much! I solve my problem! |
To clarify, just adding the hidden imports mentioned in 1. fixed the bug for me and allowed the exefication of py. |
If a comment fixed the issue for you, please show your appreciation via emoji reactions instead of commenting :-) |
I ran into the same issue, Using Auto-py-to-exe did you find a way to solve it? |
Closing, since there's nothing for tiktoken to do here. I added a mention to this in an FAQ issue: #98 |
This still seems to be an issue on my end, when trying to include this package via .spec file instead of --hidden-import CLI argument @shirubei Did you open this issue on pyinstaller/issues ? I can't seem to find it. @hauntsaninja Cheers! |
Doesn't need the |
Got it, thanks! I see there's a way to hook namespace packages according to Pyinstaller. I'll dig more and try to figure out what's going on, Maybe it's something weird on on my machine... |
Never mind! I found the issue in my .spec file. To anyone else that is as clumsy as I am when not using the command line arguments with pyinstaller, the proper way to include hidden imports via .spec file is to append them directly to the In other words, just add this (preferably after
|
A simplier solution.
|
* Adopt litellm for rewrite - phase 1 * Adopt litellm * Improve OpenAiSettingsPane showing options * Code cleanup * tests pass * fix * remove unused dependency * Add necessary hidden-imports (see: openai/tiktoken#43) * Add workflow to build and test sidecar binary * update docstring * only when specific files are changed * only when specific files are changed * Fix lint * generalize settings for multiple model providers * codegen * Adopt new settings for AI * Remove unsupported option for ollama * Update model when provider is updated * Bring retry back! * Configure reraise=True for @Retry --------- Co-authored-by: Greg Reda <[email protected]>
What could be the fix for this error. I am trying out the library for the first time.
The text was updated successfully, but these errors were encountered: