YunoHost-Apps / kresus_ynh

Kresus (personal finance manager) for YunoHost
https://kresus.org/
GNU Affero General Public License v3.0
20 stars 20 forks source link

Conflict between virtualenv from pip (from an external installation) and apt #146

Closed Zen0man closed 7 months ago

Zen0man commented 1 year ago

Hello,

I failed to intaller kresus on yunohost.

Describe the bug

The installation script reports an error.

Context

Steps to reproduce

Expected behavior

Have kresus intalled in my yunohost instance

Logs

Here the log : https://paste.yunohost.org/raw/etasugukix

And the extra of le CLI : Choose the URL path (after the domain) where this app should be installed: / Info: Installing kresus... Info: [+...................] > Validating installation parameters... Info: [#+..................] > Storing installation settings... Info: [##+.................] > Finding an available port... Info: [###+................] > Installing dependencies... Info: [####+...............] > Configuring system user... Info: [#####+..............] > Creating a PostgreSQL database... Info: [######+.............] > Setting up source files... Info: [#######+............] > Configuring NGINX web server... Info: [########++..........] > Installing woob... Error: Unable to install kresus: An error occurred inside the app installation script Info: The operation 'Install the 'kresus' app' could not be completed. Please share the full log of this operation using the command 'yunohost log share 20221104-000228-app_install-kresus' to get help Warning: Here's an extract of the logs before the crash. It might help debugging the error: Info: DEBUG - + log_path=/var/log/nginx/nginx.log Info: DEBUG - + timeout=300 Info: DEBUG - + '[' reload == stop ']' Info: DEBUG - + '[' reload == reload ']' Info: DEBUG - + action=reload-or-restart Info: DEBUG - + systemctl reload-or-restart nginx Info: INFO - [########++..........] > Installing woob... Info: DEBUG - + locale-gen C.UTF-8 Info: DEBUG - Generating locales (this might take a while)... Info: DEBUG - en_US.UTF-8... done Info: DEBUG - Generation complete. Info: DEBUG - + update-locale C.UTF-8 Info: DEBUG - + ynh_exec_as kresus virtualenv --python=python3 --system-site-packages /var/www/kresus/venv Info: DEBUG - + local user=kresus Info: DEBUG - + shift 1 Info: DEBUG - ++ whoami Info: DEBUG - + [[ kresus = root ]] Info: DEBUG - + sudo -u kresus virtualenv --python=python3 --system-site-packages /var/www/kresus/venv Info: DEBUG - ModuleNotFoundError: No module named 'virtualenv.activation.xonsh' Info: DEBUG - + ynh_exit_properly Warning: Removing the app after installation failure... Info: [+...................] > Loading installation settings... Info: [#++.................] > Stopping and removing the systemd service... Info: [###++...............] > Removing logrotate configuration... Info: [#####++.............] > Removing the PostgreSQL database... Info: [#######++...........] > Removing app main directory... Info: [#########+..........] > Removing NGINX web server configuration... Info: [##########++........] > Removing dependencies... Info: [############++......] > Removing various files... Info: '/var/log/kresus' wasn't deleted because it doesn't exist. Info: [##############++....] > Removing the dedicated system user... Info: [####################] > Removal of kresus completed Error: The operation 'Install the 'kresus' app' could not be completed. Please share the full log of this operation using the command 'yunohost log share 20221104-000228-app_install-kresus' to get help

Thank for your helps.

nicofrand commented 1 year ago

Hi,

can you give the result of those commands please?

apt-cache policy python3-virtualenv apt-cache policy virtualenv pip3 show virtualenv pip show virtualenv

Zen0man commented 1 year ago

Here the results of the commands/Voici le résultat des commandes :

apt-cache policy python3-virtualenv python3-virtualenv: Installed: (none) Candidate: 20.4.0+ds-2+deb11u1 Version table: 20.4.0+ds-2+deb11u1 500 500 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages

apt-cache policy virtualenv virtualenv: Installed: (none) Candidate: 20.4.0+ds-2+deb11u1 Version table: 20.4.0+ds-2+deb11u1 500 500 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages

pip3 show virtualenv Name: virtualenv Version: 20.16.5 Summary: Virtual Python Environment builder Home-page: https://virtualenv.pypa.io/ Author: Bernat Gabor Author-email: gaborjbernat@gmail.com License: MIT Location: /usr/local/lib/python3.9/dist-packages Requires: distlib, platformdirs, filelock Required-by: pipenv

ip show virtualenv Name: virtualenv Version: 20.16.5 Summary: Virtual Python Environment builder Home-page: https://virtualenv.pypa.io/ Author: Bernat Gabor Author-email: gaborjbernat@gmail.com License: MIT Location: /usr/local/lib/python3.9/dist-packages Requires: distlib, platformdirs, filelock Required-by: pipenv

nicofrand commented 1 year ago

OK that's weird for virtualenv as it is defined as a dependency. Can you try apt install virtualenv and try again please?

Le 5 novembre 2022 00:25:21 Zen0man @.***> a écrit :

Here the results of the commands/Voici le résultat des commandes : apt-cache policy python3-virtualenv python3-virtualenv: Installed: (none) Candidate: 20.4.0+ds-2+deb11u1 Version table: 20.4.0+ds-2+deb11u1 500 500 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages apt-cache policy virtualenv virtualenv: Installed: (none) Candidate: 20.4.0+ds-2+deb11u1 Version table: 20.4.0+ds-2+deb11u1 500 500 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages pip3 show virtualenv Name: virtualenv Version: 20.16.5 Summary: Virtual Python Environment builder Home-page: https://virtualenv.pypa.io/ Author: Bernat Gabor Author-email: @. License: MIT Location: /usr/local/lib/python3.9/dist-packages Requires: distlib, platformdirs, filelock Required-by: pipenvip show virtualenv Name: virtualenv Version: 20.16.5 Summary: Virtual Python Environment builder Home-page: https://virtualenv.pypa.io/ Author: Bernat Gabor Author-email: @. License: MIT Location: /usr/local/lib/python3.9/dist-packages Requires: distlib, platformdirs, filelock Required-by: pipenv— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Zen0man commented 1 year ago

Hi,

I executed the command you sended me, here the result :

sudo apt install virtualenv Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: python3-distlib python3-filelock python3-importlib-metadata python3-more-itertools python3-virtualenv python3-zipp The following NEW packages will be installed: python3-distlib python3-filelock python3-importlib-metadata python3-more-itertools python3-virtualenv python3-zipp virtualenv 0 upgraded, 7 newly installed, 0 to remove and 4 not upgraded. Need to get 0 B/301 kB of archives. After this operation, 1,340 kB of additional disk space will be used. Do you want to continue? [Y/n] Y Selecting previously unselected package python3-distlib. (Reading database ... 71244 files and directories currently installed.) Preparing to unpack .../0-python3-distlib_0.3.2+really+0.3.1-0.1_all.deb ... Unpacking python3-distlib (0.3.2+really+0.3.1-0.1) ... Selecting previously unselected package python3-filelock. Preparing to unpack .../1-python3-filelock_3.0.12-2_all.deb ... Unpacking python3-filelock (3.0.12-2) ... Selecting previously unselected package python3-more-itertools. Preparing to unpack .../2-python3-more-itertools_4.2.0-3_all.deb ... Unpacking python3-more-itertools (4.2.0-3) ... Selecting previously unselected package python3-zipp. Preparing to unpack .../3-python3-zipp_1.0.0-3_all.deb ... Unpacking python3-zipp (1.0.0-3) ... Selecting previously unselected package python3-importlib-metadata. Preparing to unpack .../4-python3-importlib-metadata_1.6.0-2_all.deb ... Unpacking python3-importlib-metadata (1.6.0-2) ... Selecting previously unselected package python3-virtualenv. Preparing to unpack .../5-python3-virtualenv_20.4.0+ds-2+deb11u1_all.deb ... Unpacking python3-virtualenv (20.4.0+ds-2+deb11u1) ... Selecting previously unselected package virtualenv. Preparing to unpack .../6-virtualenv_20.4.0+ds-2+deb11u1_all.deb ... Unpacking virtualenv (20.4.0+ds-2+deb11u1) ... Setting up python3-more-itertools (4.2.0-3) ... Setting up python3-filelock (3.0.12-2) ... Setting up python3-distlib (0.3.2+really+0.3.1-0.1) ... Setting up python3-zipp (1.0.0-3) ... Setting up python3-importlib-metadata (1.6.0-2) ... Setting up python3-virtualenv (20.4.0+ds-2+deb11u1) ... Setting up virtualenv (20.4.0+ds-2+deb11u1) ... Processing triggers for man-db (2.9.4-2) ...

Apparently I was missing some python dependence.

But unfortunately kresus still does not fit. Here is the link of the log :

https://paste.yunohost.org/raw/itulisezob

nicofrand commented 1 year ago

There might be a conflict with the version installed through pip...

Le 5 novembre 2022 11:40:26 Zen0man @.***> a écrit :

Hi, I executed the command you sended me, here the result : udo apt install virtualenv Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: python3-distlib python3-filelock python3-importlib-metadata python3-more-itertools python3-virtualenv python3-zipp The following NEW packages will be installed: python3-distlib python3-filelock python3-importlib-metadata python3-more-itertools python3-virtualenv python3-zipp virtualenv 0 upgraded, 7 newly installed, 0 to remove and 4 not upgraded. Need to get 0 B/301 kB of archives. After this operation, 1,340 kB of additional disk space will be used. Do you want to continue? [Y/n] Y Selecting previously unselected package python3-distlib. (Reading database ... 71244 files and directories currently installed.) Preparing to unpack .../0-python3-distlib_0.3.2+really+0.3.1-0.1_all.deb ... Unpacking python3-distlib (0.3.2+really+0.3.1-0.1) ... Selecting previously unselected package python3-filelock. Preparing to unpack .../1-python3-filelock_3.0.12-2_all.deb ... Unpacking python3-filelock (3.0.12-2) ... Selecting previously unselected package python3-more-itertools. Preparing to unpack .../2-python3-more-itertools_4.2.0-3_all.deb ... Unpacking python3-more-itertools (4.2.0-3) ... Selecting previously unselected package python3-zipp. Preparing to unpack .../3-python3-zipp_1.0.0-3_all.deb ... Unpacking python3-zipp (1.0.0-3) ... Selecting previously unselected package python3-importlib-metadata. Preparing to unpack .../4-python3-importlib-metadata_1.6.0-2_all.deb ... Unpacking python3-importlib-metadata (1.6.0-2) ... Selecting previously unselected package python3-virtualenv. Preparing to unpack .../5-python3-virtualenv_20.4.0+ds-2+deb11u1_all.deb ... Unpacking python3-virtualenv (20.4.0+ds-2+deb11u1) ... Selecting previously unselected package virtualenv. Preparing to unpack .../6-virtualenv_20.4.0+ds-2+deb11u1_all.deb ... Unpacking virtualenv (20.4.0+ds-2+deb11u1) ... Setting up python3-more-itertools (4.2.0-3) ... Setting up python3-filelock (3.0.12-2) ... Setting up python3-distlib (0.3.2+really+0.3.1-0.1) ... Setting up python3-zipp (1.0.0-3) ... Setting up python3-importlib-metadata (1.6.0-2) ... Setting up python3-virtualenv (20.4.0+ds-2+deb11u1) ... Setting up virtualenv (20.4.0+ds-2+deb11u1) ... Processing triggers for man-db (2.9.4-2) ...Apparently I was missing some python dependence. But unfortunately kresus still does not fit. Here is the link of the log :https://paste.yunohost.org/raw/itulisezob — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

kedare commented 1 year ago

I get the same issue, full logs: https://paste.yunohost.org/raw/uxifihedir

nicofrand commented 1 year ago

Can you try to install virtualenv @kedare?

Also

apt-cache policy virtualenv
pip3 show virtualenv
which virtualenv
matthewspangler commented 1 year ago

I had the same problem. Same error message. pip uninstall virtualenv and relying on the virtualenv package provided through apt worked for me.

nicofrand commented 1 year ago

Thank you for the feedback @matthewspangler!

As a package maintainer I don't think there is anything I can do to resolve this conflict, I cannot uninstall the pip version of virtualenv, which might have been installed by another package.