omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Numpy ‘module enum has no attribute intflag

    Pythonista
    4
    5
    5374
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • imnegan
      imnegan last edited by imnegan

      Hi all,

      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.

      Phuket2 1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        delete the enum.py in site packages.

        1 Reply Last reply Reply Quote 1
        • Phuket2
          Phuket2 @imnegan 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

          1 Reply Last reply Reply Quote 1
          • dgelessus
            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.

            1 Reply Last reply Reply Quote 1
            • imnegan
              imnegan last edited by

              Thanks all.

              @JonB I didn't see the enum.py file anywhere, but
              @Phuket2 deleting the enum dir nailed it.

              @dgelessus amen RE the forum's search function, thanks 'site:' for the google tip.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors