unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: sirgazil <sirgazil@zoho.com>
To: Guix Help <help-guix@gnu.org>
Subject: How can I replace Python venv and pip with Guix?
Date: Sun, 02 Feb 2020 18:00:33 -0500	[thread overview]
Message-ID: <170082257a9.bbf196a73697.871070894081541659@zoho.com> (raw)

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/

             reply	other threads:[~2020-02-02 23:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-02 23:00 sirgazil [this message]
2020-02-04  7:36 ` How can I replace Python venv and pip with Guix? Moritz Lell
2020-02-04 13:00   ` sirgazil
2020-02-04 14:31     ` mlell
2020-02-04 18:09       ` sirgazil
2020-02-04  7:59 ` Tanguy Le Carrour
2020-02-04 14:26   ` sirgazil
2020-02-04 14:02 ` Ricardo Wurmus
2020-02-04 18:13   ` sirgazil
     [not found] <mailman.91.1580749212.18219.help-guix@gnu.org>
2020-02-03 21:09 ` Zelphir Kaltstahl
2020-02-03 22:56   ` sirgazil

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=170082257a9.bbf196a73697.871070894081541659@zoho.com \
    --to=sirgazil@zoho.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).