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.


    Importing scipy package

    Pythonista
    9
    12
    12775
    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.
    • smisuta
      smisuta last edited by

      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.

      Thanks!

      1 Reply Last reply Reply Quote 0
      • dgelessus
        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.

        1 Reply Last reply Reply Quote 0
        • bergeom
          bergeom last edited by

          Smisuta,

          I'm quite new to Apple products and iPad. Could you please explain how you imported the scipy source into the site-packages directory?

          Thanks!

          1 Reply Last reply Reply Quote 0
          • smisuta
            smisuta last edited by

            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?

            1 Reply Last reply Reply Quote 0
            • smisuta
              smisuta last edited by

              bergeom: I used the script posted in this thread by henryiii

              https://omz-forums.appspot.com/pythonista/post/5832582902054912

              1 Reply Last reply Reply Quote 0
              • 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.

                1 Reply Last reply Reply Quote 0
                • smisuta
                  smisuta last edited by

                  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?

                  1 Reply Last reply Reply Quote 0
                  • wradcliffe
                    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.

                    1 Reply Last reply Reply Quote 0
                    • Webmaster4o
                      Webmaster4o last edited by Webmaster4o

                      I'd love scipy support. I'm looking to implement some of this stuff

                      1 Reply Last reply Reply Quote 0
                      • jmbenedetto
                        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.

                        1 Reply Last reply Reply Quote 0
                        • omz
                          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.

                          1 Reply Last reply Reply Quote 3
                          • ihf
                            ihf last edited by

                            @omz So I guess this means that we should not expect to see Pandas support in Pythonista. :-(

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