[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Python subprocess fails to execute Pip-installed module / Packaging

From: Pradana Adrinusa AUMARS
Subject: Re: Python subprocess fails to execute Pip-installed module / Packaging Python Ray
Date: Sat, 12 Nov 2022 23:46:32 +0100

I'm in the process of packaging Ray for Python.

Here is the current SCM configuration:

(use-modules (guix packages)
             (guix download)
             ((guix licenses) #:prefix license:)
             (gnu packages python)
             (guix utils)
             (guix build-system python)
             (gnu packages linux)
             (gnu packages check)
             (gnu packages rpc)
             (gnu packages python-build)
             (gnu packages protobuf)
             (gnu packages machine-learning)
             (gnu packages python-science)
             (gnu packages python-web)
             (gnu packages python-xyz))

(define python-setproctitle
    (name "python-setproctitle")
    (version "1.2.2")
       (method url-fetch)
       (uri (pypi-uri "setproctitle" version))
    (build-system python-build-system)
       (modify-phases %standard-phases
         (replace 'check
           (lambda* (#:key tests? #:allow-other-keys)
             (setenv "PYTHON" (or (which "python3") (which "python")))
             (setenv "PYCONFIG" (if (which "python3-config")
                                    "python3-config --embed"
             (substitute* "tests/"
               (("cc") "gcc"))
             (when tests?
               (invoke "pytest" "tests/")))))))
     (list procps python-pytest))   ; required for tests
    (home-page "")
    (synopsis "")
    (description "")
    (license license:bsd-3)))

 (name "python-ray")
 (version "2.0.0")
   (method url-fetch)
   (uri (string-append 
""; version
 (build-system python-build-system)
    (modify-phases %standard-phases
                   (replace 'build
                            (lambda _
                              (invoke "python3" "python/" "build"))))))
  (list python-attrs
 (home-page "")
 (synopsis "")
 (license license:asl2.0))

When I build the package, pip tries to download from, even though it's written as an input in this
configuration. The output gives this error:

warning: build_py: byte-compiling is disabled, skipping.

running build_ext
WARNING: The directory '/homeless-shelter/.cache/pip' or its parent directory 
is not owned or is not writable by the current user. The cache has been 
disabled. Check the permissions and owner of that directory. If executing pip 
with sudo, you should use sudo's -H flag.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 
'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 
0x7ffff5a81b20>: Failed to establish a new connection: [Errno -2] Name or 
service not known')': /simple/psutil/
ERROR: Could not find a version that satisfies the requirement psutil (from 
versions: none)
ERROR: No matching distribution found for psutil

Has there been a similar issue with Python packages with psutil as an
input or with pip not properly finding dependencies like this?


Le dimanche 16 octobre 2022 à 20:53 +0200, Pradana Adrinusa AUMARS a
écrit :
> Thank you for the explanation, Ricardo,
> Thank you for the explanation Tobias,
> I tried a simple solution by finding where my "ld" is located with
> "whereis" and a symbolic link to "/lib64/".
> Unfortunately, I get an Error 80 which means it used a corrupted shared
> library.
> I think it's better to package Ray natively into Guix, but it's time-
> consuming since Ray is not a simple Python package. I was hoping for a
> temporary solution, but I don't think I can find one. I'll try to use
> another machine to make this project run.
> Thank you anyways.
> Le dimanche 16 octobre 2022 à 17:50 +0200, Tobias Geerinckx-Rice a
> écrit :
> > Hi Pradana,
> > 
> > Pradana Adrinusa AUMARS 写道:
> > > dynamically linked, interpreter /lib64/, for
> > 
> > And this file doesn't exist.
> > 
> > Prebuilt binary blobs don't mix well with Guix for this reason: 
> > they hard-code file names such as this one.
> > 
> > One (brand-)new work-around is
> > 
> >   $ guix shell -CF [PACKAGE…] [-- your command line]
> > 
> > E.g.,
> > 
> >   $ guix shell -CF -- ./hello # random binary downloaded from 
> >   Debian
> >   Hello, world!
> > 
> > which creates a virtual, backwards-compatible directory layout 
> > within the container.
> > 
> > This is a (glorious) hack, but it's no substitute for proper Guix 
> > packaging!
> > 
> > > outputs that bash cannot find this file.
> > 
> > That error is criminally misleading.  ‘A’ file, but not ‘this’ 
> > file.  :-/
> > 
> > Kind regards,
> > 
> > T G-R

reply via email to

[Prev in Thread] Current Thread [Next in Thread]