0

I'm using a Fedora distribution and working with python 3.6.

While importing both nltk and sklearn it says I'm missing said 2 modules (respectively). I tried fixing it by first downloading these modules using: sudo yum install sqlite-devel and sudo yum install bzip2-devel but got the following errors (respectively)

Error downloading packages:
  sqlite-devel-3.7.17-8.el7.x86_64: [Errno 5] [Errno 2] No such file or directory
Error downloading packages:
  bzip2-devel-1.0.6-13.el7.x86_64: [Errno 5] [Errno 2] No such file or directory

What exactly do I need to do in order to install these modules? I tried sniffing around Google and SO but couldn't find a resolution that worked for me.

Please help!

Edit: I understand that I need to re-compile python after installing said packages (not that I know how to re-compile it) but I can't even download these packages.

user3765713
  • 133
  • 2
  • 13

3 Answers3

0

Did you tried:

sudo dnf install bzip2

To install basic SQLite (if it is not already), simply type:

sudo dnf install sqlite or sudo yum install libsqlite3-dev

This package provides the basic library and the command-line client sqlite. In order to access SQLite databases from various programming languages (C, Tcl, Java), the language bindings need to be installed separately:

sudo dnf install sqlite-devel sqlite-tcl sqlite-jdbc

Pravitha V
  • 3,308
  • 4
  • 33
  • 51
0

Well, what I did eventually is installing anaconda as @Sidon suggested (in /usr/lib/anaconda3) and changed the symbolinc of python3 (ln -s /usr/local/anaconda3/bin/python3.6 /usr/local/bin/python3) and it seems it worked.

user3765713
  • 133
  • 2
  • 13
  • It is not necessary with conda. See [my answer.](https://stackoverflow.com/a/44699909/2879341) – Sidon Jun 22 '17 at 12:52
0

Anaconda different envs:

With anaconda you can install different envs and then change according to your necessity, for example:

Install python 2.7

conda-env create -n py27 python=2.7

Install python 3.6

conda-env create -n p36 python=3.6

List environments installed

conda-env list  

Output (my case):

autopart                 /home/sidon/anaconda3/envs/autopart
eztables                 /home/sidon/anaconda3/envs/eztables
gestauto                 /home/sidon/anaconda3/envs/gestauto
llabs                    /home/sidon/anaconda3/envs/llabs
material                 /home/sidon/anaconda3/envs/material
olist                    /home/sidon/anaconda3/envs/olist
py27                     /home/sidon/anaconda3/envs/py27
scrum                    /home/sidon/anaconda3/envs/scrum
root                  *  /home/sidon/anaconda3

Change environment:

sidon@sidon-pc-linux:~$ source activate py27 <enter>
(py27) sidon@sidon-pc-linux:~$ 

Installing scikit on py27

$ source activate py27 <enter>
$ (py27) pip install scikit-learn  

or (if fail)
$ (py27) conda install scikit-learn
Sidon
  • 1,316
  • 2
  • 11
  • 26