maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   Python & Qt5 on Sailfish (https://talk.maemo.org/showthread.php?t=91049)

Dave999 2013-11-18 16:59

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?

thp 2013-11-18 17:37

Re: Python & Qt5 on Sailfish
 
Quote:

Originally Posted by NokiaN9KickYourAss (Post 1387302)
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?

Yes, to be able to use the native Sailfish Silica UI elements, you have to use Qt and QML. However, if you don't care that much about native integration, using something like OpenGL ES directly or PySDL2 or something would probably also work - but you'd be on your own there atm :)

mikecomputing 2013-11-18 18:00

Re: Python & Qt5 on Sailfish
 
Quote:

Originally Posted by rcolistete (Post 1387260)
Any experience here to be shared about submitting Python software to Jolla Harbour ?

Python is in the emulator However it only python2 so there is no pyotherside and so on :/

But I really Hope jolla adds pyhon3 and pyotherside as "public" in some update.

EmaNymton 2013-11-18 19:44

Re: Python & Qt5 on Sailfish
 
Quote:

Originally Posted by EmaNymton (Post 1387076)
I'm facing the same problem here, I need lxml for python 3. I'm not that expirienced in installing packages without using the repository. Is there any repo in the meantime, which I can use and if not, could you please describe a little more detailed what to do, so I can start coding? Thanks in advance!

To answer my own question, if anybody got the same problem.
Install python3-devel via zypper,
Code:

zypper in python3-devel
download lxml-versionX.tar.gz, extract it via
Code:

tar xfz lxml-versionX.tar.gz
change into that directory and build with
Code:

python3.3 setup.py build
If everthings went well, install it
Code:

python3.3 setup.py install
Code:

[root@SailfishEmul nemo]# python3                 
Python 3.3.2 (default, Aug 11 2013, 23:05:29)
[GCC 4.6.4 20130412 (Mer 4.6.4-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import lxml
>>> lxml
<module 'lxml' from '/usr/lib/python3.3/site-packages/lxml/__init__.py'>
>>>

But the question remains: Will there be a python3, pyotherside, python3-lxml package in the standard repos or will it be necessary to ship it separately?

mattaustin 2013-11-24 07:58

Re: Python & Qt5 on Sailfish
 
Quote:

Originally Posted by EmaNymton (Post 1387076)
I'm facing the same problem here, I need lxml for python 3. I'm not that expirienced in installing packages without using the repository. Is there any repo in the meantime, which I can use and if not, could you please describe a little more detailed what to do, so I can start coding? Thanks in advance!

Sorry for the late reply. I see you managed to install lxml anyway :)

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/

EmaNymton 2013-11-24 09:52

Re: Python & Qt5 on Sailfish
 
Thank you anyway, I tried that before, but got an ImportError when using
Code:

./pip install lxml
Code:

ImportError: No module named 'ssl_match_hostname'
After searching a little bit without finding a solution I build lxml from source.

rcolistete 2013-11-29 14:50

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:

Can I submit Python applications?
Currently not, there are some enablers missing for that. But we are working on it, to make that happen. You can support us with that effort, please ask in Nemo project how to help with Python.
I think thp's PyOtherSide will be promoted to a default Mer/Nemo/Sailfish repository so it will be available for any Python software.

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.

rcolistete 2013-11-29 14:51

Re: Python & Qt5 on Sailfish
 
Any tests on real Jolla smartphone with Python ???

xerxes2 2013-11-30 15:36

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.

rcolistete 2013-12-15 17:59

Re: Python & Qt5 on Sailfish
 
Quote:

Originally Posted by rcolistete (Post 1390685)
Any tests on real Jolla smartphone with Python ???

Tested on Sailfish @ Nokia N9 :

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-su
# ssu ar mer-tools
# ssu ur
$ pkcon refresh

mer-tools has many tools, including more Python modules, see here and there.

3) 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:

# zypper ar -G http://repo.merproject.org/obs/mer-python3/latest_armv7hl/mer-python3.repo
# zypper ref
# zypper in python3-base pyotherside-qml-plugin-python3-qt5 

Or my rcolistete repository with Python tools and modules (IPython, SymPy, NumPy, Uncertainties) :
PHP Code:

# zypper ar -G http://repo.merproject.org/obs/home:/rcolistete/latest_armv7hl/ rcolistete
# zypper ref
# zypper in ipython python-sympy python-numpy 

IPython shows a warning saying PySide is not available (needed for IPython Qt console), you can force installation by choosing "2", so "ipython" (terminal console) and "ipython notebook" will work (the Sailfish web browser works very well with IPython Notebook).
SymPy and NumPy also work well on Sailfish.


All times are GMT. The time now is 01:47.

vBulletin® Version 3.8.8