unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Install python pacakge from `.whl` file
@ 2021-07-10 10:41 Hamzeh Nasajpour
  2021-07-10 12:56 ` Hamzeh Nasajpour
  0 siblings, 1 reply; 2+ messages in thread
From: Hamzeh Nasajpour @ 2021-07-10 10:41 UTC (permalink / raw)
  To: SuarezMiguelC via

Hi,

I have to package a python library via `whl` file, is it feasible? 
I took a look in the guix packages, and found something in `tensorflow` package to installing from `whl` file,
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/machine-learning.scm#n1784

but I get these errors when I want to install my package. I'm using the following lines in my package definition too:
```
...
                     (invoke "python3" "-m" "pip" "install" source
                       (string-append "--prefix=" %output))
...
```

Error:
```
WARNING: The directory '/homeless-shelter/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/homeless-shelter/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Processing /gnu/store/pbv52yan4xnwbi426qywcfkls681k3lg-etebase-0.31.2-cp38-cp38-manylinux2010_x86_64.whl
Collecting msgpack>=1.0.0 (from pbv52yan4xnwbi426qywcfkls681k3lg==etebase)
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffff6c443a0>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/msgpack/
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffff6c445b0>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/msgpack/
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffff6c44280>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/msgpack/
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffff6c30280>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/msgpack/
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffff6c30580>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/msgpack/
  ERROR: Could not find a version that satisfies the requirement msgpack>=1.0.0 (from pbv52yan4xnwbi426qywcfkls681k3lg==etebase) (from versions: none)
ERROR: No matching distribution found for msgpack>=1.0.0 (from pbv52yan4xnwbi426qywcfkls681k3lg==etebase)
Backtrace:
           3 (primitive-load "/gnu/store/0ab4p5n88lzdlgq6jwb5qi9nw52?")
In ice-9/eval.scm:
   191:35  2 (_ #f)
    619:8  1 (_ #(#(#(#(#(#(#(#<directory (guil?> ?) ?) ?) ?) ?) ?) ?))
In guix/build/utils.scm:
    654:6  0 (invoke _ . _)

guix/build/utils.scm:654:6: In procedure invoke:
ERROR:
  1. &invoke-error:
      program: "python3"
      arguments: ("-m" "pip" "install" "/gnu/store/pbv52yan4xnwbi426qywcfkls681k3lg-etebase-0.31.2-cp38-cp38-manylinux2010_x86_64.whl" "--prefix=/gnu/store/18vg8h9yh2a3f6vlqn2kcxhbrfzrchns-python-etebase-0.31.2")
      exit-status: 1
      term-signal: #f
      stop-signal: #f
````
--

Hamzeh Nasajpour
PantherX Team


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

* Re: Install python pacakge from `.whl` file
  2021-07-10 10:41 Install python pacakge from `.whl` file Hamzeh Nasajpour
@ 2021-07-10 12:56 ` Hamzeh Nasajpour
  0 siblings, 0 replies; 2+ messages in thread
From: Hamzeh Nasajpour @ 2021-07-10 12:56 UTC (permalink / raw)
  To: SuarezMiguelC via

Ok, I updated the package definition as follow:

```
(define-public python-etebase
  (package
    (name "python-etebase")
    (version "0.31.2")
    (source (origin
             (method url-fetch)
             (uri (string-append "https://github.com/etesync/etebase-py/releases/download/v0.31.2/etebase-" version "-cp38-cp38-manylinux2010_x86_64.whl"))
             (sha256
              (base32
               "09vw2922bfb0b8s2k0hs7skcrplwxkn4vfl9bcla6hbr92paigd7"))))
    (build-system trivial-build-system)
    (arguments
     `(#:modules ((guix build utils))
       #:builder (begin
                   (use-modules (guix build utils)
                                (srfi srfi-26))
                   (let* ((source     (assoc-ref %build-inputs "source"))
                          (bash       (assoc-ref %build-inputs "bash"))
                          (coreutils  (assoc-ref %build-inputs "coreutils"))
                          (python     (assoc-ref %build-inputs "python")))
                     (setenv "PATH" (string-append 
                                      (string-append bash       "/bin:")
                                      (string-append coreutils  "/bin:")
                                      (string-append python     "/bin:")))
                     (invoke "python3" "-m" "pip" "install"  source
                              (string-append "--prefix=" %output) 
                              "--no-deps"
                              (string-append "--cache-dir=" %output))
					 #t))))
  (native-inputs `(("coreutils" ,coreutils)
                    ("python" ,python-3)
                    ("python-msgpack", python-msgpack)))
	(inputs `(("bash" ,bash)))
	(home-page "https://www.etesync.com/")
    (synopsis "A Python library for Etebase")
    (description
     "This package is implemented in Rust and exposes a Python API for people to use.")
    (license license:expat)))
```

And currently I face with this error:

```
...
building /gnu/store/05bf6g974sjfl5kg2xkcs6ciiv4l9y67-python-etebase-0.31.2.drv...
Processing /gnu/store/g12ckz8jmmzmxf8bsjqxb2zksghf0x31-etebase-0.31.2-cp38-cp38-manylinux2010_x86_64.whl
Installing collected packages: g12ckz8jmmzmxf8bsjqxb2zksghf0x31
ERROR: Exception:
Traceback (most recent call last):
  File "/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 188, in main
    status = self.run(options, args)
  File "/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 398, in run
    installed = install_given_reqs(
  File "/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python3.8/site-packages/pip/_internal/req/__init__.py", line 54, in install_given_reqs
    requirement.install(
  File "/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 925, in install
    self.move_wheel_files(
  File "/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 453, in move_wheel_files
    wheel.move_wheel_files(
  File "/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python3.8/site-packages/pip/_internal/wheel.py", line 434, in move_wheel_files
    assert info_dir, "%s .dist-info directory not found" % req
AssertionError: g12ckz8jmmzmxf8bsjqxb2zksghf0x31==etebase .dist-info directory not found
Backtrace:
           3 (primitive-load "/gnu/store/vvgbg88axkan45hc0ahvska8y37?")
In ice-9/eval.scm:
   191:35  2 (_ _)
    619:8  1 (_ #(#(#(#(#<directory (guile-user) 7ffff3b?> ?) ?) ?) ?))
In guix/build/utils.scm:
    654:6  0 (invoke _ . _)

guix/build/utils.scm:654:6: In procedure invoke:
ERROR:
  1. &invoke-error:
      program: "python3"
      arguments: ("-m" "pip" "install" "/gnu/store/g12ckz8jmmzmxf8bsjqxb2zksghf0x31-etebase-0.31.2-cp38-cp38-manylinux2010_x86_64.whl" "--prefix=/gnu/store/m5a2yq2pdn6xkbmz7v9s18p0qwnrnqf8-python-etebase-0.31.2" "--no-deps" "--cache-dir=/gnu/store/m5a2yq2pdn6xkbmz7v9s18p0qwnrnqf8-python-etebase-0.31.2")
      exit-status: 2
      term-signal: #f
      stop-signal: #f
```



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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-10 10:41 Install python pacakge from `.whl` file Hamzeh Nasajpour
2021-07-10 12:56 ` Hamzeh Nasajpour

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).