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
-
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.
-
There are two possibilities I can think of:
- Do you have a file called
numpy.py
in Pythonista? If so, you need to rename it - otherwiseimport numpy as np
will import yournumpy.py
and not the standardnumpy
module. - 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 theimport numpy
statement is running. By restarting Pythonista, you can bring the Python environment back into a clean state.
- Do you have a file called
-
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.
-
I got it working - I deleted the app, restarted the iPad and then reinstalled it, and now it works. Thanks for the help
-
works better using python3
python2 is great but not perfect