This question has been flagged
4 Replies
13836 Views

Environment: CentOS 7.8 

Python 3.6

Odoo 13 Community

I have installed the package "xlrd 1.2.0" using

    pip3 install xlrd

The command

[~]# pip show xlrd  

    returns:

Name: xlrd | Version: 1.2.0
Summary: Library for developers to extract data from Microsoft Excel (tm) spreadsheet files
Home-page: http://www.python-excel.org/
Author: John Machin | Author-email: sjmachin@lexicon.net | License: BSD
Location: /opt/rh/rh-python36/root/usr/lib/python3.6/site-packages

However, when I try to install a new module, I get the message < Python library not installed: xlrd >.

I tried to uninstall and reinstall the <xlrd> module with no better results.

The Python 3.6 instance is separe from the Python 2.7, required by Centos 7.8. 

There is another instance of Python 3.8 installed. As far as I could check, there is no interference of it in the current instance.

        [~]# python --version
        Python 3.6.9
        [~]# which python
        /opt/rh/rh-python36/root/usr/bin/python

I tried to verify the existence of <xlrd> using

[~]# python
Python 3.6.9 (default, Nov 11 2019, 11:24:16) 
>>> import xlrd
>>> import sys
>>> 'xlrd' in sys.modules
True

Each alteration I did was followed by

systemctl restart odoo13.service

I certainly am missing something important but I cannot figure out what. Judging by the number of occurrences of queries related to this issue on Google Search Results page, it seems to be a common one. 

Would anyone have a suggestion on how to solve this problem?

Thanks in advance.

Avatar
Discard

Hello Wisley

Can you please post your code for manifest file.

May be issue when you apply external dependencies on your manifest file.

Best Answer

Try installing xlrd package from Pycharm

File -> Settings -> Project: [PROJECT NAME] -> Project Interpreter-> '+' -> search 'xlrd' -> install package


Avatar
Discard
Best Answer

i had the same problem i  updated the xlsxwriter and xlrd libraries from terminal but no effect happened the problem was still same and after that i install these libraries in pyhcarm in project interpreter  and the problem solved .means you have to install it first in your system and then into your project virtual environment.

Avatar
Discard
Author Best Answer

Dear Jainesh Shah: 

Thank you for taking time to answer my question, it was very kind of yours.

I understand the compatibility issue between Odoo and Python 3.8. I had previously assured that the Odoo 13 instance is running under Python 3.6. 

The info below shows that Python 2.7 is running as the CentOS 7.8 main version of Python.

[~]# which python
     /usr/bin/python
[~]# python --version
     Python 2.7.5

Then, I enable the Python 3.6 environment and verify it:

[~]# scl enable rh-python36 bash
[~]# which python
     /opt/rh/rh-python36/root/usr/bin/python
[~]# python --version
     Python 3.6.9

When I input the command you suggested, the system informs me that the xlrd is already installed

[~]# python3.6 -m pip install xlrd
     Requirement already satisfied: xlrd in /opt/rh/rh-python36/root/usr/lib/python3.6/site-packages (1.2.0)
 

After that, I restart odoo13.service and go to the Odoo 13 instance and try to install the module <Base report xlsx (report_xlsx)>, to which the system returns with a message box:

        Something went wrong ! The module "report_xlsx" cannot be installed because an external dependency was not found: Python library not installed: xlrd

And then, I get stuck. I considered removing Python 3.8 to give another try. However, I'm afraid that this might cause new software issues without any guarantee that removing the version 3.8 will solve the problem. 

Do you (or anybody else) have a further suggestion?

Thanks for your interest. 

Wisley Vilela

Avatar
Discard
Best Answer

Hello Wisley Vilela,

Odoo doesn't have full support of python3.8. See post: https://www.odoo.com/forum/help-1/question/is-odoo-13-compatible-with-python3-8-158220


So please make sure you are running odoo with python3.6 version. And for xlrd library issue, reinstall it again using command: sudo python3.6 -m pip install xlrd.

Hope this will help you.

Regards,




Email:      odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari

   


Avatar
Discard