pipdeptree icon indicating copy to clipboard operation
pipdeptree copied to clipboard

pipdeptree -l is broken - doesn't seem to respect local virtualenv

Open prologic opened this issue 10 years ago • 8 comments

See: http://codepad.org/j5MwjQYt

There is some discrepancy here between what pip freeze thinks is local and what pipdeptree -l thinks is local.

prologic avatar Feb 06 '14 00:02 prologic

Working fine for me. The -l flag is same as that of pip freeze ie. if in a virtualenv that has global access (created with the --system-site-packages flag) do not output globally-installed packages. Was your spyda env setup using the --system-site-packages flag?

naiquevin avatar Feb 06 '14 05:02 naiquevin

That's the thing it was not :)

So it shouldn't be seeing globally installed packages :/

cheers James

James Mills / prologic

E: [email protected] W: prologic.shortcircuit.net.au

On Thu, Feb 6, 2014 at 3:22 PM, Vineet Naik [email protected]:

Working fine for me. The -l flag is same as that of pip freeze ie. if in a virtualenv that has global access (created with the --system-site-packages flag) do not output globally-installed packages. Was your spyda env setup using the --system-site-packages flag?

— Reply to this email directly or view it on GitHubhttps://github.com/naiquevin/pipdeptree/issues/2#issuecomment-34293553 .

prologic avatar Feb 06 '14 05:02 prologic

Can you please check if it's using pipdeptree installed inside the virtualenv and not the global one?

Cheers

naiquevin avatar Feb 06 '14 05:02 naiquevin

Ahh now that's where the problem is :)

I am using a globally installed pipdeptree :)

Does that help solve the issue?

cheers James

James Mills / prologic

E: [email protected] W: prologic.shortcircuit.net.au

On Thu, Feb 6, 2014 at 3:41 PM, Vineet Naik [email protected]:

Can you please check if it's using pipdeptree installed inside the virtualenv and not the global one?

Cheers

— Reply to this email directly or view it on GitHubhttps://github.com/naiquevin/pipdeptree/issues/2#issuecomment-34294286 .

prologic avatar Feb 06 '14 05:02 prologic

Ok, now I get it. pipdeptree looks for installed packages in the currently active env (just like pip freeze) which means it needs to be installed inside the virtualenv. I know this is quite inconvenient. In fact I was wondering if it would be possible to have pipdeptree installed into a newly created env using virtualenvwrapper hooks/extensions (haven't looked into it yet)

Also, as you suggested in #1 if this gets into pip itself then it would be awesome :-)

Thanks for reporting this issue. I shall update the README to make this clear.

naiquevin avatar Feb 06 '14 05:02 naiquevin

No problems! In certainly would heaps better built in to pip On Feb 6, 2014 3:58 PM, "Vineet Naik" [email protected] wrote:

Ok, now I get it. pipdeptree looks for installed packages in the currently active env (just like pip freeze) which means it needs to be installed inside the virtualenv. I know this is quite inconvenient. In fact I was wondering if it would be possible to have pipdeptree installed into the newly created env using virtualenvwrapper hooks/extensions (haven't looked into it yet)

Also, as you suggested in #1https://github.com/naiquevin/pipdeptree/issues/1if this gets into pip itself then it would be awesome :-)

Thanks for reporting this issue. I shall update the README to make this clear.

— Reply to this email directly or view it on GitHubhttps://github.com/naiquevin/pipdeptree/issues/2#issuecomment-34294966 .

prologic avatar Feb 06 '14 06:02 prologic

@naiquevin virtualenvwrapper has a hook called postmkvirtualenv. If you place an executable script with pip install pipdeptree in it at $WORKON_HOME/postmkvirtualenv, pipdeptree will be installed after the creation of each new virtualenv.

jonafato avatar May 12 '15 03:05 jonafato

@jonafato This is really useful thanks. Will try it and also mention it in the README.

naiquevin avatar May 12 '15 18:05 naiquevin

This should be no longer the case.

gaborbernat avatar Sep 06 '22 07:09 gaborbernat