qgis / QGIS-Website

QGIS-Website
129 stars 285 forks source link

Additions for Fedora, Opensuse and general Linux #1196

Open boredsquirrel opened 8 months ago

boredsquirrel commented 8 months ago

I started by adding up-to-date version infos for Fedora. Then I added the instructions for Toolbox and Distrobox, toolbox being standard on Fedora Atomic, Distrobox on Opensuse microOS but also working on Fedora Atomic.

These tools create containers of a Distro, so the QGis packages can be isolated from the host system.

GUI app entries are included in the explanations.


Then I added an instruction to add missing python dependencies using pip, under the main Linux chapter.

I also added a tutorial how to enforce XWayland, as Wayland shows a warning of missing features. This is opt-in but automated.

boredsquirrel commented 8 months ago

Question: This version number tables add unnecessary maintenance work. Just linking to a site having the version numbers would seem to make more sense.

Oh and I also added two ways to remove the Fedora COPR, as its deprecated and could cause conflicts

boredsquirrel commented 7 months ago

https://github.com/qgis/QGIS/issues/46031

Issue about the Wayland warning

frankbroniewski commented 4 months ago

Hello, whilst tackling https://github.com/qgis/QGIS-Website/issues/1224 I noticed the proposed changes in the documentation concerning Python package installation instructions.

Because I recently had to tackle Python package installations on OpenSuse, I learned about PEP668 and the implications on installing packages via pip. Hence I allowed myself to propose the following PR to describe Python module installation on Linux Systems: https://github.com/qgis/QGIS-Website/pull/1225

In short, PEP668 lets Linux system distributions forbid to install Python packages system wide via pip in order to maintain system integrity. It is encouraged instead to install Python packages in a virtual environment, which can be done via pipx, which should be widely available in the distribution's repository.

boredsquirrel commented 4 months ago

I am on Fedora Atomic and pip falls back to user installation automatically. pip install --user should do that.

Also cleaned up my additions a lot, should be way better now. Would be nice to have it merged or resolved soon.

frankbroniewski commented 4 months ago

No, unfortunately, pip install --user fails as well:

frank@schnipsel:~> pip install --user flask
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try
    zypper install python311-xyz, where xyz is the package
    you are trying to install.

[snip]

I tried OpenSuse Tumbleweed and Ubuntu 23.04. - on all of them pip install will fail with the above error message. Fedora does not yet implement PEP668, so that's why it is still working for you, but there's a proposal to integrate this as well. Arch based distros do seem to implement this already as well, as a quick Google search revealed.

You can still circumvent using pipx or a venv by passing the --break-system-packages flag to pip, but this probably scares people - as intended.

boredsquirrel commented 4 months ago

hmm,would you mind adding the best simple solution, using a venv called "qgis" for example? Didnt know this was only working on Fedora

frankbroniewski commented 4 months ago

Sure, I already made a PR https://github.com/qgis/QGIS-Website/pull/1225 for that, that got already accepted 🙂

I am a noob when it comes to venv, I always avoided them as unnecessary complication - that bites me in the back now 😁

I can only quote the message that comes up when I try to install a package via pip ... this basically just repeats the steps in my PR - just leaving out the python3.11 -m venv path/to/venv part, since I have no practical experience with it.

To install Python packages system-wide, try zypper install python311-xyz, where xyz is the package you are trying to install.

If you wish to install a non-rpm packaged Python package, create a virtual environment using python3.11 -m venv path/to/venv. Then use path/to/venv/bin/python and path/to/venv/bin/pip.

If you wish to install a non-rpm packaged Python application, it may be easiest to use pipx install xyz, which will manage a virtual environment for you. Install pipx via zypper install python311-pipx .

Theoretically, practically you just need to create a working directory for your project and

  1. python -m venv ~/qgis
  2. cd ~/qgis
  3. source bin/activate
  4. pip install PACKAGE
  5. and use an editor with venv support

which seems quite a hassle to me. pipx works just like pip, it just does some magic behind the scenes - so I use that instead of virtual environments ...

boredsquirrel commented 4 months ago

okay, @frankbroniewski didnt know how to rebase on your version and reapply my diffs, so I just copy-pasted your python instructions into my branch.

Should be ready to merge now.

frankbroniewski commented 4 months ago

Hey, no worries, I struggle all the time with git when manual merging is required or something else out of the ordinary 😁