ywangd / stash

StaSh - Shell for Pythonista
MIT License
1.93k stars 227 forks source link

Let's try it out a little bit harder and make Scipy Lib work perfectly in pythonista? #350

Open kerrl opened 5 years ago

kerrl commented 5 years ago

Hello: I like pythonista very much. It allows me to learn python on ios. I am currently learning data analysis, so I try to install scipy lib. When I try run stash in python3.6, and try PIP install scipy, it boosts my installation success. I can see that I successfully installed scipy (1.2.0). Using the PIP list,. I immediately created test_scipy.py ,example: import scipy ; help(‘modules’) it’s run sucessed. I can use scipy function. which shows that the scipy library is loaded. However, when I restart pythonista and run test_scipy.py again, the instructions begin with an Error: "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 interpreter. Strange that I've used the scipy library successfully. Why is this happening?

jsbain commented 5 years ago

You cannot use scipy in pythonista, as it depends on c code.

ColdGrub1384 commented 5 years ago

The problem is not C code (only @omz could implement it) but it's Fortran code that is a lot harder to make work on iOS.

SamyBencherif commented 5 years ago

The problem is not C code (only @omz could implement it) but it's Fortran code that is a lot harder to make work on iOS.

Are you saying scipy runs Fortran code?

ColdGrub1384 commented 5 years ago

@SamyBencherif Yes. I implemented NumPy, Pandas and Matplotlib successfully in my app, but I didn’t manage to compile SciPy because of Fortran code. It’s technically possible, but very tricky. The console says ARM64 is not supported by the Fortran compiler. But there seems to be a GCC plugin to compile Fortran for iOS: https://apple.stackexchange.com/questions/40471/is-there-a-fortran-compiler-emulator-for-ios