Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 04-06-2021, 03:23 AM   #1
DennisH
Member
DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.
 
Posts: 16
Karma: 67214
Join Date: Nov 2013
Device: K4NT, PW2
Python 3.9 Numpy

I have been learning and using Niluje's python modules for a while now and I have updated each time Niluje has updated his snapshots - what a wonderful resource!

I wanted to use a three dimensional array so I started using Numpy in the IDLE system on my PC thinking that I could then simply port it to the Kindle.

Sadly, I was totally misguided. I have tried for days now and cannot get a working version - or any version at all for that matter - of Numpy on my Kindle PW2 or PW3. All my other python code ports across OK.

I tried all the command combinations I could find starting from 'pip3 install numpy' to downloaded allegedly compatible ARMv7 numpy wheels but none of them run.

I have tried compiling from source but there are many dependencies that fail for various reasons that are mostly beyond my expertise.

So, my question is:
1. does anyone have a Kindle compatible Numpy wheel which I could use on my Paperwhite 2 or Paperwhite 3, or

2. as a special request to Niluje, is it possible to make a python version which includes Numpy because I have always been able to install your packages without any problems.

I realise that Anaconda may be an option but for consistency I would prefer to stay with the 'standard' python. I am not sure how to install Anaconda anyway.

I hope someone can help me.
DennisH is offline   Reply With Quote
Old 04-06-2021, 12:36 PM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
The latest snapshots builds (like, yesterday's ;p) of Python 3 should include numpy (on armv7 devices, at least, i.e., everywhere except things running FW < 4.x).

It should *probably* work, I haven't actually tested it, but I think I've nailed the final build issues (numpy's build system is kind of... esoteric, shall we say).

Fair warning: If it works, it'll probably be slow as hell, though.

EDIT: Yup, works.

Code:
┌─(ROOT@kindle:pts/0)──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────(~)─┐
└─(1.47:58%:23:41:73%:#)── python3                                                                                                                                                                                                                                                                                                                     ──(Tue, Apr 06)─┘
Python 3.9.4 (default, Apr  5 2021, 06:23:37) 
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> a = np.arange(15).reshape(3, 5)
>>> a
array([[ 0,  1,  2,  3,  4],
       [ 5,  6,  7,  8,  9],
       [10, 11, 12, 13, 14]])
>>>

Last edited by NiLuJe; 04-06-2021 at 05:43 PM.
NiLuJe is offline   Reply With Quote
Advert
Old 04-07-2021, 04:11 AM   #3
DennisH
Member
DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.DennisH put the bomp in the bomp-a-bomp-a-bomp.
 
Posts: 16
Karma: 67214
Join Date: Nov 2013
Device: K4NT, PW2
NiluJe,

Two thumbs up to you. Thank you for getting Numpy added to Python so quickly. Absolutely fantastic effort.

Installation was straightforward although it did take a great deal longer time than the original 3.9 python package which I have re-installed many times in the last few days after many factory resets on my devices which I have kept at OS 5.4.3.2. They (several PW2's and a couple of PW3's) were very rarely connected to the internet but only to a local wifi network pushing yacht data.

My Python programs gradually grew in size and functionality until time started to become a major factor, especially as updating screens takes a big chunk of the time. That caused me to start looking at Numpy.

My Idle on PC system imported Numpy easily but the Kindle was just the opposite. After many hours of searching I found posts of many others having problems but very few successful outcomes. Despite Numpy being frequently sought out it seems the vast majority of online Numpy information relates to bigger Intel and AMD systems. As a result I couldn't get past all the road blocks I ran into. I feel much better by your testament that building Numpy was esoteric because it gives me some excuse for my own lack of progress.

Now to start shifting some real code over to Numpy. So far I have tested a few multi-array functions that are all working but I have not yet done any proper speed testing.

Once again, many thanks
DennisH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to import numpy? xxyzz Development 9 02-23-2021 12:38 AM
Is the environment Python 2 or Python 3? halloleo Library Management 11 04-07-2020 03:47 AM
Python 2 to Python 3, Polyglot & Plugins DaltonST Calibre 18 04-24-2019 12:10 AM
Error on using numpy package into plugin nirosan Plugins 10 01-29-2019 05:25 AM
Python 2.5 or 2.6? itimpi Calibre 5 01-19-2009 12:48 PM


All times are GMT -4. The time now is 06:29 PM.


MobileRead.com is a privately owned, operated and funded community.