Options For Installing Scikit-learn
Solution 1:
First, you should definitely upgrade pip
, as the current version is 6.1.1. Run
pip install --upgrade pip
to do that. I wouldn't necessarily trust what man pip
has to say, as it may be for an ancient version of pip
. Instead, use the docs here.
-U
and --upgrade
are the same thing. --user
is separate.
You don't need to worry about the prefix
thing, or distutils.cfg
. You'd know if you have them, because it's something you'd have to set up manually. So, just try running
pip install scikit-learn -U --user
after you've upgraded pip
, and hopefully everything will go smoothly.
If you're on a Linux or Unix system (like OS X), or you have the GNU command-line tools installed on Windows, and you want pip
to upgrade all of your packages, this command should work in bash:
pip list | awk '{print $1}' | while read -r package; do sudo -H pip install -U "$package"; done
pip list
prints out the name and version of each package installed (and, at least on my Ubuntu 14.10 system, that includes everything, system- or pip
-installed), along with its version number in parentheses. awk '{print $1}'
splits each line on whitespace, and returns the first field (the package name). The while
loop reads each incoming line (the package name) and calls sudo -H pip install -U packagename
, which will look to see if the package is up-to-date, and if not it will upgrade it. I'm assuming system packages like those installed by Ubuntu won't be upgraded, as they're not listed in PyPI, but I killed the command before I found out.
Solution 2:
One option is to install Anaconda, which will allow you to easily install scikit-learn
Post a Comment for "Options For Installing Scikit-learn"