Numpy ‘module enum has no attribute intflag
imnegan last edited by imnegan
Something strange is happening when I try to import numpy. I have one line of code in my py file, which I created in the default Pythonista location.
import numpy as np
Which returns the following error:
Traceback (most recent call last): File "/var/containers/Bundle/Application/D8A31B2E-150C-4276-B4D5-22A9AC389F51/Pythonista3.app/Frameworks/Py3Kit.framework/pykit_startup.py", line 51, in <module> main() File "/var/containers/Bundle/Application/D8A31B2E-150C-4276-B4D5-22A9AC389F51/Pythonista3.app/Frameworks/Py3Kit.framework/pykit_startup.py", line 47, in main import importcompletion File "/var/containers/Bundle/Application/D8A31B2E-150C-4276-B4D5-22A9AC389F51/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/importcompletion.py", line 26, in <module> import imp File "/var/containers/Bundle/Application/D8A31B2E-150C-4276-B4D5-22A9AC389F51/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/imp.py", line 28, in <module> import tokenize File "/var/containers/Bundle/Application/D8A31B2E-150C-4276-B4D5-22A9AC389F51/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/tokenize.py", line 34, in <module> import re File "/var/containers/Bundle/Application/D8A31B2E-150C-4276-B4D5-22A9AC389F51/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/re.py", line 143, in <module> class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag'
Any ideas? I have stash installed, but numpy was going just fine when I last used Pythonista a couple of weeks ago.
JonB last edited by
delete the enum.py in site packages.
Phuket2 last edited by
@imnegan , various things regarding things to do with the enum module have been reported before. Have a search on the forum. But the general advice is to check your site-packages dir for a dir called enum and delete it. Then do a full restart of Pythonista, I think you will find it will be ok.
But for more info you can search the forum
dgelessus last edited by
The forum's built-in search function is usually quite bad. You can get much better results if you do a site-specific search. For example, in Google or DuckDuckGo, you can add "site:forum.omz-software.com" to the search to restrict it to only the forum.
imnegan last edited by