简体   繁体   中英

How to fix/reinstall scikit-learn after installing only for root from source

I've installed scikit-learn 0.15.2 from source on Fedora 20 but only for root. Here is what I've done:

$ sudo yum install gcc gcc-c++ numpy python-devel scipy
$ cd ~/Downloads/
$ git clone https://github.com/scikit-learn/scikit-learn
$ cd scikit-learn
$ sudo python setup.py install

This installed the software fine but only for root. I forgot about

$ python setup.py build

before the

$ sudo python setup.py install

How do I fix this so all users can use scikit-learn? Not even sure where to even start with this. Help is much appreciated.

The fix to this was quite simple. I looked at the output of the commands I used to install it and figured out that the scikit-learn was installed to

/usr/lib64/python2.7/site-packages/sklearn/

The package worked for root but not for other users so it may be permissions. I checked the permissions on the folder above and as expected only root had access. Other packages in site-packages folder had only read permissions for other users so I thought I'll do the same for this one.

$ cd /usr/lib64/python2.7/site-packages/
$ sudo chmod 755 sklearn
$ cd sklearn 
$ sudo find . -type f -exec chmod 644 {} \;
$ sudo find . -type d -exec chmod 755 {} \;

To make sure it all runs as it should

$ nosetests -v sklearn

Victory. Hope it helps somebody.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM