install python 3

Don't miss a thing. Post your questions and discussion about other uncategorized NAS features here.
Post Reply
csawjer
Starting out
Posts: 10
Joined: Tue Mar 15, 2016 4:56 pm

install python 3

Post by csawjer » Sat Jan 04, 2020 11:10 pm

I have Python 2.7.5 installed on firmware version 4.4.1.1146
I try to uninstall Python in the Appcenter. After it finished I still find python 2.7.5 running.
Neither can I load python 3.
Help is welcome

csawjer
Starting out
Posts: 10
Joined: Tue Mar 15, 2016 4:56 pm

Re: install python 3

Post by csawjer » Sun Jan 05, 2020 1:22 am

Adding mor Information:
Notification tells me to execute /etc/profile.d/python3.bash
The result of executing this: "Permission denied"

User avatar
OneCD
Ask me anything
Posts: 7969
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: install python 3

Post by OneCD » Sun Jan 05, 2020 4:17 am

csawjer wrote:
Sun Jan 05, 2020 1:22 am
Notification tells me to execute /etc/profile.d/python3.bash
The result of executing this: "Permission denied"
Did you SSH into your NAS as the 'admin' user? Or under another account?

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage

morten-klitgaard
New here
Posts: 2
Joined: Thu Aug 02, 2018 4:48 pm

Re: install python 3

Post by morten-klitgaard » Wed Jan 15, 2020 5:49 pm

I Have the same issue..

After installing the Python 3.5.0.2 on my NAS TS-439Pro II+ with Firmware 4.2.6 and then SSH into the NAS with Admin rights i can't start Python 3 it still executes python 2.7

My problem could be that Python 2.7 is still present but i cant remove version 2.7 as malware remover program is ** on Python Version 2.7

Br
Morten K

User avatar
OneCD
Ask me anything
Posts: 7969
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: install python 3

Post by OneCD » Thu Jan 16, 2020 3:28 am

morten-klitgaard wrote:
Wed Jan 15, 2020 5:49 pm
After installing the Python 3.5.0.2 on my NAS TS-439Pro II+ with Firmware 4.2.6 and then SSH into the NAS with Admin rights i can't start Python 3 it still executes python 2.7
Please post your SSH session transcript. This must show your prompt, the command you typed, and the response from the shell.

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage

gotburger
New here
Posts: 5
Joined: Sat Feb 08, 2020 10:40 pm

Re: install python 3

Post by gotburger » Sat Feb 08, 2020 11:08 pm

Same type if problem here. Or even worse?

NAS Firmware is 4.4.1.

On my TS-832X I installed Python 3.6.3.1.1 (*for the first time*) using the App center. Here's the ssh session (showing version 2.7.5!):
----------------------------------------------------------------------
ssh -l admin <host>
admin@<host>'s password:
[~] # python
Python 2.7.5 (default, Dec 6 2019, 16:41:50)
[GCC 5.3.1 20160113] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
----------------------------------------------------------------------

User avatar
OneCD
Ask me anything
Posts: 7969
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: install python 3

Post by OneCD » Sun Feb 09, 2020 4:31 am

Hi and welcome to the forum. :)
gotburger wrote:
Sat Feb 08, 2020 11:08 pm
[~] # python
Python 2.7.5 (default, Dec 6 2019, 16:41:50)
[GCC 5.3.1 20160113] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
----------------------------------------------------------------------
This is expected behaviour.

If you execute 'python' in QTS, you'll get Python 2.7.x

QTS ships with Python 2.7.5.

If you install a later Python 2.7.x (like 2.7.15) and your $PATH allows the new version to be found first, then executing 'python' will run Python 2.7.15.

To run Python 3.x.x, you need to execute 'python3'.

But, specifically in QTS, you'll first need to source a shell-script that configures your current shell with environment variables for Py3.

To do this, execute:

Code: Select all

. /etc/profile.d/python3.bash
Then check your Py3 version:

Code: Select all

python3 -V 

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage

ed286
First post
Posts: 1
Joined: Sat Jun 27, 2020 2:13 am

Re: install python 3

Post by ed286 » Sun Jun 28, 2020 12:37 am

The execution bit of python3 is not set. In order to use it, run the command: chmod 777 /share/CACHEDEV1_DATA/.qpkg/Python3/src/bin/python3

AlastairStevenson
Experience counts
Posts: 2249
Joined: Wed Jan 08, 2014 10:34 pm

Re: install python 3

Post by AlastairStevenson » Sun Jun 28, 2020 4:53 am

chmod +x /share/CACHEDEV1_DATA/.qpkg/Python3/src/bin/python3 would target a little better than that buckshot method.
TS-431+ for storage and media and a bunch of IP cams under Surveillance Station. TVS-473 as files backup and QVR Pro.

User avatar
parkerc
Easy as a breeze
Posts: 296
Joined: Thu Oct 16, 2014 7:36 am
Location: Near London, England
Contact:

Re: install python 3

Post by parkerc » Fri Aug 28, 2020 4:40 pm

I followed the thread above after installing python3 via the AppStore - but how do I keep python3 running?

Every time I close my ssh session and go back in again python3 is not found again, and I have to go through all the steps again ?

Code: Select all

[~] # python -V
Python 2.7.5
[~] # python3 -V
-sh: python3: command not found
[~] # . /etc/profile.d/python3.bash                               
[~] # python3 -V                   
Python 3.5.2
[~] # chmod +x /share/CACHEDEV1_DATA/.qpkg/Python3/src/bin/python3
[~] # 
Model Name : QNAP TS-253be (16GB) & TS-453D (16GB)
Firmware Version:: QTS Latest
OS Version : Apple iOS (iPad/Safari Browser)
Number & Type of HDDs : 2 x 3TB WD Reds, Raid 1 & 4 x 4TB WD Reds, Raid 5
Website (When I have time) : http://www.nodecentral.co.uk

User avatar
OneCD
Ask me anything
Posts: 7969
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: install python 3

Post by OneCD » Fri Aug 28, 2020 4:46 pm

parkerc wrote:
Fri Aug 28, 2020 4:40 pm
... but how do I keep python3 running?
Python is an interpreter. It needs to be fed a Python script. ;)
parkerc wrote:
Fri Aug 28, 2020 4:40 pm
Every time I close my ssh session and go back in again python3 is not found again, and I have to go through all the steps again ?
No, not all. You do need to source the python3.bash file each time:

Code: Select all

[~] # . /etc/profile.d/python3.bash                               
... but you don't need to 'chmod' that python3 executable.

Edit your .profile to do this if sourcing the file manually becomes a pain.

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage

Post Reply

Return to “Miscellaneous”