You are not logged in.
Hi, I've created a python env using pyenv and pyenv-virtualenv and I need to install python-opencv inside this enviroment using pacman. I know I can install opencv in python by using pip but this is not an option in this case. There is currently a conflict between opencv-python and PyQt5 (which I also need), and one way of solving this issue is uninstalling opencv-python and install python-opencv from the repositories. This worked on the default system python version, but as I mantain some python projects I need to use different enviroments.
I tried to
pacman -S python-opencvinside the activated env but it seems that pacman doesn't detect the env.
I also tried to install it after changing the global python with pyenv by doing:
pyenv global 3.8.6but it didn't work either.
Is it possible to install python-opencv in the current activated python env using pacman?
PD: I always confirmed the python version and it was the correct one in each case, I also tried removing (with the flag -Rs python-opencv) and reinstalling it ein each case.
Offline
Pacman will always install globally. If you need to override packages installed by pacman you need to install them to your user space in $HOME. Pacman will never install to $HOME.
Why is pip --user not an option? Is it that your python tries opencv-python preferentially over python-opencv?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
Pacman will always install globally. If you need to override packages installed by pacman you need to install them to your user space in $HOME. Pacman will never install to $HOME.
Hi, thx for your reply. So, you're saying it is imposible by using pacman? or there is a flag for that? (I did a quick search but it seems to be not possible)
EDIT: Reading the man page it seems that the -r is the one I need, but when I use it this is the output:
$ pacman -S python-opencv -r $HOME
error: failed to initialize alpm library:
(root: /home/MYUSERNAME, dbpath: /home/MYUSERNAME/var/lib/pacman/)
could not find or read directoryIt is not very clear to me if I need to "install pacman also in my $HOME" ? (sorry I'm very new to pacman)
Why is pip --user not an option? Is it that your python tries opencv-python preferentially over python-opencv?
Because they are tecnically different packages. opencv-python is the package from PyPI, while python-opencv is the package from the arch repository (in ubuntu for example it is call python3-opencv). Uninstalling opencv-python with pip and then installing python-opencv using a linux package manager solves the problem (of using opencv and PyQt5 together in python).
Last edited by morgado305 (2022-04-16 20:58:11)
Offline