From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zelphir Kaltstahl Subject: Re: How can I replace Python venv and pip with Guix? Date: Mon, 3 Feb 2020 22:09:19 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:58473) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyj0J-0006Bw-Jo for help-guix@gnu.org; Mon, 03 Feb 2020 16:11:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iyj0I-0002TM-FB for help-guix@gnu.org; Mon, 03 Feb 2020 16:11:35 -0500 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]:33885) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iyj0I-0002NE-7D for help-guix@gnu.org; Mon, 03 Feb 2020 16:11:34 -0500 Received: by mail-lf1-x12d.google.com with SMTP id l18so10757832lfc.1 for ; Mon, 03 Feb 2020 13:11:33 -0800 (PST) Received: from [10.8.0.8] ([185.65.135.186]) by smtp.googlemail.com with ESMTPSA id d4sm9390619lfn.42.2020.02.03.13.11.31 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Feb 2020 13:11:31 -0800 (PST) In-Reply-To: Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane-mx.org@gnu.org Sender: "Help-Guix" To: help-guix@gnu.org Hi, 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. Regards, Zelphir On 2/3/20 6:00 PM, help-guix-request@gnu.org 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: > > > #+BEGIN_EXAMPLE > # 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 > #+END_EXAMPLE > > > 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: > > #+BEGIN_EXAMPLE > $ guix environment --pure --manifest=guix.scm --root=/path/to/my-guix-envs/my-project > #+END_EXAMPLE > > 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, > > > > --- > https://sirgazil.bitbucket.io/