Merged PRs on unified installer

I've been trying to update the unified installer to work with Plone 5.2.2 but keep running into errors like this:

Installing Plone 5.2.2 at /Users/kimadmin/Plone522

Creating Python virtual environment.

Failed to create virtual environment for /usr/bin/python

$ cat install.log 
Detailed installation log
Starting at Mon Sep  7 08:47:29 CDT 2020
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'virtualenv.py': [Errno 2] No such file or directory

or variations like that, whether on macOS or Ubuntu (18.04 LTS).

The 5.2.1 unified installer does not have that problem.

@agitator @jensens you merged some PRs at https://github.com/plone/Installers-UnifiedInstaller/commits/master

What am I missing?

When I look at the changes of the last commit: (https://github.com/plone/Installers-UnifiedInstaller/pull/106/commits/3807979e45ccfa6b3f5ba70494b0b539e8adea3d#diff-3f45a2f221d53f6133203525ced6b7dcL55)

virtualenv was upgraded from 16.X to 20.X in the main_install_script.sh . And the packge names where changd from pypa-virtualenv to virtualenv . Maybe that gives problems to install virtualenv on some systems/OS'es?

Well, virtualenv versions should be consistent. But if we need different virtualenv for different target systems, then we need to configure this universally here. For Windows and Ubuntu 20.04 the v16 was not sufficient IIRC. With all the changes done, the installer runs basically on Windows at least.

IMO the whole installer needs lots more love. It targets absolute beginners and so should be bulletproof.

I am happy to help here with setting up some basic build-testing with GH actions (later this week please).

Ok thanks for clarifying that. Have you uploaded these to launchpad? I will try to figure out how to have different dependencies but it would be good to indicate which platforms have been tested with

No, we just tested locally.

The problem is around this line

$SUDO "$WITH_PYTHON" virtualenv.py "$PY_HOME"  2>> "$INSTALL_LOG"

which expects a file virtualenv.py to be present after untar'ing the virtualenv-*.tgz. That is true for virtualenv 16 but not 20.

... wondering how this could even run on any OS if the file is missing

This is on Ubuntu 20.04 LTS:

$ ./install.sh --with-python=`which python3` standalone

Testing /usr/bin/python3 for Zope/Plone requirements....
/usr/bin/python3 looks OK. We will use it.

Rootless install method chosen. Will install for use by system user ubuntu


Detailed installation log being written to /home/ubuntu/Plone-5.2.2-UnifiedInstaller/insta
ll.log
Installing Plone 5.2.2 at /home/ubuntu/Plone

Creating Python virtual environment.

Failed to create virtual environment for /usr/bin/python3
ubuntu@ip-172-26-10-101:~/Plone-5.2.2-UnifiedInstaller$ cat install.log
Detailed installation log
Starting at Sat Sep 12 16:00:12 UTC 2020
/usr/bin/python3: can't open file 'virtualenv.py': [Errno 2] No such file or directory

On Windows 10. I guess this doesn't work with Python 2.

>python
Python 2.7.17 (v2.7.17:c2f86d86e6, Oct 19 2019, 21:01:17) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

>windows_install.bat standalone --password=admin

C:\Users\myuser\Downloads\Plone-5.2.2-UnifiedInstaller>python helper_scripts\windows_install.py standalone --password=admin
Traceback (most recent call last):
  File "helper_scripts\windows_install.py", line 11, in <module>
    from .i18n import _
ValueError: Attempted relative import in non-package

Same with Python 3.8.5... not sure what I'm missing on Windows.

I'm stuck at the moment: I don't have this 5.2.2 unified installer working on Ubuntu 20 LTS or Windows 10, so I don't have a working base from which to test my changes so that it will work on macOS or Ubuntu 18 LTS.

If I change the installer to use

readonly VIRTUALENV_TB=virtualenv-16.7.8.tar.gz
readonly VIRTUALENV_DIR=pypa-virtualenv-c85afa5

then it works on macOS and Ubuntu 20 LTS

...and on Ubuntu 18 LTS

I know that I don't like virtualenv 20 because I sometimes use virtualenv --clear to throw away old directories like bin and lib before creating the environment fresh. But with version 20 this throws away the entire current directory. I have been bitten by that a few times. Sure, a bump from 16 to 20 may mean breaking changes, but this is a bit too much breaking for me...
This particular problem does not explain the UniversalInstaller problems you see. But I don't mind staying at version 16.

I am happy that changes were done to get better support on Windows, but if that means it no longer works on Ubuntu and Mac, then this seems a good reason to revert.

The Plone 5.2.2 unified installer is now linked from plone.org/download (tested on macOS Catalina 10.15, Ubuntu 18.04 LTS, Ubuntu 20.04 LTS)

1 Like

I think the idea of virtualenv is to be complete reversible w/o having any side effects. Ergo, it's perfect to wipe the whole env on clear. So, our way of mixing virtualenv and buildout in one directory is probably wrong. I tend to avoid this, either by putting virtualenv in a ./py/ subdirectory or (on my machine) by using pyenv and pyenv-virualenv.

Plone Foundation Code of Conduct