guix-devel
[Top][All Lists]
Advanced

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

Re: Language library packages should require language package


From: Thompson, David
Subject: Re: Language library packages should require language package
Date: Sun, 24 Apr 2016 09:17:23 -0400

Sorry, I accidentally sent the previous email before I was finished
writing.  The rest of the response is below.

On Sun, Apr 24, 2016 at 8:24 AM, Hartmut Goebel
<address@hidden> wrote:

[...]

> Now the weirdness analysis:
>
> $ cat echo_paths.sh
> echo PATH=$PATH
> echo PYTHONPATH=$PYTHONPATH
> type python
>
> Now let's set up "--ad-hoc python-requests" (but no python):
>
> $ guix environment --pure --ad-hoc python-requests -- ./echo_paths.sh
> PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:.
> PYTHONPATH=
> python is /usr/bin/python
>
> Wow, the system python is used, but where is python-requests? Maybe not
> installed, since it already is in the system installation.
> Let's try a virtual environment:

> $ pyvenv /tmp/foo
> $ source /tmp/foo/bin/activate
> (foo)$ type python
> python ist /tmp/foo/bin/python
>
> (foo)$ guix environment --pure --ad-hoc python-requests -- ./echo_paths.sh
> PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:.
> PYTHONPATH=
> python is /usr/bin/python
>
> Huh? What? The virtual env was ignored (or dropped). Why this? Looks
> like --pure resets the environment to something is thinks is correct,
> even if if ist not adding anything to the environments.

This is because your .bashrc is broken and sets $PATH and other
environment variables.  The --pure flag clears the environment
variables first, so the only way you can get stuff like this back is
if your .bashrc is messed up.  Environment variables should only be
set in the .bash_profile, which is sourced in *login* shells only.

See the manual for further explanation:

https://gnu.org/software/guix/manual/html_node/Invoking-guix-environment.html#FOOT13

> Let's try without --pure:
>
> (foo)$ guix environment  --ad-hoc python-requests -- ./echo_paths.sh
> PATH=/tmp/foo/bin:/usr/local/bin:/usr/bin:/usr/local/games:/usr/games:/usr/lib64/qt4/bin:/usr/lib64/qt5/bin:/home/hartmut/bin:/home/hartmut/.local/bin
> PYTHONPATH=/home/hartmut/lib/python
> python is /tmp/foo/bin/python
>
> Okay, this time I get the python within the virtual env. But still:
> where is python-requests?

Python-requests, by itself, specifies no search paths, so 'guix
environment' doesn't set anything.  It just makes a profile that
doesn't end up being referenced in the new environment.

> (foo)$ guix environment  --ad-hoc python-requests -- ls
> /tmp/foo/lib/python3.4/site-packages/
> easy_install.py  pip                  pkg_resources.py  setuptools
> _markerlib       pip-6.1.1.dist-info  __pycache__
> setuptools-3.6.dist-info
>
> It is not installed in the virtual environment either. Where is it?

Why would you think it would be here?  In Guix, everything is kept in
/gnu/store.

Please re-read the documentation for 'guix environment'.  I think
things will become more clear to you afterwards.

Thanks,

- Dave



reply via email to

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