-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add Python path to be able to do import qgis in a simple Python inter… #266
Conversation
Dockerfile
Outdated
@@ -192,7 +192,8 @@ ENV QGIS_SERVER_LOG_STDERR=1 \ | |||
FCGID_IDLE_TIMEOUT=300 \ | |||
FCGID_IO_TIMEOUT=40 \ | |||
FILTER_ENV='' \ | |||
GET_ENV=env | |||
GET_ENV=env \ | |||
PYTHONPATH=./usr/local/share/qgis/python/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure about the leading dot in path ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oups, thanks :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this possible, maybe better ?
COPY --from=builder-server /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe the full /usr/lib/python3/
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arnaud-morvan
In the official Docker image they do the same kind of things:
https://github.com/qgis/QGIS/blob/master/.docker/qgis.dockerfile#L79
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, note QGIS is in loaded from /usr/lib/python3/dist-packages/qgis
$ docker run --rm -ti qgis/qgis:release-3_16 python3
Python 3.8.10 (default, Sep 28 2021, 16:10:42)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import qgis
>>> qgis
<module 'qgis' from '/usr/lib/python3/dist-packages/qgis/__init__.py'>
55e13ea
to
4528276
Compare
…preter