cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1564
Views
5
Helpful
2
Replies

How to use numpy module for Python on IR829(IOx)?

ys-hasegawa
Level 1
Level 1

Is there a way to use the numpy module for Python in the IR829?

Please teach me how to use numpy module on IOx.


I make the following PaaS App and deploy it.

Deployment successfully complete, but App Status: STOPPED after a few seconds.

requirements.txt

flask

numpy


main.py

from flask import Flask

import numpy as np


app = Flask(__name__)


@app.route('/')

def test_numpy():

    test = np.arange(10)

    return str(test[0])


if __name__ == '__main__':

    app.run(host='0.0.0.0',port=9000)


the following error occur(WATCHDOG.LOG):

APP START TIME:1505979890 App NumTest started with PID : 231 Monitoring this process now App TestApp completed with exit code: 1 APP END TIME:1505979890 Time taken by App : 0 minutes and 0 seconds. Stopping the container


So I change main.py to the following.

It's RUNNING.


main.py

from flask import Flask

#import numpy as np


app = Flask(__name__)


@app.route('/')

def test_numpy():

    #test = np.arange(10)

    return "Hello World"


if __name__ == '__main__':

    app.run(host='0.0.0.0',port=9000)

2 Replies 2

Steve Zhang
Cisco Employee
Cisco Employee

You may access the app console for debugging and troubleshooting.

https://developer.cisco.com/site/iox/docs/#debugging

I think the cause is because numpy needs fortran.

Thank you for answering.