Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installing EasyBuild with eb fails when it is using a python version different that the system python one #9151

Closed
migueldiascosta opened this issue Oct 17, 2019 · 4 comments
Milestone

Comments

@migueldiascosta
Copy link
Member

migueldiascosta commented Oct 17, 2019

seen in #9149, fails during the sanity check

edit: actual failure in sanity check looks like

Sanity check failed: no (non-empty) directory found at 'lib/python3.7/site-packages' in /tmp/software/EasyBuild/4.1.0"
@boegel
Copy link
Member

boegel commented Dec 11, 2019

This is a workaround for the problem when trying to install EasyBuild-4.1.0.eb with EB_PYTHON=python3, on a system where /usr/bin/python is the default Python (2.7).

diff --git a/easybuild/easyconfigs/e/EasyBuild/EasyBuild-4.1.0.eb b/easybuild/easyconfigs/e/EasyBuild/EasyBuild-4.1.0.eb
index 65b2ca298a..ad29c55181 100644
--- a/easybuild/easyconfigs/e/EasyBuild/EasyBuild-4.1.0.eb
+++ b/easybuild/easyconfigs/e/EasyBuild/EasyBuild-4.1.0.eb
@@ -41,4 +41,7 @@ sanity_check_paths = {
     'dirs': ['lib/python%s/site-packages' % local_pyshortver],
 }
 
+req_py_majver = 3
+modextravars = {'EB_PYTHON': '/usr/bin/python3'}
+
 moduleclass = 'tools'

The issue is related to the fact that the pick_python_cmd function in PythonPackage blatently ignores the Python being used to run eb with (sys.executable),

@boegel
Copy link
Member

boegel commented Dec 12, 2019

Just for future reference, using eb --install-latest-eb-release currently fails if EB_PYTHON=pyhton3 is used for example, while the default system python is Python 2.7, with:

== FAILED: Installation ended unsuccessfully (build directory: /tmp/EasyBuild/4.1.0/dummy-dummy): build failed (first 300 chars):
Sanity check failed: no (non-empty) directory found at 'lib/python3.6/site-packages' in /software/EasyBuild/4.1.0 (took 43 sec)

because:

[09:38:06] {skitty} vsc40023@node3112:~ $ ls /software/EasyBuild/4.1.0
bin  easybuild  etc  lib  lib64
[09:52:38] {skitty} vsc40023@node3112:~ $ ls /software/EasyBuild/4.1.0/lib/
python2.7
[09:52:42] {skitty} vsc40023@node3112:~ $ ls /software/EasyBuild/4.1.0/lib/python2.7/
site-packages
[09:52:44] {skitty} vsc40023@node3112:~ $ ls /software/EasyBuild/4.1.0/lib/python2.7/site-packages/
easybuild  easybuild_easyblocks-4.1.0-py2.7.egg-info  easybuild_easyconfigs-4.1.0-py2.7.egg-info  easybuild_framework-4.1.0-py2.7.egg-info  test

So basically the default system Python is used when installing EasyBuild, rather than the Python used to run eb.

The fix is probably to:

  • (first) consider sys.executable in pick_python_cmd
  • (always?) set $EB_PYTHON in the module generated for EasyBuild to make sure the Python used at runtime is the same as the one that was used during the installation

cc @jshelley

@boegel
Copy link
Member

boegel commented Jan 6, 2020

@boegel
Copy link
Member

boegel commented Jan 8, 2020

fixed now in develop since both PRs are merged, so closing...

@boegel boegel closed this as completed Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants