user637140
user637140

Reputation: 1101

difference between "conda install python=3.6" and "apt install python=3.6"?

Context: I have python 3.7 on my computer (Linux). Some package (tensorflow) needs a previous version of python to function.

In this post, a user suggested to install a previous version of python using the command:

 conda install python=3.6

I am confused by this command, since I normally install python using apt or apt-get ( I am on ubuntu ). I think of python as being separate from anaconda.

 apt install python=3.6

What is the difference between these two commands?

Upvotes: 3

Views: 3203

Answers (1)

Benoît P
Benoît P

Reputation: 3265

What you might want to do if you need a specific version of Python for a particular project is making a 'virtual environment'. Basically, that means that pip packages are installed within the project folder rather than in your bin folder somewhere on your computer. Virtual environment can also link to a version of python using something like virtualenv --python=/usr/bin/python2.6.

apt install python=3.6 will install in the standard bin folder of your distro.

conda install python=3.6 will check in which environment you currently are and install it there. It of course requires Anaconda installed and setup on your computer.

There are a lot of virtual environment management packages out there and I am not going to give an opinion on which is the best.

Note that if you install it using apt install, the version used in command line for python3 or python may be ambiguous, to be sure, you can specify the full path or make an alias for that path if there isn't one.

Upvotes: 2

Related Questions