In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "the steps of installing scikit-learn under Ubuntu". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the steps of installing scikit-learn under Ubuntu.
Step 0-install Pyhon
Ubuntu 16.04 LTS is pre-installed with two versions of Python, Python2.7 and Python3.5. If other versions are not installed, please install them first.
Step 1-install the core development tools package
$sudo apt-get install build-essential
Step 2-install pip
Pip is the package management tool of Python. It is recommended that all packages of Python be managed with pip.
Installing pip
$sudo apt-get install python-pip
Step 3-install virtualenv
Virtualenv is a powerful tool for Python multi-version management, which can be used to create multiple independent Python runtime environments on a single machine to manage different versions of development. Reasons for using virtualenv:
> isolate third-party package dependencies between projects. For example, if Project A relies on X1Magi B project, it can rely on X2.
> to facilitate the deployment of applications, package the virtual environment of the development environment to the production environment without having to toss it up on the server.
Try new tools without worrying about polluting the system environment.
> and so on
Installing virtualenv
$sudo pip install virtualenv
> create a virtual environment:
> > create a python2.7 virtualenv
$virtualenv-- no-site-packages-p / usr/bin/python2.7 ~ / env/python2.7
> > create a python3.5 virtualenv
$virtualenv-- no-site-packages-p / usr/bin/python3.5 ~ / env/python3.5
> > by default, the virtual environment depends on the site packages in the system environment, that is, the third-party package already installed in the system will also be installed in the virtual environment. If you do not want to rely on these packages, you can add the parameter-- no-site-packages.
> start the virtual environment:
$. ~ / env/python2.7/bin/activate or $source ~ / env/python2.7/bin/activate
You can also add this command to the ~ / .bashrc file.
If [- f ~ / .venv/python2.7/bin/activate]; then
. ~ / .venv/python2.7/bin/activate
Fi
For example, after I create and start env, the terminal displays as (python2.7) tensor@tensor-com:~$
Step 7-Test scikit-learn
Finally, let's test the installed scikit-learn, and the test code is an example that comes with it:
The running result is:
At this point, I believe you have a deeper understanding of the "steps to install scikit-learn under Ubuntu". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.