unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Wade Zhang <dochang@gmail.com>
Cc: help-guix <help-guix@gnu.org>
Subject: Re: Issue about building python on a foreign distro
Date: Wed, 25 Aug 2021 15:08:00 +0200	[thread overview]
Message-ID: <8635qxsmdr.fsf@gmail.com> (raw)
In-Reply-To: <CANBNyksdcJvGQLnsci=wpYFdTv58edsCA92CO95et23290n-gw@mail.gmail.com>

Hi,

On Tue, 24 Aug 2021 at 03:30, Wade Zhang <dochang@gmail.com> wrote:

>> > It seems all dependencies installed by Guix are not found.

I do not know.  I have tried without success:

--8<---------------cut here---------------start------------->8---
$ guix environment --pure python --ad-hoc bash curl nss-certs zlib
[env]$ export PYENV_ROOT="$HOME/.pyenv"
[env]$ export PATH="$PYENV_ROOT/bin:$PATH"
[env]$ eval "$(pyenv init --path)"
[env]$ pyenv install 3.8.2
--8<---------------cut here---------------end--------------->8---

and it fails about ’zlib’.

>> > Could you please tell me the reason of these errors and how to fix them?
>>
>> I do not use 'pyenv' and I had bad experience when mixing "package
>> manager".  To have other Python versions than the default ones, I
>> would create variant by using package transformation
>
> pyenv allows you to set python version for your every project by putting a
> `.python-version` file, and you can easily override the version with an
> environment variable.  All you need to do is just setting your `PATH`.  I think
> it's very useful when you're working with multiple projects.

Personally, I store the output of “guix describe -f channels” in say the
file channel.scm and I list all the packages the project require in say
the file manifest.scm.  Then I can exchange these 2 files are to produce
an environment (temporary profile) or a profile.  For instance:

  guix time-machine -C channels.scm -- environment -m manifest.scm

or

  guix time-machine -C channels.scm -- package -m manifest.scm -p profile

It becomes really easy to work with multiple projects. :-)  Note that
these 2 files are generally versioned with the whole project.  Even,
sometime I have several channels.scm files and manifest.scm files for
the same project in order to test.

The main drawback with the approach is the limitation to the Guix
packages.  For instance, two versions of CPython, only.  It is really
easy to use more packages from Conda for example.  I guess ’pyenv’
provides similar thing.  But you loose on other side. :-)

People use ’direnv’ with Guix to easily switch from context/project.
Another story. :-)


All the best,
simon


  reply	other threads:[~2021-08-25 13:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-22 11:27 Issue about building python on a foreign distro Wade Zhang
2021-08-23 16:41 ` zimoun
2021-08-23 19:30   ` Wade Zhang
2021-08-25 13:08     ` zimoun [this message]
2021-08-29 22:29       ` Wade Zhang
2021-09-16 11:24 ` Hartmut Goebel

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=8635qxsmdr.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=dochang@gmail.com \
    --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).