Python 3 in pfsense
-
We will have pfSense 2.5.0 snapshots available soon with Python 3.6, which you can use for testing then. No ETA, but very soon. We have only a few minor blockers to solve internally before they are ready for public testing.
[2.5.0-DEVELOPMENT][root@jack]/root: pkg info -x python python36-3.6.7 [2.5.0-DEVELOPMENT][root@jack]/root: python3.6 --version Python 3.6.7
-
Oh, that's great.
Few questions though, sorry fairly new to the forum.
1)Will it be within the month?
2)Is there any way I can sign up to receive a notification when it is released?
3)Will it be available to download like all the versions via https://www.pfsense.org/download/ ? -
-
The snapshots should be available soon, but we can't given an ETA. I'd expect them well before the end of the month, but no guarantees. The release will not be for some time yet after that, a few months, most likely.
-
I'm not sure where we will announce them, probably here on the forum and reddit at least. There might be a blog post, but probably not an announcement e-mail. It will probably be hard to miss when it happens.
-
Not from that URL, since it won't be a release for quite some time. Development snapshots are on https://snapshots.pfsense.org/
-
-
You can install python 3 from the from the official ports of FreeBSD 11. I did it several days ago.
For the installation you need the http path of the repo to install it. It is because pfsense has not all repos but only a tiny bit.Kalle
-
@kalle13 Sorry, what do you mean the http path of the repo. Any guide I can follow. I'm fairly new to this.
-
Read this for installation:
https://docs.netgate.com/pfsense/en/latest/packages/installing-freebsd-packages.html
and use these repos:
http://pkg.freebsd.org/freebsd:11:x86:64/latest/All/ -
@kalle13 said in Python 3 in pfsense:
and use these repos:
http://pkg.freebsd.org/freebsd:11:x86:64/latest/All/Just don't come crying when the next pfSense update fails.
-
@grimson Really? I did not know that. Is this for sure when I am installing other repos?
-
@kalle13 said in Python 3 in pfsense:
@grimson Really? I did not know that. Is this for sure when I am installing other repos?
It has happened in the past already.
-
He's right. Do not be surprised when that causes problems. Do not do that on a production system you care about.
-
On the other hand : if one is comfortable with installing from the standard FreeBSD repository, upgrading by re installing "from scratch" will be no issue at all.
-
@grimson Ok, thanks for your advice. I keep that in mind when the next upodate arrives. What can I do if the update fails?
-
@kalle13 Reinstall fresh, restore your xml config and then re-add the Python3 package. Plus, the update may not fail, but it may blow away your Python3 package and cause the things you need it for to break.
-
@kom Thanks for your advice!
-
Hi everyone, sorry for being this thread up again but what about python 2 in the meantime? I saw that there is already python 2 inside pfsense using "pkg info" but I am not able to run python commands. Do I need to do some sort of extraction?
-
@couldntmakeupone said in Python 3 in pfsense:
Hi everyone, sorry for being this thread up again but what about python 2 in the meantime? I saw that there is already python 2 inside pfsense using "pkg info" but I am not able to run python commands. Do I need to do some sort of extraction?
Python 2.7 is there and works fine, it just isn't in the
python
command, butpython2.7
. If you must have it available when typingpython
then make an alias or symlink. -
@jimp said in Python 3 in pfsense:
symlink.
So, can I just run python 2.7 programs in pfsense by using ./python.py?
-
If you edit the shabang line to use the correct path to the binary, yes. If you have more questions, please start your own thread as it isn't related to this topic.
-
To solve this I have created a public repo on GitHub with precompiled Python 3 binaries for specific releases of pfSense:
If you follow the instructions, it's a very straightforward process and will allow you to choose whatever Python 3 version works for you :)
-
@jwsi Thanks very much for this. I was wondering how to approach this issue.
I was wondering if I could simplify the installation procedure... I just want python3.6 for amd64, can I just download from github to /root on my pfSense box?
curl -L -o Python3.6_pfSense2.4.4-RELEASE-p3_amd64.txz https://github.com/ultrahorizon/pfSense-Python3/raw/master/2.4.4-RELEASE-p3/amd64/3.6.txz pkg add Python3.6_pfSense2.4.4-RELEASE-p3_amd64.txz
I'm assuming that it does not matter that I renamed the file Python3.6_pfSense2.4.4-RELEASE-p3_amd64.txz as long as I use the same file name in the pkg add command.
(Note the -L option since github redirects the URL obtained by saving the link on the download button.)I'm hoping this is OK so I don't need to clone the whole repo and install git.