Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

OSError: [Errno 2] No such file or directory on Ubuntu 16.04

Writer Emily Wong

Using Ubuntu, am trying to use the scikit-learn examples with this snippet:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Examples of reading texts files and classifying them
"""
from __future__ import division
import datetime
import sklearn.datasets
time1 = datetime.datetime.now()
##from sklearn.datasets import fetch_20newsgroups
######## Reading text files
rootPath = r"/Home/web2py/corpus/20news-18828/"

However, I got this error:

File "/usr/local/lib/python2.7/dist-packages/sklearn/datasets/base.py", line 201, in load_files folders = [f for f in sorted(listdir(container_path))
OSError: [Errno 2] No such file or directory: '/Home/web2py/corpus/20news-18828/

I am ery new to Ubuntu and scikit-learn stuff. What could be the issue/error and how do I get it solved.?

6

1 Answer

 OSError: [Errno 2] No such file or directory: '/Home/web2py/corpus/20news-18828/

I am ery new to Ubuntu and scikit-learn stuff. What could be the issue/error and how do I get it solved.?

I see an error here if this is meant to be your home directory:/Home/. It should be /home/. Linux cares about both small and capital letters. We do not discriminate against letters as some other operating systems do ( :) )

0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy