pootle
Posts: 340
Joined: Wed Sep 04, 2013 10:20 am
Location: Staffordshire
Contact: Website

picamera installation location varies - why?

Tue Mar 12, 2019 10:45 pm

I'm just slightly bemused by the fact that in the gui versions of raspbian, picamera (there as part of the build) is in
/usr/lib/python3/dist-packages/picamera/
and in raspbian lite (where you have to install it using pip3 or apt-get) it is in
/usr/local/lib/python3.5/dist-packages/picamera/
Just interested as I'm working on some camera software that has found a buglet in the code for which I have a workaround patch that needs applying.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6027
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: picamera installation location varies - why?

Wed Mar 13, 2019 4:37 pm

They're in different locations to separate system-managed python libraries and user-installed ones. /usr/local stuff is where pip should end up putting it, /usr is where apt should put it.

Helpful chart:
Image

User avatar
ben_nuttall
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 231
Joined: Sun Aug 19, 2012 11:19 am
Location: Cambridge, UK
Contact: Website

Re: picamera installation location varies - why?

Wed Mar 13, 2019 4:50 pm

If you install it with apt it ends up in /usr/lib/python3/dist-packages/picamera/

If you install it with pip it ends up in /usr/local/lib/python3.5/dist-packages/picamera/

The pre-installed version (in Raspbian desktop) is managed by apt.
Community Manager - Raspberry Pi Foundation
Author of GPIO Zero and creator of piwheels

User avatar
B.Goode
Posts: 8849
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: picamera installation location varies - why?

Wed Mar 13, 2019 4:54 pm

ben_nuttall wrote:
Wed Mar 13, 2019 4:50 pm
If you install it with apt it ends up in /usr/lib/python3/dist-packages/picamera/

If you install it with pip it ends up in /usr/local/lib/python3.5/dist-packages/picamera/

The pre-installed version (in Raspbian desktop) is managed by apt.


With respect, that's just what @pootle said in the initial post...


I think the vital part of the question, to satisfy his curiosity and improve our understanding, was... Why?

pootle
Posts: 340
Joined: Wed Sep 04, 2013 10:20 am
Location: Staffordshire
Contact: Website

Re: picamera installation location varies - why?

Thu Mar 14, 2019 6:20 pm

ah! so if I apt install it, it should end in the same place - that would make life simpler...

User avatar
ben_nuttall
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 231
Joined: Sun Aug 19, 2012 11:19 am
Location: Cambridge, UK
Contact: Website

Re: picamera installation location varies - why?

Fri Mar 15, 2019 12:26 am

B.Goode wrote:
Wed Mar 13, 2019 4:54 pm
With respect, that's just what @pootle said in the initial post...
It's not. He said when it's pre-installed on Raspbian desktop, it's in A, when you install it on Raspbian Lite, it goes in B. I clarified that it depends how you install it, not which version of the OS you're on.
B.Goode wrote:
Wed Mar 13, 2019 4:54 pm
I think the vital part of the question, to satisfy his curiosity and improve our understanding, was... Why?
Why: because they're managed by different package managers, so install into their own managed locations, not touching each other.
Community Manager - Raspberry Pi Foundation
Author of GPIO Zero and creator of piwheels

Return to “Python”