WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: piCore 7 alex iot python  (Read 11998 times)

Offline aug

  • Jr. Member
  • **
  • Posts: 74
piCore 7 alex iot python
« on: July 16, 2017, 11:31:31 AM »
I try to play with alex and some python scripts but it seems that not the full python package in core7 is installed. how can i install it? Which package?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14831
Re: piCore 7 alex iot python
« Reply #1 on: July 17, 2017, 12:14:14 PM »
Code: [Select]
$ tce-load -wil python

Offline aug

  • Jr. Member
  • **
  • Posts: 74
Re: piCore 7 alex iot python
« Reply #2 on: July 17, 2017, 02:10:28 PM »
Code: [Select]
$ tce-load -wil python
And this loads all???

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14831
Re: piCore 7 alex iot python
« Reply #3 on: July 17, 2017, 02:15:00 PM »
Try it and see  :)

Offline syang

  • Newbie
  • *
  • Posts: 4
Re: piCore 7 alex iot python
« Reply #4 on: July 23, 2017, 06:12:18 PM »
What I did is install pip and then all the required packages then build a customized tcz from python site-packages folder, then load the tcz at boot up.

Offline njs

  • Newbie
  • *
  • Posts: 25
Re: piCore 7 alex iot python
« Reply #5 on: September 28, 2017, 09:50:11 AM »
How do I install pip?  I don't see a pip package in http://tinycorelinux.net/9.x/armv6/tcz/  Is it part of python.tcz? 

And once I have pip installed, will I then be able to use pip to install the necessary python modules (e.g. picamera, PIL, smbus, astral) without needing a special tcz for each python module?

thanks.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14831
Re: piCore 7 alex iot python
« Reply #6 on: September 28, 2017, 12:20:42 PM »
It looks like (I didn't test) pip is included in the python3.x extensions, but not the python(2.x) extensions.

If you need to use python-2.x, you could download and compile the pip source.

Once pip (and maybe python-setuptools) is installed, you can download and install any python module you like, but it will not persist after re-boot unless you add a lot of files to your backup.

Offline njs

  • Newbie
  • *
  • Posts: 25
Re: piCore 7 alex iot python
« Reply #7 on: September 28, 2017, 06:34:40 PM »
Great. I would actually prefer python3.  I will need the modules to persist, but as far as adding the files to my backup, is that assuming Cloud or Copy mode?  Can't I avoid this with Mount mode?  The piZero doesn't have a lot of RAM and I don't think I ant all this stuff loaded into RAM disk...

Thanks. 

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14831
Re: piCore 7 alex iot python
« Reply #8 on: September 29, 2017, 04:11:05 AM »
If you want to avoid using ram you'll have to make extensions out of the modules

Offline njs

  • Newbie
  • *
  • Posts: 25
Re: piCore 7 alex iot python
« Reply #9 on: September 29, 2017, 09:00:30 AM »
okay, but that's not sufficient, right.  modules are still loading to ramdisk by default, correct?  How do I change that? Mount mode?

thanks.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: piCore 7 alex iot python
« Reply #10 on: September 29, 2017, 10:07:23 AM »
The backup file is copied to RAM but extensions are mounted by default.
In cloud mode, extensions are downloaded to RAM and then mounted (they are gone after reboot).
If you have persistent storage for extensions, mounted extensions don't consume RAM except for several KB for the mount point.
Download a copy and keep it handy: Core book ;)

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: piCore 7 alex iot python
« Reply #11 on: September 29, 2017, 06:03:15 PM »
Can't I avoid this with Mount mode?  The piZero doesn't have a lot of RAM and I don't think I ant all this stuff loaded into RAM disk...

Why use piCore if you don't want an small embedded Linux in RAM?

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: piCore 7 alex iot python
« Reply #12 on: September 29, 2017, 06:06:19 PM »
The backup file is copied to RAM but extensions are mounted by default.
In cloud mode, extensions are downloaded to RAM and then mounted (they are gone after reboot).
If you have persistent storage for extensions, mounted extensions don't consume RAM except for several KB for the mount point.

Aren't extensions copied from persistent storage to /tmp (RAM) then mounted?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11670
Re: piCore 7 alex iot python
« Reply #13 on: September 29, 2017, 08:16:02 PM »
Hi Greg Erskine
Extensions are loop mounted in  /tmp/tceloop/  and then linked in to the file system, usually  /usr/local/  which is located in RAM.

Offline njs

  • Newbie
  • *
  • Posts: 25
Re: piCore 7 alex iot python
« Reply #14 on: September 29, 2017, 10:10:26 PM »
The backup file is copied to RAM but extensions are mounted by default.
In cloud mode, extensions are downloaded to RAM and then mounted (they are gone after reboot).

I thought I read that cloud mode was the default.  How do I know what mode I am in?

If you have persistent storage for extensions, mounted extensions don't consume RAM except for several KB for the mount point.

That sounds like what I want.

Why use piCore if you don't want an small embedded Linux in RAM?

I DO want small, tightly-wound, highly-reliable, embedded Linux.  And in particular, I want it to boot as fast as possible.  I don't really care if the entire OS is in RAM except that: 1) copying the entire OS to RAM would undoubtably slow down the boot process and 2) it will waste RAM, which is scare on the PiZero to begin with.

BTW, I'll also need to store my app data (photos) directly to SD.  Any reason I should create a 3rd partition vs. just creating a data directory on /mnt/mmc0blk0p2?