Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing external libraries with pip #22

Open
davidmurray opened this issue Jun 4, 2024 · 6 comments
Open

Installing external libraries with pip #22

davidmurray opened this issue Jun 4, 2024 · 6 comments

Comments

@davidmurray
Copy link

davidmurray commented Jun 4, 2024

The README file suggests installing the geojson and 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
Copy link
Contributor

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

@davidmurray
Copy link
Author

Windows 10, QGIS 3.34

@davidmurray
Copy link
Author

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

@greenscientist
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

tahini commented Jun 13, 2024

@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?

davidmurray pushed a commit to davidmurray/transition_qgis that referenced this issue Jul 12, 2024
…allation process in QGIS

Fixes chairemobilite#22. The wheel was packaged by simply running 'pip wheel .' in the pyTransition main folder. The wheel file for the 'requests' library is not included because this library comes with QGIS by default.
davidmurray pushed a commit to davidmurray/transition_qgis that referenced this issue Jul 12, 2024
…allation process in QGIS

Fixes chairemobilite#22. The wheel was packaged by simply running 'pip wheel .' in the pyTransition main folder. The wheel file for the 'requests' library is not included because this library comes with QGIS by default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants