Skip to content
This repository was archived by the owner on Sep 8, 2024. It is now read-only.

Conversation

gbaptista
Copy link
Contributor

@gbaptista gbaptista commented Nov 28, 2019

Description

When you have virtualenv installed trough pip in Arch Linux, the ./dev_setup.sh script does not works. The installation of python-virtualenvwrapper breaks because the files already exists. The ideal solution is to fix python-virtualenvwrapper installation for Arch. For now, the Mycroft setup script can check if the lib is already installed and skip it.

Update:

Actually, we do not need virtualenv anymore for Mycroft, the ideal solution is to remove this dependency.

This is related to "Error installing dependencies using pacman on Arch linux" #1967

How to test

Simulating the error

Create a Dockerfile with the following code:

FROM archlinux:20191105
RUN pacman -Sy --needed --noconfirm python python-pip
RUN pip install virtualen
RUN pacman -S --needed --noconfirm python-virtualenvwrapper

Try to build the Dockerfile with docker build .. You should see something like:

python-virtualenv: /usr/bin/virtualenv exists in filesystem
python-virtualenv: /usr/lib/python3.8/site-packages/__pycache__/virtualenv.cpython-38.pyc exists in filesystem
python-virtualenv: /usr/lib/python3.8/site-packages/virtualenv.py exists in filesystem
python-virtualenv: /usr/lib/python3.8/site-packages/virtualenv_support/__init__.py exists in filesystem
python-virtualenv: /usr/lib/python3.8/site-packages/virtualenv_support/__pycache__/__init__.cpython-38.pyc exists in filesystem
Errors occurred, no packages were upgraded.
The command '/bin/sh -c pacman -S --needed --noconfirm python-virtualenvwrapper' returned a non-zero code: 1

Simulating the solution

Create a Dockerfile with the following code:

FROM archlinux:20191105
RUN pacman -Sy --needed --noconfirm python python-pip
RUN pip install virtualenv

RUN command -v virtualenv &> /dev/null || ( \
		pacman -S --needed --noconfirm python-virtualenvwrapper\
	)

RUN virtualenv --version

Try to build the Dockerfile with docker build .. You should see something like:

 ---> Running in 0f04d3148914
16.7.8
Removing intermediate container 0f04d3148914
 ---> c14897eb88c1
Successfully built c14897eb88c1

The 16.7.8 message shows that the virtualenv is instaled in the version 16.7.8.

Real testing

Using an Arch Linux installation, install the virtualenv with pip running pip install virtualenv. Try to run the ./dev_setup.sh after that. The setup should finish with success, and you should be able to start Mycroft. I have tested the solution on my machine (Manjaro Linux) and works ok.

@devs-mycroft devs-mycroft added the CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) label Nov 28, 2019
@gbaptista gbaptista changed the title Fixing archlinux installation Fixing dev_setup.sh for Arch Linux Nov 28, 2019
@RiadVargas
Copy link

Nice! 👍

@forslund
Copy link
Collaborator

Question, can the virtualenvwrapper install be removed completely?

It's no longer used by the dev-setup (python 3's venv module is used instead) and the dependency has been removed from other OSes.

@forslund
Copy link
Collaborator

forslund commented Dec 5, 2019

So what do you guys think? Can the entire virtualenvwrapper dependency be dropped?

@gbaptista
Copy link
Contributor Author

Yes, it can be dropped. I remove the virtualenvwrapper from pip, the virtualenv from pacman, all installed python packages and the Mycroft installation to try to run the ./dev_setup.sh script again. It works fine, and I was able to start Mycroft successfully.

@forslund
Copy link
Collaborator

forslund commented Dec 5, 2019

Good to hear. Thank you for fixing this. Merging now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants