Can see system site-packages in rez-env? #1260
Replies: 5 comments 12 replies
-
One quick thing to check - I believe Rez sources your user settings (e.g. in bash, |
Beta Was this translation helpful? Give feedback.
-
Well you do not have python in your request so it will use the system python. You need to create a python package and then use |
Beta Was this translation helpful? Give feedback.
-
Agreed with @instinct-vfx , and you may also try |
Beta Was this translation helpful? Give feedback.
-
Just to clear things up:
* the rez installation itself (where the cli tools like rez-env are) are
installed into a venv. If you run rez-python, that drops you into an
interpreter _within the rez installation_. This is all internal stuff and
almost certainly not what you want to be doing - rez-python is for mucking
about with rez internals.
* rez-env resolves rez packages. If you 'rez-env python mypy' then both
python and mypy need to be available as rez packages (for eg, they may have
been created via rez-pip, or rez-bind, or a native rez package)
* rez-env places you into a configured subshell, or "context". This is not
a venv (but you could consider it analogous to one).
* rez-bind is not ideal and we plan on deprecating it. In any case, its
purpose is to create a rez package for you that interfaces with software
already on your system.
* I'm not sure why your rez-bind'ed python can see all your
system-installed py packages, but whatever reason that is, it will be down
to standard python mechanisms. I don't see the issue myself, but I have
built python from source. There's probably something either with the
rez-bind'ed python package, or your system, that's causing those packages
to be visible. In any case, once you're in the rez-env, rez isn't doing
anything special (you're just in some kind of configured shell), so you
should be able to debug python from there and determine why you can see all
those packages. That will then inform us as to whether the rez-bind module
needs to be changed, or there's something in your system causing this.
Hth
A
…On Sat, Mar 26, 2022 at 5:49 AM Austin Scola ***@***.***> wrote:
So I did follow the wiki for installation. And I ran rez-bind --quickstart
as part of that. So how can I create a venv where I can get a python REPL
that has access to just the requirements I want. Or better yet, what I
really want to do is run something like rez-python -m my_module inside
the venv?
—
Reply to this email directly, view it on GitHub
<#1260 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOUSSZLJS2TIRCMZSCZEDVBYDC7ANCNFSM5RUTKC6A>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I'm happy if you have a workaround, let me know if you run into any issues
doing that. I'm loath to put much effort into rez-bind given our desire to
deprecate it.
Cheers
A
…On Tue, Mar 29, 2022 at 12:58 AM Austin Scola ***@***.***> wrote:
Hey @nerdvegas <https://github.com/nerdvegas> thank you for the
explanation. That really helps clear up.
When I run the rez-binded python from the rez-env, and print sys.path I
see '/usr/local/lib/python3.9/site-packages' as the last item in the
list. For now, I think I'll just modify sys.path to remove that and then
I shouldn't be able to see site packages anymore.
—
Reply to this email directly, view it on GitHub
<#1260 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOUSRRONSOQ4PN6P4CBL3VCG3GVANCNFSM5RUTKC6A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi, I'm new to
rez
and I'm trying to userez-env
similar to how I would a use a virtual environment.One thing that is unexpected to me is that when I am in the
rez-env
I can still see system site-packages when I runpython3 -m pip list
?For example, if I have
mypy
installed globally on my computer withpython3 -m pip install mypy
, and I runrez-env
, then runningpython3 -m pip list | grep mypy
shows hits?Is this expected? Is there a way to isolate the the
rez-env
? I tried both--no-implicit
and the--no-local
arguments but neither of those seemed to do what I want?Beta Was this translation helpful? Give feedback.
All reactions