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

AttributeError: module 'numpy' has no attribute 'int'. #3170

Open
Abonia1 opened this issue Jun 22, 2023 · 2 comments
Open

AttributeError: module 'numpy' has no attribute 'int'. #3170

Abonia1 opened this issue Jun 22, 2023 · 2 comments

Comments

@Abonia1
Copy link

Abonia1 commented Jun 22, 2023

Hello,
Python version: 3.8.8
NumPy version: 1.24.3
NLTK version: 3.8.1

I have update the numpy and nltk but can't fix gthe below issue:

AttributeError Traceback (most recent call last)
in
----> 1 import nltk

~/opt/anaconda3/lib/python3.8/site-packages/nltk/init.py in
144 ###########################################################
145
--> 146 from nltk.chunk import *
147 from nltk.classify import *
148 from nltk.inference import *

~/opt/anaconda3/lib/python3.8/site-packages/nltk/chunk/init.py in
153 """
154
--> 155 from nltk.chunk.api import ChunkParserI
156 from nltk.chunk.regexp import RegexpChunkParser, RegexpParser
157 from nltk.chunk.util import (

~/opt/anaconda3/lib/python3.8/site-packages/nltk/chunk/api.py in
11 ##//////////////////////////////////////////////////////
12
---> 13 from nltk.chunk.util import ChunkScore
14 from nltk.internals import deprecated
15 from nltk.parse import ParserI
...

AttributeError: module 'numpy' has no attribute 'int'.
np.int was a deprecated alias for the builtin int. To avoid this error in existing code, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Thanks in advance

@ThomasBur
Copy link

ThomasBur commented Mar 29, 2024

Hi @Abonia1 I can't seem to replicate this, and /nltk$ grep -r "numpy.int" and /nltk$ grep -r "np.int" both don't return any results.

Was this issue resolved when there were other efforts to remove numpy dependencies?

@liam0949
Copy link

liam0949 commented Apr 1, 2024

I had a similar issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants