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

    Pythonista
    3
    5
    6438
    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.
    • Daniel.Dalsgaard
      Daniel.Dalsgaard last edited by

      Hello forum,

      I'm trying to use pythonista 3 on my iPad pro 12.9" (the newest one), and when I'm trying to call np.array (same as I would do in any Python IDE) it fails and says that numpy doesn't have the array function. Am I doing something wrong? Do you have to go a different way about it in Pythonista.

      I hope some of you with experience can help me, so I can leave my MacBook at home when going to university. I'm only using Python at uni for small tasks.

      eddo888 1 Reply Last reply Reply Quote 0
      • dgelessus
        dgelessus last edited by

        There are two possibilities I can think of:

        1. Do you have a file called numpy.py in Pythonista? If so, you need to rename it - otherwise import numpy as np will import your numpy.py and not the standard numpy module.
        2. Try restarting Pythonista (swipe up from the bottom of the screen to open the app switcher, then swipe Pythonista upwards to close it, then reopen the app). It is possible that the numpy module isn't loaded completely; this can happen if you stop your script while the import numpy statement is running. By restarting Pythonista, you can bring the Python environment back into a clean state.
        1 Reply Last reply Reply Quote 0
        • Daniel.Dalsgaard
          Daniel.Dalsgaard last edited by

          I checked that I have no file called numpy.py, and then I restarted Pythonista and tried import numpy as np as I normally would. I get the error message "Error importing numpy: you should not try to import numpy from its source directory; please exit your numpy source tree, and relaunch your python interpreter from there". I don't know how to fix that, and it didnt fix after restarting the app.

          1 Reply Last reply Reply Quote 0
          • Daniel.Dalsgaard
            Daniel.Dalsgaard last edited by

            I got it working - I deleted the app, restarted the iPad and then reinstalled it, and now it works. Thanks for the help

            1 Reply Last reply Reply Quote 0
            • eddo888
              eddo888 @Daniel.Dalsgaard last edited by

              @Daniel.Dalsgaard

              works better using python3
              python2 is great but not perfect

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