Azure-docs: Using conda on py35 virtual environment

Created on 5 Mar 2018  Â·  16Comments  Â·  Source: MicrosoftDocs/azure-docs

It is worth mentioning/fixing that conda default installs to root (py27) environment no matter which conda is selected in the command. I.e. even if py35 virtual environemnt is activated, and if you use sudo /anaconda/envs/py35/bin/conda install it will install to the root environment.

To install to the py35 environment you need to add -n py35, so:
sudo /anaconda/bin/conda install -n py35
sudo /anaconda/envs/py35/bin/conda install -n py35


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

  • ID: 38868202-ccff-2a37-ae12-eb55d2ffcf5f
  • Version Independent ID: ec187c97-9e1e-ecb0-d550-06aca5d97f68
  • Content
  • Content Source
  • Service: machine-learning
assigned-to-author doc-bug machine-learninsvc resolved triaged

All 16 comments

Thanks for your feedback. We will investigate and update on it soon.

@JJ I double checked the process of Anaconda installation, it does ask for the specific path where you want to install the application: https://imgur.com/a/d1esB
I'll assign it to the author for confirmation.

Just saw this. I will follow up now.

That is correct. You need to add the -n parameter when using conda from sudo. If you did a sudo -s to create root shell and then activated into the py35 environment then you can leave out the -n. Anyway to be consistent maybe we shoudl just say use the -n option when using conda.

BTW- When using pip install the full path of pip you are running to install apackage will determine where the package will be installed. There is in -n type flag for pip.

So adding the -n in the following 2 cmds takes care of the issue?

sudo /anaconda/bin/pip install -n <package> #for Python 2.7 environment
sudo /anaconda/envs/py35/bin/pip install -n <package> # for Python 3.5 environment

It is not needed for pip, only conda (pip has no -n option)

sudo /anaconda/bin/pip install <package> #pip for Python 2.7
sudo /anaconda/envs/py35/bin/pip install <package> #pip for Python 3.5
sudo /anaconda/bin/conda install [-n py27] <package> #conda for Python 2.7, default behaviour
sudo /anaconda/bin/conda install -n py35 <package> #conda for Python 3.5

This was fixed in the azure-docs-pr repo and published. Who verifies and closes it? Adam?

@Adam-Smith-MSFT want to assign this back to you now... not sure how to use Tags or reassign in this context. But I am on vacation until the 4th of April:)

@bradsev @Adam-Smith-MSFT
Brad, when you've resolved the issue -- either through fixing the doc, filing a work item if it's a bigger issue, or whatever, you close it. https://review.docs.microsoft.com/en-us/help/contribute/contribute-customer-feedback-azure-authors-process?branch=master

please-close

Not yet fixed here

@th389 Thank you for checking. Agh - our mistake! I'm submitting a PR, and you should see the changed by noon tomorrow, if not earlier.

please-close

@th389 We will now proceed to close this thread. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion

I think the current instructions as they are here will not work. As I mentioned above, pip has no -n option, this is just for conda.

As such, neither of these will work:

sudo /anaconda/bin/pip install -n <package> #for Python 2.7 environment
sudo /anaconda/envs/py35/bin/pip install -n <package> # for Python 3.5 environmen

I think there needs to be four separate instructions (as above)

sudo /anaconda/bin/pip install <package> #pip for Python 2.7
sudo /anaconda/envs/py35/bin/pip install <package> #pip for Python 3.5
sudo /anaconda/bin/conda install [-n py27] <package> #conda for Python 2.7, default behaviour
sudo /anaconda/bin/conda install -n py35 <package> #conda for Python 3.5

@BryanTrach-MSFT I am not able to reopen the issue as it has been closed by a contributer. I think the solution presented by @bradsev and @gopitk in the documentation now does not work for either pip or conda

@th389 Thank you again for this detailed feedback! @BryanTrach-MSFT
Resolution will be live today around noon PT.
@bradsev @gopitk

please-close

Was this page helpful?
0 / 5 - 0 ratings