Python pip in TrueNAS?

Status
Not open for further replies.

shpokas

Dabbler
Joined
Oct 3, 2014
Messages
32
Hi,
anyone knows what has happened to pip in TrueNAS? It is not available in TrueNAS. It was available in FreeNAS.
An attempt to install it from pkg repo only offers pip for Python 3.7 which will mess up everything.
(I need pip to build borgmatic).
Thanks,
shpokas
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You should not install and build anything on FreeNAS/TrueNAS. You can install pip in a jail just fine. Note that support for Python 2.7 has ended on Dec 31st, though.
 

shpokas

Dabbler
Joined
Oct 3, 2014
Messages
32
Python pip is available in FreeNAS. What was the logic behind decision to remove it? Or should I file a bug?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
It was probably present because some part of FreeNAS depended on it. Or a leftover artefact of the build process.

Anyway I repeat: never install additional software on the NAS itself. Period. Don't. Use a jail.
 
Last edited:

shpokas

Dabbler
Joined
Oct 3, 2014
Messages
32
Yes, that's correct way.
So to use borg and borgmatic:
  • create a jail
  • mount a dataset in jail
  • mount external NFS storage in TrueNAS
  • mount the same NFS mounted directory in jail
  • install borg and borgmatic in jail (no need to compile anything, packages are available)
  • now borg data from dataset to borg repo on NFS storage
 

spacecabbie

Explorer
Joined
Aug 20, 2017
Messages
99
It was probably present because some part of FreeNAS depended on it. Or a leftover artefact of the build process.

Anyway I repeat: never install additional software on the NAS itself. Period. Don't. Use a jail.
And yet there are many situations where it is needed. But still people feel the need on the forum to refuse help and even prevent others to any that are working outside the almighty guidelines. Wasn't one of the philosophy's behind open source "respect for the users' freedom" ?

Hi,
anyone knows what has happened to pip in TrueNAS? It is not available in TrueNAS. It was available in FreeNAS.
An attempt to install it from pkg repo only offers pip for Python 3.7 which will mess up everything.
(I need pip to build borgmatic).
Thanks,
shpokas
To answer to the question itself: truenas is using python38 and the pip and many other packages are not in the tree yet you can get it how ever via:

Code:
root@freenas[~]# python -m ensurepip
Looking in links: /tmp/tmpz7_n28vo
Requirement already satisfied: setuptools in /usr/local/lib/python3.8/site-packages (44.0.0)
Processing /var/tmp/tmpz7_n28vo/pip-20.1.1-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-20.1.1

root@freenas[~]# python -m pip -V
pip 20.1.1 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)

Of course installing in A jail is recommended and preferred.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Wasn't one of the philosophy's behind open source "respect for the users' freedom" ?
Sure, when they can code the changes they want when it doesn't work as they hoped. ("you are free to fix it yourself if you don't like it", I think we can all respect that)

The system for creating a feature request and upvoting requests is there...

If something is "needed" and isn't there in an appliance, you need to understand that to remain supported, you can't just break the appliance to satisfy your need.

Without support, you can do whatever you are capable of doing and it will or won't work depending on your own abilities.

Some may help and/or board your ship, others may watch it sink (just as they said it would), few (but indeed some) may assist in saving the ship when it's sinking.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
And yet there are many situations where it is needed. But still people feel the need on the forum to refuse help and even prevent others to any that are working outside the almighty guidelines. Wasn't one of the philosophy's behind open source "respect for the users' freedom" ?

There are lots of things that get changed between the base FreeBSD distribution and the thing we know as FreeNAS/TrueNAS.

Your freedom is definitely there, because you have the source code and you are absolutely welcome to build your own version of TrueNAS if you disagree with stuff that the developers have done.

Respecting freedom is also different from doing your homework for you.

No one is refusing you help, but on the flip side, it's likely that no one actually knows why a decision was made not to have this on TrueNAS, or what exact steps would be required to build a version of TrueNAS with it.

Obviously no one prevented you from doing anything, since you go on to show a potential way to do this. So perhaps less melodrama...? It isn't some big conspiracy to deprive you of Python.

That having been said, it has always been the position of the developers that FreeNAS and TrueNAS is an appliance, and that users should not be modifying the base platform.

As the author of an entirely different FreeBSD-based appliance ecosystem, I would share my insights by saying that there are often good reasons for design decisions that you may not guess at. I get a fair level of questions about some of these from my userbase, and sometimes requests for changes, which are almost always declined, because they are invariably architecturally bad choices that introduce additional dependencies that I would prefer not exist. This usually means pushing such changes into the chroot or jail environments. For my userbase, I can (and do) generally provide them with a better solution as part of my answer.

Here, though, the users answering your question (including me) lack an insight into why the design decision was made. Dunno why it's not included. We do know that the intent is that you are not supposed to be installing things in the base platform, and that you should be using jails.
 

spacecabbie

Explorer
Joined
Aug 20, 2017
Messages
99
There are lots of things that get changed between the base FreeBSD distribution and the thing we know as FreeNAS/TrueNAS.

