![]() |
Re: Python & Qt5 on Sailfish
Thank you for this thread. I love python but I feel it's hard to create application UIs for Sailfish. Do I really have to use Cute/QML?
|
Re: Python & Qt5 on Sailfish
Quote:
|
Re: Python & Qt5 on Sailfish
Quote:
But I really Hope jolla adds pyhon3 and pyotherside as "public" in some update. |
Re: Python & Qt5 on Sailfish
Quote:
Install python3-devel via zypper, Code:
zypper in python3-develCode:
tar xfz lxml-versionX.tar.gzCode:
python3.3 setup.py buildCode:
python3.3 setup.py installCode:
[root@SailfishEmul nemo]# python3 |
Re: Python & Qt5 on Sailfish
Quote:
The way I was installing lxml was using 'virtualenv'. Once installed, a virtualenv for python3 can be created using 'virtualenv --python=python3'. Once activated, packages can be installed inside the virtualenv using pip (e.g. pip install lxml). More info at: http://www.virtualenv.org/en/latest/ |
Re: Python & Qt5 on Sailfish
Thank you anyway, I tried that before, but got an ImportError when using
Code:
./pip install lxmlCode:
ImportError: No module named 'ssl_match_hostname' |
Re: Python & Qt5 on Sailfish
About Python softwares running on Sailfish OS (with PyOtherSide or PyQt), the Jolla Harbour policy doesn't accept them for the moment :
https://harbour.jolla.com/faq Quote:
I also support PyQt 5 to be available in Mer/Nemo/Sailfish repository, as well as many Python tools (IPython, including notebook) and modules (NumPy, SymPy, etc). I will try to contact the Mer/Nemo community about this issue in the weekend. |
Re: Python & Qt5 on Sailfish
Any tests on real Jolla smartphone with Python ???
|
Re: Python & Qt5 on Sailfish
I made pyqt available for sailfish so anyone with a jphone can try it now with panucci:
http://talk.maemo.org/showpost.php?p...&postcount=563 Pyqt is very easy to build and the only dep it needs that is not available in sailfish already is sip so it wouldn't be much work to put it in a semi-official repo. Just poke me if you need working spec files for sip and pyqt. |
Re: Python & Qt5 on Sailfish
Quote:
1) Python is not installed by default, but it is simple to install v2.7.5 using Terminal : $ pkcon install python 2) mer-tools repository is not enabled by default, but can be : Code:
$ devel-su3) adding repositories is done with "zypper ar -G", because without the option "-G" (--no-gpgcheck, Disable GPG verification for this repository) the Jolla Store stops working (it can't install any software). For example, mer-python3 (with Python 3.3 and PyOtherSide) : PHP Code:
PHP Code:
SymPy and NumPy also work well on Sailfish. |
Re: Python & Qt5 on Sailfish
I will get my hands on a jp1 in a few days and will happily test both pyqt and pos apps. The sailfish python scene seems to be a bit dead atm so it can only get better from here. :) Will also check if openrepos work with the jp1.
|
Re: Python & Qt5 on Sailfish
Ok, I just got my jphone a few hours ago and after some fiddling with enabling dev mode I finally got zypper to work properly and installed pyqt and I can confirm that it works just fine. Now I'm thinking of creating a repo on openrepos called "sailfish-lib" as a place where we could put libs that are well tested and used by many different apps. Openrepos would be the right place for that yes/no?
Edit: So there's absolutely no excuse anymore for not porting all those opensource maemo/meego python apps to sailfish. |
Re: Python & Qt5 on Sailfish
Ok, I made an account on openrepos called sailfish_lib (dash doesn't seem to work) and put pyqt there.
https://openrepos.net/user/876/repository Anyone that knows what they're doing and want to add quality libs that are used by many apps can just pm me and I'll give you the password. |
Re: Python & Qt5 on Sailfish
I've started a Sailfish Python Development page over on the Mer wiki to try and collate the information/tools we've now got:
https://wiki.merproject.org/wiki/Sai...on_Development |
Re: Python & Qt5 on Sailfish
Where can I find pyotherside-qml-plugin-python3-qt5
|
Re: Python & Qt5 on Sailfish
Quote:
|
Re: Python & Qt5 on Sailfish
Quote:
|
Re: Python & Qt5 on Sailfish
I don't know, if this is new, but I just searched for python packages on my jolla:
http://pastebin.com/DdDCnbX8 Code:
[nemo@localhost ~]$ zypper info python-lxml |
Re: Python & Qt5 on Sailfish
Okay, I'm used to pyside but I thought I'd give pyotherside a go. Didn't start out well. Installed pyotherside-qml-plugin-python3-qt5 from repos, but now what? A simple
Code:
>>> import pyotherside |
Re: Python & Qt5 on Sailfish
Tried different python versions (although 3.3 should be the one) on both device and emulator, and nothing, no pyotherside module in sight. Can anyone help?
|
Re: Python & Qt5 on Sailfish
lol. now read docs: https://github.com/thp/pyotherside
|
Re: Python & Qt5 on Sailfish
I have. Now what?
|
Re: Python & Qt5 on Sailfish
You don't have to import pyotherside in the interpreter.
Just install the packages python3-base, pyotherside-qml-plugin-python3-qt5, qt5-qtdeclarative-qmlscene Then use some of the examples from the github repo to get starting, for example the events: https://github.com/thp/pyotherside/b...nts_example.py https://github.com/thp/pyotherside/b...ts_example.qml Change in the qml-file the line Code:
addImportPath(Qt.resolvedUrl('.'));Code:
addImportPath(Qt.resolvedUrl('.').substr('file://'.length));Then you can start it with Code:
/usr/lib/qt5/bin/qmlscene events_example.qmlHave fun! |
Re: Python & Qt5 on Sailfish
Thankyou kindly! That got things going! :D
|
Re: Python & Qt5 on Sailfish
Anyone else experiencing SSL/cert related problems with python3 on Sailfish OS?
I've now encountered problems in two different situations: 1) When creating a python3 virtualenv, I can't use pip to install anything: Code:
ImportError: No module named 'ssl_match_hostname'Code:
from _implementation import CertificateError, match_hostnameI'm attempting to write a NewsBlur client, and need to use the requests library, so this has me a bit stumped :(. EDIT 1: Possibly related: https://github.com/shazow/urllib3/issues/320 So it looks like the Python version in the repos might be compiled without SSL :(. EDIT 2: Looks like this pull request has been merged which will allow ssl: https://github.com/thp/mer-python3/issues/1 and https://github.com/nemomobile-packages/python3/pull/1. I'm not sure how to track when this reaches the mer/nemo/sailfish repos though - anyone have any tips? |
Re: Python & Qt5 on Sailfish
Quote:
Code:
[nemo@localhost ~]$ python |
Re: Python & Qt5 on Sailfish
Quote:
Code:
[nemo@localhost ~]$ python3 |
Re: Python & Qt5 on Sailfish
i guess someone ;) needs to build Python 3.3.5 ...
Code:
[nemo@localhost ~]$ python3 |
Re: Python & Qt5 on Sailfish
Quote:
Thanks! That will at allow me to continue development and testing on-device whilst (hopefully) an updated python3 is released as in the official repos. |
Re: Python & Qt5 on Sailfish
Among all the exciting warnings I get when I run an otherwise working pyotherside app:
Code:
[W] DeclarativeCoverWindow::DeclarativeCoverWindow:62 - DeclarativeCoverWindow: You should be calling QQuickWindow::setDefaultAlphaBuffer(true) before creating windows. Failing to do so will result in suboptimal performance. |
Re: Python & Qt5 on Sailfish
Quote:
As to how sailfish-qml works for Python applications, just install Helsinky Transit Live application from OpenRepos, which is based on PyOtherSide. Then you can inspect its desktop file in: Code:
/usr/share/applications/harbour-helsinki-transit-live.desktopCode:
/usr/share/harbour-helsinki-transit-live/ |
Re: Python & Qt5 on Sailfish
Interesting reading, honestly, but the problem is the Helsinky Transit Live app won't launch, and setting up the desktop file my app uses with sailfish-qml will make it not launch either. It'll only launch okay with qml-scene but I can't get the cover transparency to work...
AFAICT the Helsinky app doesn't seem to use transparent cover anyway. |
Re: Python & Qt5 on Sailfish
Hmm, it's weird, in emulator I get a transparent cover every time, on the device sometimes I get a black cover, sometimes I get no cover at all.
|
Re: Python & Qt5 on Sailfish
Tried to install pyotherside 1.2.0 according to instructions. "make" will give this error though:
Code:
Project MESSAGE: PYTHON_CONFIG = python3-config |
Re: Python & Qt5 on Sailfish
Quote:
"In case your system doesn’t provide python3-config, you might have to pass a suitable python-config to qmake at configure time: Code:
qmake PYTHON_CONFIG=python3.3-config |
Re: Python & Qt5 on Sailfish
Quote:
|
Re: Python & Qt5 on Sailfish
Quote:
You should also install the remaining QT files eg. do a zypper se for the missing QT files quick, qml, gui, core and install those |
Re: Python & Qt5 on Sailfish
Quote:
|
Re: Python & Qt5 on Sailfish
since you are building apps, yes, you need the devel packages
|
Re: Python & Qt5 on Sailfish
I get dependency problems with devel packages though. qt5-qtquick1-devel for example:
Code:
Problem: qt5-qtquick1-devel-5.1.0+git3-1.2.17.armv7hl requires pkgconfig(Qt5Gui), but this requirement cannot be providedEdit: And ofcourse now the apps I've allready made won't run anymore :D |
| All times are GMT. The time now is 01:47. |
vBulletin® Version 3.8.8