Re: [QGIS-Developer] External python package dependency in plugins

2019-06-21 Thread matteo
Hi Tom, I totally agree. Having a nice way to install external packages would be a great addition. Some times ago I was involved in a project that needed external packages and we developed an "in house" prototype, but it was far from ideal Cheers Matteo

Re: [QGIS-Developer] External python package dependency in plugins

2019-06-20 Thread Paolo Cavallini
Hi Tom, this is a feature several plugin authors would greatly appreciate. Cheers. Il 20 giugno 2019 15:01:08 EEST, Tom Chadwin ha scritto: >Hello all > >I'm resurrecting this thread to find out whether there have been any >developments. > >My situation: I'd like to tidy qgis2web's output via

Re: [QGIS-Developer] External python package dependency in plugins

2019-06-20 Thread Tom Chadwin
Hello all I'm resurrecting this thread to find out whether there have been any developments. My situation: I'd like to tidy qgis2web's output via BeautifulSoup, lsxml, or some such, but they are not installed (in my case under OSGeo4W). Is there any cross-platform way of installing Python

Re: [QGIS-Developer] External python package dependency in plugins

2018-07-10 Thread Tim Sutton
Hi > On 10 Jul 2018, at 08:03, Richard Duivenvoorde wrote: > > On 07/10/2018 06:15 AM, shiva reddy wrote: >> I don't think so. Since all plugins goes through approval mechanism, I >> think it is not unsafe. Rather increase the plugin user base. >> Even if we want to not allow this .In that

Re: [QGIS-Developer] External python package dependency in plugins

2018-07-10 Thread Richard Duivenvoorde
On 07/10/2018 06:15 AM, shiva reddy wrote: > I don't think so. Since all plugins goes through approval mechanism, I > think  it is not unsafe. Rather increase the plugin user base. > Even if we want to not allow this .In that case, We should have > mechanism by which QGIS itself does installation

Re: [QGIS-Developer] External python package dependency in plugins

2018-07-09 Thread shiva reddy
I don't think so. Since all plugins goes through approval mechanism, I think it is not unsafe. Rather increase the plugin user base. Even if we want to not allow this .In that case, We should have mechanism by which QGIS itself does installation of external dependencies based on approved plugin's

Re: [QGIS-Developer] External python package dependency in plugins

2018-07-09 Thread Nyall Dawson
On Sat, 7 Jul 2018 at 16:10, shiva reddy wrote: > > Hello, > I tried to install automatically during my pluign (QRealTime) installation by > calling: > > subprocess.call(['python','-m','install','pyxform','--user']) > > It worked many times in windows and it fails sometime. > It don't work in

Re: [QGIS-Developer] External python package dependency in plugins

2018-07-09 Thread shiva reddy
Hi, Finally I found following solution, which works in both windows and mac: import subprocess try: subprocess.call(['python3', '-m', 'pip', 'install','pyxform']) from pyxform.builder import create_survey_element_from_dict print('package is installed after python3')

Re: [QGIS-Developer] External python package dependency in plugins

2018-07-08 Thread Luke Pinner
My mistake. Importing pip is not supported and this functionality has been removed in pip>=10 https://pip.pypa.io/en/latest/user_guide/#using-pip-from-your-program On Sun., 8 Jul. 2018, 16:28 Luke Pinner, wrote: > Rather than using a subprocess and needing to figure out which pip/python >

Re: [QGIS-Developer] External python package dependency in plugins

2018-07-08 Thread shiva reddy
It does not work in python console of QGIS. pip have __main__() methot that too for internal use. Thanks & Regards Shiva Reddy K. Scientist/Engineer 'SD' Indian Institute of Remote Sensing, Indian Space Research Organisation Department of Space 4-Kalidas Road Dehradun mobile: 8791806093 On

Re: [QGIS-Developer] External python package dependency in plugins

2018-07-08 Thread Luke Pinner
Rather than using a subprocess and needing to figure out which pip/python etc., have you tried importing and using the pip module directly? Something like: import sys try: import matplotlib except: import pippip.main(['install', 'matplotlib'])import matplotlib Luke On Sun., 8

Re: [QGIS-Developer] External python package dependency in plugins

2018-07-08 Thread shiva reddy
Thanks, But it does not work in MacOS Thanks & Regards Shiva Reddy K. Scientist/Engineer 'SC' Indian Institute of Remote Sensing, Indian Space Research Organisation Department of Space 4-Kalidas Road Dehradun mobile: 8791806093 On Sun, Jul 8, 2018 at 11:12 AM Axel Andersson wrote: > Hi, > >

Re: [QGIS-Developer] External python package dependency in plugins

2018-07-07 Thread Axel Andersson
Hi, I added this to my code just 3 days ago :) import sys try: import matplotlib except: import subprocess print('installing matplotlib') subprocess.call([sys.exec_prefix + '/python', "-m", 'pip', 'install', 'matplotlib']) import matplotlib print('installation

Re: [QGIS-Developer] External python package dependency in plugins

2018-07-07 Thread Richard Duivenvoorde
On 07/07/2018 01:26 PM, shiva reddy wrote: > Thanks, > In OS X following works: > subprocess.call(['pip3','install','pyxform']) > > Does same works  works for Ubuntu/linux also? > > for windows, I am assuming 'python' refers to python 3 inside QGIS3. Yep: import subprocess

Re: [QGIS-Developer] External python package dependency in plugins

2018-07-07 Thread shiva reddy
Thanks, In OS X following works: subprocess.call(['pip3','install','pyxform']) Does same works works for Ubuntu/linux also? for windows, I am assuming 'python' refers to python 3 inside QGIS3. regards, Thanks & Regards Shiva Reddy K. Scientist/Engineer 'SC' Indian Institute of Remote

Re: [QGIS-Developer] External python package dependency in plugins

2018-07-07 Thread matteo
Hi, thanks for raining this issue and to provide this beautiful solution. Actually having plugin with external python lib dependencies was/is tricky especially for windows system (in my experience) > Now with QGIS3 we have true separated profiles, we an idea would be to > add a virtual

Re: [QGIS-Developer] External python package dependency in plugins

2018-07-07 Thread Richard Duivenvoorde
On 07/07/2018 08:11 AM, shiva reddy wrote: > Hello, > I tried to install automatically during my pluign (QRealTime) > installation by calling: > >  subprocess.call(['python','-m','install','pyxform','--user']) > > It worked many times in windows and it fails sometime. >

Re: [QGIS-Developer] External python package dependency in plugins

2018-07-07 Thread shiva reddy
minor correction: subprocess.call(['python','-m','pip','install','pyxform','--user']) Thanks & Regards Shiva Reddy K. Scientist/Engineer 'SC' Indian Institute of Remote Sensing, Indian Space Research Organisation Department of Space 4-Kalidas Road Dehradun mobile: 8791806093 On Sat, Jul 7, 2018

[QGIS-Developer] External python package dependency in plugins

2018-07-07 Thread shiva reddy
Hello, I tried to install automatically during my pluign (QRealTime) installation by calling: subprocess.call(['python','-m','install','pyxform','--user']) It worked many times in windows and it fails sometime. It don't work in OS X and I have not tested in ubuntu. What is the best practice