Hi Andreas,
On 28/08/2017 21:00, Andreas Hilboll wrote:
Hi Kennth,
Kenneth Hoste writes:
Hi Andreas,
On 25/08/2017 11:23, Andreas Hilboll wrote:
PS: I should add that this is a Python3-based easyconfig, so there is no
`pip` executable in Python/3.6.1-intel2017a; it is called `pip3`. Maybe
the PythonPackage easyblock should somehow check if the correct pip is
called pip or pip3?
I think is your actual problem...
When you specify "use_pip = True", EasyBuild only tries to use 'pip', it
doesn't take into account that it may need to use 'pip3' when Python 3
is being used...
When taking a look at the pull request you opened (thanks!), I started
looking into my own Python 3 installations that include pip to check on
things, and I do have both 'pip' and 'pip3' available, so I'm wondering
why you don't...
I think it's actually OK for EasyBuild to just use 'pip', since the
context it is using it in should be either Python 2 or Python 3, never a
mix of both.
If 'python' is Python 3.x, then 'pip' should be a pip installed on top
of that same Python 3.x, and so there should be no need to use 'pip3'
rather than 'pip'...
To be clear: I'm OK with enhancing the PythonPackage easyblock, but it's
not as easy as it sounds...
You need to take into account possible situations where you have 'pip',
'pip2' *and* 'pip3' available, where 1/3 is provided via the OS rather
than via EasyBuild, etc.
Also, after giving it some more thought, I'm not convinced it's a good
way to fix the problem you are seeing.
We should probably try and figure out why don't have a 'pip' command
available, and fix that issue instead...
regards,
Kenneth
The logic for this is in the generic PythonPackage easyblock [1].
Are you up for taking a stab to fix that?
sure, shouldn't be too hard.
Basically you need to do something like this when Python 3 is being used:
self.install_cmd = self.install_cmd.replace('pip', 'pip3')
This should probably be done in the 'prepare_python' method, since only
there the Python module used as a dependency will be loaded.
I opened an issue
(https://github.com/easybuilders/easybuild-easyblocks/issues/1232) with
some questions regarding the implementation.
Cheers,
Andreas