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.
Importing scipy package
I imported the scipy source package into the site-packages folder...what do I do now? A call to "import scipy.stats" gives me an error message:
ImportError: Error importing scipy: you cannot import scipy while
being in scipy source directory; please exit the scipy source
tree first, and relaunch your python intepreter.
Thing I don't understand is this happens from any folder that I am in and also from the console.
dgelessus last edited by
Pythonista only changes the current working directory when you run a script, which will set it to the folder containing the script you ran. Navigating in the file list doesn't affect the cwd. It should be enough to simply run any other script that isn't located in the scipy folder first, then try to import scipy again. A force-quit of Pythonista should work as well.
bergeom last edited by
I'm quite new to Apple products and iPad. Could you please explain how you imported the scipy source into the site-packages directory?
dgelessus: thanks for the advice. I ran other scripts, forced quit pythonista, tried importing scipy from scripts in other folders, etc, etc. I still get this error. Any thoughts?
bergeom: I used the script posted in this thread by henryiii
henryiii last edited by
Scipy has to be compiled, since most of it is written in C, not Python. Apple does not allow code to be compiled on iOS devices, so OMZ is the only one who can add scipy, pandas, etc. Try my script on a pure Python package.
PS: the next step would be to run "python setup.py build" from the command line if you were on a computer.
PPS: actually, much of scipy may be fortran, actually, now that I think of it. That is even harder to get to work, I think, because iOS is written in a C derivative.
Thanks henryiii...that makes sense...and thanks for the installer script by the way.
Do you know of any statistical pkgs that are pure Python?
wradcliffe last edited by
There is quite a bit of pure python code in scipy so it is worth keeping a copy of it around and then just grabbing modules you need. One example is the wavfile module under io. This is to read / write wav files using numpy arrays. Just one example, but there is a lot of good stuff in there that is pure python.
Webmaster4o last edited by Webmaster4o
I'd love scipy support. I'm looking to implement some of this stuff
jmbenedetto last edited by
Hi. 3 years later, and there is no support yet for scipy in Pythonista 3. I stated to migrate my work to Microsoft Azure Notebook, a Jupyther notebook host.
omz last edited by omz
@jmbenedetto I think that's an absolutely valid approach. Pythonista is good at iOS stuff. There are things you can do with it that you can't do with other apps, but SciPy isn't among those things. If your main focus is the SciPy/pandas stack, you might be better off with a cloud-based solution.
ihf last edited by
@omz So I guess this means that we should not expect to see Pandas support in Pythonista. :-(