unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: "Sébastien Lerique" <sl@eauchat.org>
To: help-guix@gnu.org
Subject: Python, poetry, and pandas
Date: Wed, 10 Mar 2021 16:38:38 +0900	[thread overview]
Message-ID: <87pn0731c1.fsf@eauchat.org> (raw)

Dear all,

In the course of trying out poetry for data science projects on 
guix, I am running into the problem of some poetry-installed 
packages not finding their desired libraries. (See example below 
with pandas.) I suppose this is because poetry will download 
pre-built binary wheels which have pre-coded library paths.

If this is the problem, would there be any clean way to wrap those 
binary wheels, or patch poetry-on-guix to mandatorily rebuild 
binaries? (Would that make sense?)

(I am aware that python-pandas is packaged for guix, but some 
packages I will need down the road might not be; this project is 
also in collaboration with non guix users, so I am looking for a 
workflow which will work for them too.)

(I am also aware of guix-jupyter, but that is another topic I'd 
like to return to later as it needs some more bugsquashing for 
usability.)

Happy hacking!
Sébastien

#+BEGIN_SRC
$ poetry new poetry-test

Created package poetry_test in poetry-test
$ cd poetry-test/
$ poetry add pandas
Creating virtualenv poetry-test-vOWX4_Vr-py3.8 in 
/home/sl/.cache/pypoetry/virtualenvs
Using version ^1.2.3 for pandas

Updating dependencies
Resolving dependencies... (0.2s)

Writing lock file

Package operations: 4 installs, 9 updates, 0 removals

  • Updating pyparsing (2.4.6 
  /home/sl/.guix-profile/lib/python3.8/site-packages -> 2.4.7)
  • Updating six (1.14.0 
  /home/sl/.guix-profile/lib/python3.8/site-packages -> 1.15.0)
  • Updating attrs (19.3.0 
  /home/sl/.guix-profile/lib/python3.8/site-packages -> 20.3.0)
  • Updating more-itertools (8.2.0 
  /home/sl/.guix-profile/lib/python3.8/site-packages -> 8.7.0)
  • Updating numpy (1.17.3 
  /home/sl/.guix-profile/lib/python3.8/site-packages -> 1.20.1)
  • Updating packaging (20.0 
  /home/sl/.guix-profile/lib/python3.8/site-packages -> 20.9)
  • Installing pluggy (0.13.1)
  • Installing py (1.10.0)
  • Updating python-dateutil (2.8.1 
  /home/sl/.guix-profile/lib/python3.8/site-packages -> 2.8.1)
  • Updating pytz (2020.4 
  /home/sl/.guix-profile/lib/python3.8/site-packages -> 2021.1)
  • Updating wcwidth (0.1.8 
  /home/sl/.guix-profile/lib/python3.8/site-packages -> 0.2.5)
  • Installing pandas (1.2.3)
  • Installing pytest (5.4.3)
$ poetry run which python
/home/sl/.cache/pypoetry/virtualenvs/poetry-test-vOWX4_Vr-py3.8/bin/python
$ poetry run python
Python 3.8.2 (default, Jan  1 1970, 00:00:01)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more 
information.
>>> import pandas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File 
  "/home/sl/.cache/pypoetry/virtualenvs/poetry-test-vOWX4_Vr-py3.8/lib/python3.8/site-packages/pandas/__init__.py", 
  line 51, in <module>
    from pandas.core.api import (
  File 
  "/home/sl/.cache/pypoetry/virtualenvs/poetry-test-vOWX4_Vr-py3.8/lib/python3.8/site-packages/pandas/core/api.py", 
  line 31, in <module>
    from pandas.core.groupby import Grouper, NamedAgg
  File 
  "/home/sl/.cache/pypoetry/virtualenvs/poetry-test-vOWX4_Vr-py3.8/lib/python3.8/site-packages/pandas/core/groupby/__init__.py", 
  line 1, in <module>
    from pandas.core.groupby.generic import DataFrameGroupBy, 
    NamedAgg, SeriesGroupBy
  File 
  "/home/sl/.cache/pypoetry/virtualenvs/poetry-test-vOWX4_Vr-py3.8/lib/python3.8/site-packages/pandas/core/groupby/generic.py", 
  line 65, in <module>
    from pandas.core.frame import DataFrame
  File 
  "/home/sl/.cache/pypoetry/virtualenvs/poetry-test-vOWX4_Vr-py3.8/lib/python3.8/site-packages/pandas/core/frame.py", 
  line 119, in <module>
    from pandas.core import algorithms, common as com, generic, 
    nanops, ops
  File 
  "/home/sl/.cache/pypoetry/virtualenvs/poetry-test-vOWX4_Vr-py3.8/lib/python3.8/site-packages/pandas/core/generic.py", 
  line 111, in <module>
    from pandas.core.window import Expanding, 
    ExponentialMovingWindow, Rolling, Window
  File 
  "/home/sl/.cache/pypoetry/virtualenvs/poetry-test-vOWX4_Vr-py3.8/lib/python3.8/site-packages/pandas/core/window/__init__.py", 
  line 1, in <module>
    from pandas.core.window.ewm import (  # noqa:F401
  File 
  "/home/sl/.cache/pypoetry/virtualenvs/poetry-test-vOWX4_Vr-py3.8/lib/python3.8/site-packages/pandas/core/window/ewm.py", 
  line 9, in <module>
    import pandas._libs.window.aggregations as window_aggregations
ImportError: libstdc++.so.6: cannot open shared object file: No 
such file or directory
>>>
#+END_SRC


             reply	other threads:[~2021-03-10  7:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10  7:38 Sébastien Lerique [this message]
2021-03-10 10:02 ` Python, poetry, and pandas Phil
2021-03-12  2:14   ` Sébastien Lerique
2021-03-13 11:19     ` Phil
2021-03-10 13:34 ` zimoun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pn0731c1.fsf@eauchat.org \
    --to=sl@eauchat.org \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).