easybuilders / easybuild

EasyBuild - building software with ease
http://easybuild.io
GNU General Public License v2.0
461 stars 143 forks source link

ERROR: No compatible 'python' command found via $PATH (EasyBuild requires Python 2.6+ or 3.5+) #787

Closed chaseschuette closed 2 years ago

chaseschuette commented 2 years ago

Easybuild was pip installed system-wide on Ubuntu 18.04 with these currently env vars set.

PYTHONPATH="/apps/easybuild/lib/python2.7.17/site-packages" EB_PYTHON="/usr/bin/python3.6"

I also tried with EB_PYTHON="/usr/bin/python"

Here's some verbose output:

eb --install-latest-eb-release

Considering 'python'... 'python' version: 2.7.17, which matches Python 2 version requirement (>= 2.6) 'python' is NOT able to import 'easybuild.main', so NOT retaining it Considering 'python3'... 'python3' version: 3.6.5, which matches Python 3 version requirement (>= 3.5) 'python3' is NOT able to import 'easybuild.main', so NOT retaining it Considering 'python2'... 'python2' version: 2.7.17, which matches Python 2 version requirement (>= 2.6) 'python2' is NOT able to import 'easybuild.main', so NOT retaining it ERROR: No compatible 'python' command found via $PATH (EasyBuild requires Python 2.6+ or 3.5+)

I saw this relevant thread https://githubhot.com/repo/easybuilders/easybuild-framework/issues/3846

boegel commented 2 years ago

PYTHONPATH="/apps/easybuild/lib/python2.7.17/site-packages" EB_PYTHON="/usr/bin/python3.6"

This is definitely wrong: it should be python2.7/site-packages (just major.minor Python version), and if EasyBuild was installed with Python 2.x, you shouldn't tell it to run with Python 3.6, that may lead to tears.

To check what's going on, you should run without the eb wrapper script:

python -m easybuild.main

We've also discussed this in the EasyBuild Slack, and I think the problems you were seeing have been resolved, can you confirm?

chaseschuette commented 2 years ago

That was a typo in the python version.

However, it appears to be fixed with appending /apps/easybuild/lib/python2.7/site-packages to $PATH

eb --version

Considering '/usr/bin/python3.6'... '/usr/bin/python3.6' version: 3.6.5, which matches Python 3 version requirement (>= 3.5) '/usr/bin/python3.6' is NOT able to import 'easybuild.main', so NOT retaining it Considering 'python'... 'python' version: 2.7.17, which matches Python 2 version requirement (>= 2.6) 'python' is able to import 'easybuild.main', so retaining it Selected Python command: python (/usr/bin/python) python -m easybuild.main --version This is EasyBuild 4.5.3 (framework: 4.5.3, easyblocks: 4.5.3) on host XXX

There may be some unintended effects that I managed to workaround

boegel commented 2 years ago

I don't see how adding .../site-packages to $PATH can fix the problem, that doesn't make much sense to me...

This should do it for you:

export PYTHONPATH=/apps/easybuild/lib/python2.7/site-packages
export PATH=/apps/easybuild/bin:$PATH