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.
Error importing numpy
-
I wrote a script in Pythonista that failed on the first line, importing numpy. I tried just running that import line in the console, and it also failed.
>>> import numpy as np Traceback (most recent call last): File "<string>", line 1, in <module> File "/var/containers/Bundle/Application/2D5E7A73-E48B-4CA6-8789-B800F22ADF1D/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/numpy/__init__.py", line 172, in <module> from . import random File "/var/containers/Bundle/Application/2D5E7A73-E48B-4CA6-8789-B800F22ADF1D/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/numpy/random/__init__.py", line 104, in <module> ranf = random = sample = random_sample NameError: name 'random_sample' is not defined
Is this a bug? I haven’t installed anything custom and this seems to be attempting to use the packaged numpy installation.
-
@Flavin, have you tried restarting Pythonista?
-
@mikael I have now. That seems to have fixed it.
-
@Flavin, excellent. It has been noted here before that numpy is such a large and complex library that it may fail to load properly.