-
Notifications
You must be signed in to change notification settings - Fork 764
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
Incompatibility with Python 3.12.1 on Linux #2091
Comments
Checking the actions workflow of a recent commit shows that it runs well on python 3.12.4. I would be surprised if it works on 3.12.4 but not on 3.12.1, but who knows? It might also be that there is something with your environment since torch is giving some errors. Have you tried creating a completely fresh environment and re-installing python, torch, and BERTopic? Also, doing a quick google search gives me something like this which could be related. |
It's an HPC environment, so python is being installed fresh each time. Torch is coming in with BERTopic; I'm not installing that separately. If python alone isn't the issue, my suspicion would be the interaction with Linux is.
Basically the workflow is loading Python 3.12.1 and then doing the import statement and that fails, then purging that python, loading 3.9.0, doing the import, and that succeeds. This is managed through lmod<https://lmod.readthedocs.io/en/latest/index.html> if that gives a better idea.
It works for me, so not urgent on my end: just wanted to give you an idea that it seemed like an issue existed.
…________________________________
From: Maarten Grootendorst ***@***.***>
Sent: Friday, July 19, 2024 2:35 AM
To: MaartenGr/BERTopic ***@***.***>
Cc: Brad Rittenhouse ***@***.***>; Author ***@***.***>
Subject: Re: [MaartenGr/BERTopic] Incompatibility with Python 3.12.1 on Linux (Issue #2091)
Checking the actions workflow of a recent commit<https://github.com/MaartenGr/BERTopic/actions/runs/9937377510/job/27447607894> shows that it runs well on python 3.12.4. I would be surprised if it works on 3.12.4 but not on 3.12.1, but who knows?
It might also be that there is something with your environment since torch is giving some errors. Have you tried creating a completely fresh environment and re-installing python, torch, and BERTopic?
Also, doing a quick google search gives me something like this<https://stackoverflow.com/questions/54408973/name-c-is-not-defined-pytorchjupyter-notebook> which could be related.
—
Reply to this email directly, view it on GitHub<#2091 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A5HDGP2NGTKN6UZ52BU7KNTZNDMXDAVCNFSM6AAAAABLDP35TKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZYG43DGMBUG4>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Thanks! Glad to hear that you managed to resolve the issue with Python 3.9.0 but it's a shame this still happens for you with Python 3.12.1. I'll leave this issue open in case others have similar issues. |
Have you searched existing issues? 🔎
Desribe the bug
Import works fine when I roll back to Python 3.9.0. Get the following error on 3.12.1. On CentOS.
System info:
CentOS Linux release 7.9.2009 (Core) NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora"
Error:
/home/users/$USER/.local/lib/python3.12/site-packages/hdbscan/plots.py:448: SyntaxWarning: invalid escape sequence '\l' axis.set_ylabel('$\lambda$ value') /home/users/$USER/.local/lib/python3.12/site-packages/hdbscan/robust_single_linkage_.py:154: SyntaxWarning: invalid escape sequence '\{' """Perform robust single linkage clustering from a vector array Traceback (most recent call last): File "/home/groups/$USER/fd_export/extract_body.py", line 4, in <module> from bertopic import BERTopic File "/home/users/$USER/.local/lib/python3.12/site-packages/bertopic/__init__.py", line 1, in <module> from bertopic._bertopic import BERTopic File "/home/users/$USER/.local/lib/python3.12/site-packages/bertopic/_bertopic.py", line 59, in <module> import bertopic._save_utils as save_utils File "/home/users/$USER/.local/lib/python3.12/site-packages/bertopic/_save_utils.py", line 29, in <module> import torch File "/home/users/$USER/.local/lib/python3.12/site-packages/torch/__init__.py", line 562, in <module> for name in dir(_C): ^^ NameError: name '_C' is not defined
Reproduction
BERTopic Version
0.16.2
The text was updated successfully, but these errors were encountered: