![]() And this is exactly what an environment manager is for.Īnother scenario where an environment manager is useful is when we simply update a specific library over time. And so, we can run the respective code again without any problems. This way, installing new libraries or updating existing libraries for a specific project, won’t have an effect on the libraries of other projects.Īnd then, if we want to switch between the projects, we simply activate the corresponding environment. So clearly, this is not a good approach for dealing with different projects.Ī better approach would be to put the libraries that we need for a specific project into an isolated container or environment. So, to get around this error, we either have to adjust our code of the machine learning project to be able to work with the new NumPy version or we need to downgrade NumPy again.Īnd such kind of things might happen every time we install a new library or upgrade an existing library. A certain function in the NumPy library was slightly changed which caused the Scikit-learn function, that we used in our code, to not work anymore. ![]() For some reason, a certain Scikit-learn function doesn’t work anymore.Īnd after a lot of digging, we find out that the error occurs because of the upgrade of NumPy. But now, all of a sudden, the code breaks and we get an error message. So, we go back to it and try to run the code again. Then, when we are done with the data analysis project, we suddenly have an idea how we might approach our machine learning project differently. So, we install it.Īnd because pandas depends on a newer version of NumPy, let’s say that the package manager upgrades Numpy from version 1.11.0 to 1.13.3. Let’s say we start working on a machine learning project and we install Scikit-learn with our package manager.Īfter a while, we get stuck and abandon the project to start a data analysis project. So, that’s why a package manager is useful.īut Conda is not just a package manager. So, it can become pretty complex to manually figure out all the right dependencies to make everything work. Scikit-learn together with Pandas.Īnd that’s because the libraries might rely on the same dependency/dependencies (in this case NumPy) but with different versions. And that’s exactly what a package manager does.Īnd this becomes especially helpful when we want to use not just one specific library, but a couple of libraries, e.g. So, if we would have to do all that manually, then this could become quite cumbersome and time-consuming.Ī more convenient approach would be to simply specify the library that we want to use, in this case Scikit-learn, and then let a program figure out all the respective dependencies, that we need to install, to be able to actually use Scikit-learn. And on top of that, we need to install the right versions of all these packages/libraries (and let’s say we install the minimum requirements of these packages, so 0.17.0 and 1.11.0 respectively). So, if we want to use Scikit-learn, then we first need to install its dependencies, SciPy and NumPy in this case, and then also the respective dependencies of those dependencies. And those, in turn, have their own dependencies. ![]() In that case, we can’t just install the latest version of Scikit-learn (currently: 0.21.3) and start coding on our project.Īnd that’s because Scikit-learn depends on other libraries, for example SciPy and NumPy. ![]() Let’s say we want to do a machine learning project and we want to use Scikit-learn for that.
0 Comments
Leave a Reply. |