Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No module named 'openpyxl' - Python 3.4 - Ubuntu

I installed openpyxl with

$ pip install openpyxl 

when I try the command

from openpyxl import Workbook 

I get

Traceback (most recent call last):  File "<pyshell#0>", line 1, in <module> from openpyxl import Workbook ImportError: No module named 'openpyxl' 

I am using Python 3.4 and Ubuntu 14.04, 32-bit OS type

like image 467
FrancescoVe Avatar asked Dec 29 '15 10:12

FrancescoVe


People also ask

Is openpyxl a package?

openpyxl package — openpyxl 3.0.

Is openpyxl a Python library?

Openpyxl is a Python library that is used to read from an Excel file or write to an Excel file. Data scientists use Openpyxl for data analysis, data copying, data mining, drawing charts, styling sheets, adding formulas, and more. Workbook: A spreadsheet is represented as a workbook in openpyxl.


Video Answer


1 Answers

@zetysz and @Manish already fixed the problem. I am just putting this in an answer for future reference:

  • pip refers to Python 2 as a default in Ubuntu, this means that pip install x will install the module for Python 2 and not for 3

  • pip3 refers to Python 3, it will install the module for Python 3

like image 115
Caridorc Avatar answered Nov 04 '22 14:11

Caridorc