Open GuzTech opened 1 year ago
This behavior is more or less common to all distro since few month.
One solution is to add --break-system-packages
after pip install
Another solution is to create a file $HOME/.config/pip/pip.conf with
[global]
break-system-packages = true
Second solution is great because is not limited to litex_setup.py
but all users have to create this file, so maybe a small update to add argument looks better here.
How wise is it to potentially break system packages though? I do not know how realistic the odds are that some users will have issues if they use the break-system-packages
method.
The main risk is to have for the same package one installed by the pkg manager and one by pip, with different version. Depending directory order with PYTHON_PATH or something similar, users may have issue due to this situation. I use a gentoo distro (where everything is built from sources), I have already observed issues due to a pkg installed by pip.
Same here, but when trying to fix litex after a system update. Instead of calling litex_setup installing meson via pacman fixed my install.
I found with arch linux that --user is no longer allowed, but --editable (development) installs are actually still installed per user so not specifying --user fixed this for me.
This sounds like the effect of https://peps.python.org/pep-0668/ which various distributions start slowly rolling out.
This pushes virtual environments down the throat of the user, but solves other problems for the user as well.
Not sure this can be helped at the level of LiteX.
Running python -m venv ~/litex/.venv
then . ~/litex/.venv/bin/activate
before ./litex_setup.py
might be the fix.
If wanting to forget the fact that you use virtual environments, one way is to run python -m venv ~/.venv
and add this to the ~/.profile
:
if [ -f "$HOME/.venv/bin/activate" ]; then
. "$HOME/.venv/bin/activate"
fi
Then every pip
command would install things in ~/.venv instead of ~/.local, but besides than that, your system might work as it was before https://peps.python.org/pep-0668/ got enforced.
This behavior is more or less common to all distro since few month. One solution is to add
--break-system-packages
afterpip install
Another solution is to create a file $HOME/.config/pip/pip.conf with[global] break-system-packages = true
Second solution is great because is not limited to
litex_setup.py
but all users have to create this file, so maybe a small update to add argument looks better here.
Got exactly the same issue on a Debian 12 distro. Second solution proposed by @trabucayre works in my case.
I tried to run
./litex_setup.py --init --user -config=full
on a fully updated Arch box and during the installation of Git repositories step, I get the following error:So apparently some things with
pip
have changed and the recommended way to install packages is to usepipx
instead. I have modified thelitex_setup.py
script to usepipx
but then I get the following issue:I can actually install packages with
pipx
, but since (in this case) Migen is not an application,pipx
returns with error code 1. So I have modified the script further to not check the return code and with that change it now also installs properly. The relevant hacky changes tolitex_setup.py
can be found here: https://github.com/GuzTech/litex/compare/master...pipx-patch