Am 22.02.2018 um 16:30 schrieb Ricardo Wurmus:
>> re 2): As soon as Python2 and Python3 are installed in the same profile,
>> we put both site-packages for both versions into PYTHONPATH, which
>> obviously is wrong.
>> $ PYTHONPATH= guix environment --ad-hoc python@2 python
>> [guix] $ echo $PYTHONPATH
>> A simple work-around would be to make the profile a (pseudo) virtual
>> environment, which is a easy as creating a file
>> "/gnu/store/…-profile/pyvenv.cfg". This will trigger a mechanism in
>> site.py to insert /gnu/store/…-profile/lib/pythonX.Y/site-packages" into
>> sys.path - for the current python version only!
> This is very good to know. I haven’t tested this (as I’m not editing
> the store by hand), but I suppose we could create an empty pyvenv.cfg in
> a profile hook when Python packages are installed.
Below please find a simple package which adds this hack. After
installing it, unset PYTHONPATH:
In the long run both python@2 and python@3 could propagate this
hack-package, thus is would be installed whenever python is installed.
(This need further investigation or a guix guru to help.)
> (This wouldn’t help us much for wrapper scripts, though.)
I have another hack in petto :) But one step at a time :-)
Now here is the
cat > guix-python-venv-hack.scm <<"EOF"
;;; Copyright © 2018 Hartmut Goebel <h.goe...@crazy-compilers.com>
(guix build-system trivial)
`(#:modules ((guix build utils))
(use-modules (guix build utils))
(let* ((out (assoc-ref %outputs "out"))
(pyvenv.cfg (string-append out "/pyvenv.cfg")))
(format p "#")))
;;(chmod index.php #o555)
(synopsis "Python venc-hack for Guix")
(description "See ...")
guix package --install-from-file guix-python-venv-hack.scm
| Hartmut Goebel | h.goe...@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |