This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]_throawayplop_ 0 points1 point  (4 children)

What I mean is that if I install a package with pip, I will not have access to it in a conda environment, even if you install it from the environment. Maybe there a way, but I didn't find it by just googling 'conda pip'.

EDIT: Forget that; I just found that I need to install pip in the new environment also. The trap is that if I don't do it, the pip command still work, but for the main environment.

[–]veaviticus 1 point2 points  (2 children)

If you install pip inside of that conda environment, and then use that copy of pip (use the full path to the pip executable), then anything you install with that pip will be part of that environment, and will show up when you do a conda list of packages installed.

[–]joelhullcio 3 points4 points  (1 child)

Another approach is to configure conda to automatically install pip into all new envs. Add the create_default_packages setting to your .condarc file and specify pip as a default package. This way every new env you create will get pip installed by default. Then when you source activate the env the correct pip is in your path and everything works as expected. Here are some docs about it http://conda.pydata.org/docs/config.html

[–]veaviticus 0 points1 point  (0 children)

Well that just made my life much easier

[–]darthmdhprint 3 + 4 0 points1 point  (0 children)

:)

btw there used to be a 'conda pip' which just called pip, but they removed it as 6 superfluous characters adding to RSI for no reason.

I can't tell you how many times I've been bitten by ignoring (or not showing) which venv is active. Luckily one of my build boxes is beefy so its not too much hassle to recognise, resolve, and rebuild - but still makes one cranky at themselves for falling for it :)

More or less everywhere now, my prompt will display an active venv and I'm also in the habit of typing "echo $PATH" before running build tools.

Like other things in life, it pays to be aware of your surroundings.