Lorri and poetry2nix: lorri shell does not bring python packages into scope, but lorri watch + direnv hook does?
Closed this issue · 1 comments
mjlbach commented
Describe the bug
I've been using the following nix-shell with lorri and poetry2nix. I noticed that python only has the defined modules in scope when I have the direnv hooks enabled, but not when I use lorri shell. Is it expected that you always have the direnv hooks enabled when using lorri shell?
To Reproduce
Steps to reproduce the behavior:
- Clone the repo and comment out nixGL and ensure the .envrc is not enabled
- lorri shell
- python -c "import tensorflow as tf" (no module found)
- enable .envrc, lorri watch
- python -c "import tensorflow as tf" (imports successfully)
Expected behavior
I expected lorri shell to work in the absence of .envrc
Profpatsch commented
Cannot reproduce, it works for me in lorri shell
(I removed the unfree cuda references, but that shouldn’t make a difference here):
> python
DBI connect('dbname=/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite','',...) failed: unable to open database file at /run/current-system/sw/bin/command-not-found line 13.
cannot open database `/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite' at /run/current-system/sw/bin/command-not-found line 13.
philip@shiki ~/t/n/lorri_tensorflow_nixgl_poetry2nix (master) [127]> lorri shell
lorri: building environment..pyt.. done
hon
Welcome to fish, the friendly interactive shell
philip@shiki ~/t/n/lorri_tensorflow_nixgl_poetry2nix (master)> python
Python 3.7.6 (default, Dec 18 2019, 19:23:55)
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
2020-05-11 13:47:08.541429: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: :/nix/store/d0ahcim3p9dv6b01nnmx5nvx7qggnki3-libGL-1.2.0/lib:/nix/store/h6daxzmqp3q515vy4mxci92y551y5cx1-glu-9.0.1/lib:/nix/store/cv03ly81aq91d298kjb28ykzm176z3nb-freeglut-3.2.1/lib:/nix/store/qnbcg7fw1pwqdkyq8gjwgxpb3kdd9pn9-libX11-1.6.8/lib:/nix/store/lzyjivyzrp6agilxhgh0h40pwwg18agy-gcc-9.2.0-lib/lib
2020-05-11 13:47:08.541463: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
>>>