Skip to content
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

Open
1 task done
bcritt1 opened this issue Jul 18, 2024 · 3 comments
Open
1 task done

Incompatibility with Python 3.12.1 on Linux #2091

bcritt1 opened this issue Jul 18, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@bcritt1
Copy link

bcritt1 commented Jul 18, 2024

Have you searched existing issues? 🔎

  • I have searched and found no 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

from bertopic import BERTopic

BERTopic Version

0.16.2

@bcritt1 bcritt1 added the bug Something isn't working label Jul 18, 2024
@MaartenGr
Copy link
Owner

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.

@bcritt1
Copy link
Author

bcritt1 commented Jul 19, 2024 via email

@MaartenGr
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants