help-guix
[Top][All Lists]
Advanced

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

Re: Issue about building python on a foreign distro


From: zimoun
Subject: Re: Issue about building python on a foreign distro
Date: Wed, 25 Aug 2021 15:08:00 +0200

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 via email to

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