chairemobilite / transition_qgis

MIT License
1 stars 4 forks source link

Installing external libraries with pip #22

Open davidmurray opened 3 months ago

davidmurray commented 3 months ago

The README file suggests installing the geojsonand pytransition libraries using pip: pip install pyTransition geojson

However, QGIS ships with its own copy of Python, so running this command in a general cmd prompt will not install the libraries for QGIS to use.

Based on https://gis.stackexchange.com/questions/282685/installing-external-python-packages-in-qgis-3, I had to:

  1. Open the Python console (Plugins -> Python Console)
  2. Run
    import pip
    pip.main(['install', 'geojson', 'pytransition'])
greenscientist commented 3 months ago

@davidmurray , On which OS / Distribution your are running? This might be true only for a few OSes.

davidmurray commented 3 months ago

Windows 10, QGIS 3.34

davidmurray commented 3 months ago

@greenscientist Actually, I think we should just use geopandas (which comes standard with QGIS) instead of depending on the geojson library

greenscientist commented 3 months ago

The current python library in transition use the geojson library, so we'd need to change it there. (But no objection to do that if it's comptatible)

greenscientist commented 3 months ago

Windows 10, QGIS 3.34

That's probably a windows-only issue, as it works well on Linux. We'll need to confirm on a mac.

tahini commented 3 months ago

@tibobliss mentioned he had to do the following to update the plugin from qgis:

import pip
pip.main(['install', '--trusted-host', 'pypi.org', '--trusted-host', 'files.pythonhosted.org', 'pip_system_certs'])

Et @greenscientist a ajouté "on dirait qu'on peut driver pip directement à partir du plugin. Ca pourrait être une solution pour installer le package transition avec le plugin. J'ai vu dans les forum d'autres plugin qui avait l'air de faire ça. ". Possible de mettre un lien vers ces forums?