pythonpython-3.xvisual-studio-codeinterpreterpythoninterpreter

Python ('base':conda) vs the one in opt/local/bin, what are the differences?


I am using Visual Studio Code, and trying to set my python interpreter, then i come across this. The one in "opt/local/bin/python x.x", and the one in "/opt/miniconda3/bin/python" , How are they different? Thank you in advance. Are they basically the same? can i get rid of either one?

enter image description here


Solution

  • For the doubts you describe, you could refer to the following points:

    They are all Python environments.

    1. "What are these two environments."

      For "opt/local/bin/python3.7", it is the path of the python interpreter installed on your computer, which belongs to a 'global environment'.

      For "/opt/miniconda3/bin/python", it is the path of the python interpreter that comes with miniconda3 you installed, and it belongs to 'base conda environments'.

    2. "The difference between them."

      When used as an environment, they are different interpreters. They come from different sources, so pip sources in different environments are different, so we need to pay attention to the current environment when using pip to install modules.

    3. "How to deal with them."

      You could find the 'path' in the user variable of the environment variable of the computer, and these python interpreters are displayed here.You can remove unnecessary ones here.

    Reference: Python environments in VS Code.