• Numpy, Scientific Python

    From Adept@21:2/108 to All on Wed Oct 30 19:35:44 2019
    Does anyone have experience in getting Numpy or Scientific Python working
    with Mystic?

    Or know where to get the rest of the Python errors that pop up when something goes wrong?

    While what I'm currently doing could definitely be done with base Python, I don't _want_ to do it that way. :)

    My current status is that I can get a basic Numpy-using Python program
    working on the command line, but when I run Mystic in that window, it errors out at the "import numpy" line.

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/64)
    * Origin: Storm BBS (21:2/108)
  • From Oli@21:1/151 to Adept on Thu Oct 31 08:00:44 2019
    My current status is that I can get a basic Numpy-using Python program working on the command line, but when I run Mystic in that window, it
    errors
    out at the "import numpy" line.

    Can you post the error message?

    ---
    * Origin: (21:1/151)
  • From Adept@21:2/108 to Oli on Thu Oct 31 01:05:22 2019
    out at the "import numpy" line.

    Can you post the error message?

    Can you tell me where/how to retrieve it? I suppose there's probably some
    error catch that I could write out somewhere, somehow. Just not overly
    familiar with Python, as of yet.

    Anyway, the extent of what I'm getting is:

    PYTHON ERROR (aprilpy.mpy)

    File "aprilpy.mpy", line 14, in <module>
    File "C:\Users\April\Anaconda2\lib\site-packages\numpy\__init__.py", line
    142, in <module> from .import core File "C:\Users\April\Anaconda2\lib\site-packages\numpy\core\__init__.py", line 12, in <module>Press a key
    ---------------
    ...and that's not overly helpful. And line 14 is "import numpy".

    I thought it was the same error I was getting in the command shell because of not having correctly added Anaconda to the path, but then I got that working, and had no luck with it despite running Mystic in the same shell.

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/64)
    * Origin: Storm BBS (21:2/108)
  • From Oli@21:1/151 to Adept on Thu Oct 31 10:10:36 2019
    On Thu, 31 Oct 2019 01:05:22 -0700
    "Adept -> Oli" <0@108.2.21> wrote:

    out at the "import numpy" line.

    Can you post the error message?

    Can you tell me where/how to retrieve it? I suppose there's probably some error catch that I could write out somewhere, somehow. Just not overly familiar with Python, as of yet.

    Anyway, the extent of what I'm getting is:

    PYTHON ERROR (aprilpy.mpy)

    File "aprilpy.mpy", line 14, in <module>
    File "C:\Users\April\Anaconda2\lib\site-packages\numpy\__init__.py", line 142, in <module> from .import core
    File "C:\Users\April\Anaconda2\lib\site-packages\numpy\core\__init__.py",
    line
    12, in <module>Press a key
    ---------------
    ..and that's not overly helpful. And line 14 is "import numpy".

    I was hoping the error is a little bit more detailed, but you can look at line 12 in core/__init__.py

    I think this is the numpy version in anaconda windows (not sure): https://github.com/numpy/numpy/blob/v1.16.5/numpy/core/__init__.py#L12

    maybe that is a similar issue: https://stackoverflow.com/questions/49750036/numpy-environment-variables-affect ing-import

    ---
    * Origin: (21:1/151)
  • From Adept@21:2/108 to Oli on Thu Oct 31 12:13:10 2019
    I think this is the numpy version in anaconda windows (not sure): https://github.com/numpy/numpy/blob/v1.16.5/numpy/core/__init__.py#L12

    That was, indeed, the correct line, and thank you for pointing that out -- I should've taken a look at that line myself, as it did have some promising
    paths to go down.

    That said, after a couple of hours attempting more things (e.g., pip uninstall numpy, then conda install numpy, along with a few other environmental things
    so that python ran the test program correctly in the command shell.), I'm
    still at (basically) the same place.

    That line did lead me to try "import ctypes", as that seems to be the
    sticking point, and that led me to this error:

    PYTHON ERROR (aprilpy.mpy)

    File "aprilpy.mpy", line 15, in <module>
    File "C:\Users\April\Anaconda2\Lib\ctypes\__init__.py", line 7, in <module> from _ctypes import Union, Structure, Array
    ImportError: DLL load failed: The specified procedure could not be found.
    ---
    So I'm assuming that python, when run through my Mystic install, isn't
    finding the WinDLL needed for "import ctypes" to work. I don't quite know
    where said DLL is located that Python finds it in the command shell, but not Mystic, and my searches so far have been unfruitful.

    In the interest of getting things done today, I'm going to give up on it for now, and likely just work around it (I mean, I'm just trying to have some 2D arrays and really dislike how Python does it, but it's not even something terribly difficult to code around.).

    But thanks for your help, and the prodding to check the layer beneath. I should've thought to do that on my own, as it got me closer to understanding what's going wrong, even if I haven't found a solution.

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/64)
    * Origin: Storm BBS (21:2/108)