I’m trying to install Mail-in-a-box on a brand new Ubuntu 22.04 vm on DigitalOcean.
The initial setup script fails at this step related to pip upgrade :
Installing Z-Push (Exchange/ActiveSync server)...
Installing Mail-in-a-Box system management daemon...
FAILED: /usr/local/lib/mailinabox/env/bin/pip install --upgrade pip
-----------------------------------------
setup/functions.sh: line 19: /usr/local/lib/mailinabox/env/bin/pip: No such file or directory
I looked into the directory, and it seems the expected path to pip might be incorrect.
The script attempts to call : /usr/local/lib/mailinabox/env/bin/pip
But the actual path to pip is : /usr/local/lib/mailinabox/env/local/bin/pip
Does the script need to be tweaked to get past this error? The installation doesn’t finish for me.
Looking through the scripts, I think I found where that path is declared
It is in the management.sh script from the cloned repo.
# Create a virtualenv for the installation of Python 3 packages
# used by the management daemon.
inst_dir=/usr/local/lib/mailinabox
mkdir -p $inst_dir
venv=$inst_dir/env
if [ ! -d $venv ]; then
hide_output virtualenv -ppython3 $venv
fi
I will try to manually modify the script with the correct path, and run it again.
This code in management.sh hasn’t changed in years. It looks like something might have changed in a recent Ubuntu package upgrade that has changed the behavior of python’s virtualenv creation.
It worked for me too.
Just in case if you are installing from non-root, then in my case worked:
export DEB_PYTHON_INSTALL_LAYOUT=‘deb’
sudo --preserve-env curl -s https://mailinabox.email/setup.sh | sudo -E bash
Actually I still cannot install Mailinabox on a vanilla VM. Tried all the previous suggestions.
I keep restoring a snapshot or re-deploying a vanilla VM with Ubuntu 22.04. Fails every time.
Either at the pip error : FAILED: /usr/local/lib/mailinabox/env/bin/pip install --upgrade pip
OR at the blinker error ERROR: Cannot uninstall 'blinker'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
Stil dead for me, even setting that env var & using preserve env (I’m on a non-root user)
Also just jumped into root, set env var there, and executed - still same error.
FAILED: /usr/local/lib/mailinabox/env/bin/pip install --upgrade pip │
-----------------------------------------┌─────────────────────────────────────────────────────────────────────────────────┐ │
setup/functions.sh: line 19: /usr/local/lib/mailinabox/env/bin/pip: No such file or directory```
Can you try completely removing the env directory that is there now, then setting the environment variable and running setup again? I’m thinking when management.sh runs, it won’t try to create the venv if it’s already there.
Installing Z-Push (Exchange/ActiveSync server)...
Installing Mail-in-a-Box system management daemon...
FAILED: /usr/local/lib/mailinabox/env/bin/pip install --upgrade pip
-----------------------------------------
setup/functions.sh: line 17: /usr/local/lib/mailinabox/env/bin/pip: No such file or directory
This probably isn’t the way to fix the problem but… I did: ln -s /usr/bin/pip /usr/local/lib/mailinabox/env/bin/pip pip install --ignore-installed blinker
HOWEVER now I’m running into an issue where no matter what email I specify when creating my first mail account I get “That’s not a valid email address”
I’m not familiar with the “blinker problem”, but your copying around of pip was probably ill-advised. For one, you didn’t copy the correct “pip” into the venv. Also, there’s more than just pip in the venv bin directory to consider.
If you’re not too far down the road with the install, I’d advise starting over and using the tactic of setting the environment variable that’s discussed above, which would be this:
The setup code tests if the venv dir is present and creates it if it is not present. So I would recommend that you try deleting the directory (or just moving it somewhere else out of the way) and running the setup again.