unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* no binary for interpreter `python' found in $PATH
@ 2021-10-30 21:06 Fredrik Salomonsson
  2021-10-30 21:35 ` Ricardo Wurmus
  0 siblings, 1 reply; 3+ messages in thread
From: Fredrik Salomonsson @ 2021-10-30 21:06 UTC (permalink / raw)
  To: help-guix


Hi Guix,

I'm trying to package up my simple python script for copying images from
my camera. But I'm encounter an issue when building, namely the
patch-shebangs phase does not find python and therefore skips patching
the shebang line.

Here's my definition
--8<----------------------------------------------------------------------------
(define-module (plt packages photo)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages python)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages man)
  )

(define-public picmover
  (package
    (name "picmover")
    (version "1.2.4")
    (source
     (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/plattfot/picmover")
           (commit (string-append "v" version))))
     (sha256
      (base32
       "1js9zlg2hzarkqwiadkmj7kk7dxvij2yjwlrf6xdbsa3ckym55yz"))
     (file-name (git-file-name name version))))
    (build-system gnu-build-system)
    (arguments
     '(#:tests? #f
       #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
       #:phases (modify-phases %standard-phases
                  (delete 'configure))))
    (native-inputs `())
    (inputs `(("python" ,python)
              ("man-db" ,man-db)))
    (propagated-inputs `(("python-pygobject" ,python-pygobject)
                         ("gexiv2" ,gexiv2)))
    (synopsis "Image and video importer/organizer")
    (description
     "Moving pictures and videos from one location to another, using
metadata to determine camera maker, model, date and location. Useful
for importing files from a camera.")
    (home-page "https://github.com/plattfot/picmover")
    (license license:gpl3+)))
---------------------------------------------------------------------------->8--

I ran it with:

--8<----------------------------------------------------------------------------

guix build -L ~/projects/plattfot-guix-channel/ picmover 

---------------------------------------------------------------------------->8--

(it's in my custom channel at the moment)

In the output when building I see:

--8<----------------------------------------------------------------------------
...
starting phase `patch-shebangs'
patch-shebang: /gnu/store/ddqy6n4br1snnv57cxybdmycgyc2h01f-picmover-1.2.4/bin/picmover: warning: no binary for interpreter `python' found in $PATH
phase `patch-shebangs' succeeded after 0.0 seconds
...
---------------------------------------------------------------------------->8--

And double checking with the output and it is indeed unpatched.

--8<----------------------------------------------------------------------------

head -1 $(guix build -L ~/projects/plattfot-guix-channel/ picmover)/bin/picmover
#! /usr/bin/env python

---------------------------------------------------------------------------->8--

I've probably missed something obvious in my package definition but I
cannot see what. Shouldn't the inputs field add python to the $PATH?
Does anyone know what I'm missing?

Thanks

-- 
s/Fred[re]+i[ck]+/Fredrik/g


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: no binary for interpreter `python' found in $PATH
  2021-10-30 21:06 no binary for interpreter `python' found in $PATH Fredrik Salomonsson
@ 2021-10-30 21:35 ` Ricardo Wurmus
  2021-10-30 22:57   ` Fredrik Salomonsson
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Wurmus @ 2021-10-30 21:35 UTC (permalink / raw)
  To: Fredrik Salomonsson; +Cc: help-guix

Hi Fredrik,

>     (inputs `(("python" ,python)
[…]
> patch-shebang: 
> /gnu/store/ddqy6n4br1snnv57cxybdmycgyc2h01f-picmover-1.2.4/bin/picmover: 
> warning: no binary for interpreter `python' found in $PATH
[…]
> I've probably missed something obvious in my package definition 
> but I
> cannot see what. Shouldn't the inputs field add python to the 
> $PATH?
> Does anyone know what I'm missing?

The “python” package only provides the “python3” executable, not 
“python”.  The “python-wrapper” package is just like the “python” 
package, except that it adds the “python” executable that upstream 
does not include in the default build of Python.

-- 
Ricardo


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: no binary for interpreter `python' found in $PATH
  2021-10-30 21:35 ` Ricardo Wurmus
@ 2021-10-30 22:57   ` Fredrik Salomonsson
  0 siblings, 0 replies; 3+ messages in thread
From: Fredrik Salomonsson @ 2021-10-30 22:57 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: help-guix


Hi Ricardo,

Ricardo Wurmus <rekado@elephly.net> writes:

> Hi Fredrik,
>
>>     (inputs `(("python" ,python)
> […]
>> patch-shebang: 
>> /gnu/store/ddqy6n4br1snnv57cxybdmycgyc2h01f-picmover-1.2.4/bin/picmover: 
>> warning: no binary for interpreter `python' found in $PATH
> […]
>> I've probably missed something obvious in my package definition 
>> but I
>> cannot see what. Shouldn't the inputs field add python to the 
>> $PATH?
>> Does anyone know what I'm missing?
>
> The “python” package only provides the “python3” executable, not 
> “python”.  The “python-wrapper” package is just like the “python” 
> package, except that it adds the “python” executable that upstream 
> does not include in the default build of Python.
>
> -- 
> Ricardo

Ah, that make sense. And switching to that, i.e

     (inputs `(("python" ,python-wrapper)

fixed the issue. Thank you for the help!

-- 
s/Fred[re]+i[ck]+/Fredrik/g


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-30 22:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-30 21:06 no binary for interpreter `python' found in $PATH Fredrik Salomonsson
2021-10-30 21:35 ` Ricardo Wurmus
2021-10-30 22:57   ` Fredrik Salomonsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).