Your freedom is definitely there, because you have the source code and you are absolutely welcome to build your own version of TrueNAS if you disagree with stuff that the developers have done.
*snip*
Maybe you would be surprised, but I wholeheartedly agree from a design perspective definatly. However what's wrong with: "you can install pip like this...... But it's not supported whatsoever and you Will most likely break functionality." I have been annoyed with the great lengths people on the forum will go to attack (yes it feels like that) any mention or attempt to do something not recommended or out of scope. Fact is even though freenas might be intended for production a lot of home users and hobbyist use it, And it really feels like that last group is preferably excluded from freenas by the community here on the forum if that's not intended or a "conspiracy" but the feeling remains.
I do think its most likely the amount of users who know 0 to nothing and I do understand the urge to prevent them, because they will turn around and say well that didn't work its now broken and YOU are responsible and need to fix it. Still IMHO then say nothing its still there choice to do and please as they wish on their own systems, Just as it is your choice to not help them.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Well, look, it used to be that FreeNAS was distributed as a prebuilt filesystem on a 1GB boot device, and people would try to change things, problems would happen, and of course users rarely if ever disclose that they twiddled thing X before someone spends an hour of time spread over half a dozen back and forth messages before the user 'fesses up.

Then things changed to ZFS boot, and there are different problems that pop up, not least of which is that our default "fix" for a screwed up OS is to reload the thing. This turns into a problem as well, when people are doing something that they shouldn't.

Devices like ethernet switches often have a soft squishy *IX layer of some sort, but they aggressively protect themselves by making access to it wicked difficult (nearly impossible).

Devices like a Synology, QNAP, ESXi, your home NAT gateway, your smart TV, etc., also discourage access to their internals in various ways that make it pretty obvious not to mess around.

However, many people arrive here at FreeNAS/TrueNAS with a mild familiarity with Linux or FreeBSD, and naturally assume that since the product is based on FreeBSD, that the way to add a web server or other thing is to just use the same methods that would be used on any FreeBSD host. This is bad at best and potentially damaging and destructive. People who have done this may have corrupted their systems in bad ways, and even if they haven't yet run into problems, the next update may go sideways. I would bet that every longtime participant here has seen this repeatedly.

Longtime forum users recognize the hazard of a user who is pointing a loaded shotgun at their feet, and many will make a genuine effort to warn users off of such actions. This unfortunately collides with the fact that many people can't stand to be wrong, can't believe that they could be wrong, can't accept correction without also taking offense, just go out of their way to take offense, etc. Because this is a community forum, there's a limited number of contributors, and especially a limited number of frequent knowledgeable contributors.

My suggestion to you, then, is half of Postel's law ("be conservative in what you do, be liberal in what you accept from others.") Be liberal in what you accept from others. Instead of assuming the worst, that they're attacking you, perhaps it would be wise to consider that they have taken time out of their day to participate on the forum, and maybe they are trying in good faith to provide you with information that they believe that you need. Not everyone is the best at words, technical people in particular. Can what was said be taken in a manner that does not assume offense was meant? Then, by all means, please take it that way.
 

spacecabbie

Explorer
Joined
Aug 20, 2017
Messages
99
Well, look, it used to be that FreeNAS was distributed as a prebuilt filesystem on a 1GB boot device, and people would try to change things, problems would happen, and of course users rarely if ever disclose that they twiddled thing X before someone spends an hour of time spread over half a dozen back and forth messages before the user 'fesses up.

Then things changed to ZFS boot, and there are different problems that pop up, not least of which is that our default "fix" for a screwed up OS is to reload the thing. This turns into a problem as well, when people are doing something that they shouldn't.

Devices like ethernet switches often have a soft squishy *IX layer of some sort, but they aggressively protect themselves by making access to it wicked difficult (nearly impossible).

Devices like a Synology, QNAP, ESXi, your home NAT gateway, your smart TV, etc., also discourage access to their internals in various ways that make it pretty obvious not to mess around.
But you wil find that there are dozen sites out there dedicated to editing changing even cracking this.

However, many people arrive here at FreeNAS/TrueNAS with a mild familiarity with Linux or FreeBSD, and naturally assume that since the product is based on FreeBSD, that the way to add a web server or other thing is to just use the same methods that would be used on any FreeBSD host. This is bad at best and potentially damaging and destructive. People who have done this may have corrupted their systems in bad ways, and even if they haven't yet run into problems, the next update may go sideways. I would bet that every longtime participant here has seen this repeatedly.
Again no disagreement from me none at all. Changes made to freenas outside the webui wil eventually come back to bite you "IF you run production this is disastrous" we all agree on that.

Longtime forum users recognize the hazard of a user who is pointing a loaded shotgun at their feet, and many will make a genuine effort to warn users off of such actions. This unfortunately collides with the fact that many people can't stand to be wrong, can't believe that they could be wrong, can't accept correction without also taking offense, just go out of their way to take offense, etc. Because this is a community forum, there's a limited number of contributors, and especially a limited number of frequent knowledgeable contributors.
Nothing wrong with warning and I have to say. Many times people will say "you are not supposed to do that what is that you want to do ?" kudo's.
What i am anoyed/irritated about it when even wen poster states they know the risk but would like to anyway or worse even if what they are trying to do cannot be done with in a jail or freenas. the first post almost always is someone lecturing them about not doing it. I my self experianced this when i for got about the pkg.conf local and had only edited the Freebsd.conf one and mistakingly thought a question on the forum would quickly help me on my way.

My suggestion to you, then, is half of Postel's law ("be conservative in what you do, be liberal in what you accept from others.") Be liberal in what you accept from others. Instead of assuming the worst, that they're attacking you, perhaps it would be wise to consider that they have taken time out of their day to participate on the forum, and maybe they are trying in good faith to provide you with information that they believe that you need. Not everyone is the best at words, technical people in particular. Can what was said be taken in a manner that does not assume offense was meant? Then, by all means, please take it that way.
Funny enough I am on the spectrum people always concider me hostile while i never intent to be in persoon I am concidert a very open and friendly guy appearantly. Written comunication is not the easiest for me, its why I said it feels like that. I am direct in communicating but I never really angry.
 
Status
Not open for further replies.
Top