[Top][All Lists]

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

Re: How can I replace Python venv and pip with Guix?

From: Zelphir Kaltstahl
Subject: Re: How can I replace Python venv and pip with Guix?
Date: Mon, 3 Feb 2020 22:09:19 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1


I know you asked something else, but want to mention this: You could use
Poetry to make reproducible environments for Python. Only yesterday I
have been through the process of building Python 3.8.1 on Trisquel and
getting Poetry installed through Pip.

Also if it is any help, I can share my scripts for building Python with
everyone. I am planning to upload them to some repo later anyway.


On 2/3/20 6:00 PM, address@hidden wrote:
> Hi,
> I'm currently using two package managers when working on my projects written 
> in Python. I use Guix to install Python, and Python pip to install Python 
> packages in project environments created with Python venv. So, for working on 
> a specific project, I do the following:
> # Create an environment (one-time operation)
> $ python3 -m venv ~/.virtualenvs/my-project
> # Activate the environment
> $ source ~/.virtualenvs/my-project/bin/activate
> (my-project) $
> # Install packages in the environment
> (my-project) $ pip install -r packages.txt
> # Deactivate the environment (Ctrl+D)
> $ deactivate
> Emacs Elpy detects the virtual environments I create in this way, so I can 
> activate and deactivate them from Emacs with an easy to use interface and 
> have code completion that depends on the packages available in the active 
> environment.
> I'd like to use Guix and its environments to replace this functionality and 
> to make my development environments easier to reproduce, but I don't 
> understand how to that exactly.
> So far I have tried the "guix environment" command as follows, trying to 
> create a persistent environment I can activate/deactivate whenever I want:
> $ guix environment --pure --manifest=guix.scm 
> --root=/path/to/my-guix-envs/my-project
> After running that command, I can see the prompt adds a "[env]" label 
> indicating that I'm in the environment, and I can use the packages specified 
> in the manifest file. But
> • How could one make the prompt add "[my-project]" instead of the generic 
> "[env]"?
> • Once I deactivate this environment (Ctrl+D), how can I activate it again?
> Thanks,
> ---

reply via email to

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