Can I use python flask with Apalis IMX6?

I would like to use python flask with my Apalis IMX6 but I’m not able to install it.
When I use the pip command ‘pip install flask’, the pip reports an error. I also try opkg install python-flask (suggested in link text ) but It also reports and error.

do I have to add any repository? It is possible to use flask with my apalis? Thanks in advance

hi vabarca

Could you provide the version of bsp you are using for your toradex module?
Addiotionally give also the log of errors?

Thanks and best regards, Jaski

Yes, sorry, I forgot it.
The imx6 is running the Apalis-iMX6_LXDE-Image_2.7-20180104 and python v2.7.12 - 20170108.
The output for both commands are:

  • For opkg install python-flask

root@apalis-imx6:~# opkg install python-flask
Installing python-flask (0.10.1) on root.
Downloading http://feeds.toradex.com/angstrom/feeds/v2016.12/ipk/glibc/armv7at2hf-neon/python/python-flask_0.10.1-r0.0_armv7at2hf-neon.ipk.
wget: bad address ‘feeds.toradex.com
Collected errors:

(I performed the opkg update first)

  • For pip install flask

root@apalis-imx6:~# pip install flask
Collecting flask
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by ‘NewConnectionError(’: Failed to establish a new connection: [Errno -2] Name or service not known’,)‘: /simple/flask/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by ‘NewConnectionError(’: Failed to establish a new connection: [Errno -2] Name or service not known’,)‘: /simple/flask/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by ‘NewConnectionError(’: Failed to establish a new connection: [Errno -2] Name or service not known’,)‘: /simple/flask/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by ‘NewConnectionError(’: Failed to establish a new connection: [Errno -2] Name or service not known’,)‘: /simple/flask/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by ‘NewConnectionError(’: Failed to establish a new connection: [Errno -2] Name or service not known’,)': /simple/flask/
Could not find a version that satisfies the requirement flask (from versions: )
No matching distribution found for flask

Thanks and regards
Vicente A

hi,
I just tried this on the same image and it seems to work. Do your module have connection to Internet?

Yes, I had internet but you gave me the key to solve it: I always check my internet connection by pinging to 8.8.8.8 but when I tried to ping www.google.com the apalis was not able to resolve the url. Therefore, my problem was related to the DNS server.

I checked the /etc/resolv.conf content and the file looked like this:

# Generated by Connection Manager
nameserver 127.0.0.1
nameserver ::1

Then, I edited it and added a new entry ‘nameserver 8.8.8.8’ that solved my problem and let me install flask (so now I’m able to run flask. Thanks!!!)

After rebooting the module I noticed that I lost the dns configuration again (the /etc/resolv.conf change to its original content). Is there any way to fix this? Is there any service modifying the file at booting time?

Thanks in advance
Regards
Vicente A

Yes, have a look at the following article on our developer website concerning the Ethernet configuration.

Don’t forget to run

opkg update

first.

Try:

echo 'nameserver 8.8.8.8' >> /etc/resolvconf/resolv.conf.d/head

/etc/resolv.config is link-simbolic to /var/run/…/resolv.conf this generate automatic in boot.

After execute:

opkg update
and opkg install flask...