Search code examples
pythonpandasodooodoo-10

No Module named Pandas showing in server log but it has been already installed in server


I tried using Pandas for Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-173-generic x86_64) (Server).I want it for Python2.7.I tried sudo pip install pandas and sudo apt-get install python-pandas,pip install --upgrade --force-reinstall pandas it is getting installed,but when I try to use it in my Odoo's(ERP) Code,it is showing the error No module named pandas

After sudo apt-get install python-pandas it is showing :

Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-pandas is already the newest version (0.17.1-3ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.

I also tried:

Python 2.7.12 (default, Oct  8 2019, 14:14:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> import pandas as pd
>>> pd.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.12.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-173-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: None.None

pandas: 0.24.2
pytest: 2.8.7
pip: 20.0.2
setuptools: 44.0.0
Cython: None
numpy: 1.16.6
scipy: 0.17.0
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: 0.4.1
dateutil: 2.8.1
pytz: 2019.3
blosc: None
bottleneck: None
tables: 3.2.2
numexpr: 2.4.3
feather: None
matplotlib: 1.5.1
openpyxl: 2.3.0
xlrd: 0.9.4
xlwt: 0.7.5
xlsxwriter: 0.7.3
lxml.etree: 3.5.0
bs4: 4.4.1
html5lib: 0.999
sqlalchemy: None
pymysql: None
psycopg2: 2.6.1 (dt dec mx pq3 ext lo64)
jinja2: 2.8
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None

Terminal

2020-02-08 06:28:49,633 24303 INFO ? odoo: Odoo version 10.0
2020-02-08 06:28:49,634 24303 INFO ? odoo: Using configuration file at /etc/techysuat.conf
2020-02-08 06:28:49,634 24303 INFO ? odoo: addons paths: ['/opt/odoo10/techysuat/.local/share/Odoo/addons/10.0', u'/opt/odoo10/techysuat/addons', u'/opt/odoo10/techysuat/addons/xn_modules', u'/usr/local/lib/python2.7/dist-packages/pandas', '/opt/odoo10/techysuat/odoo/addons']
2020-02-08 06:28:49,634 24303 INFO ? odoo: database: techysuat@default:default
2020-02-08 06:28:49,655 24303 INFO ? odoo.service.server: HTTP service (werkzeug) running on netexodoo2:7030
2020-02-08 06:28:52,884 24303 INFO ? odoo.addons.report.models.report: Will use the Wkhtmltopdf binary at /usr/bin/wkhtmltopdf
2020-02-08 06:28:53,349 24303 INFO ? odoo.http: HTTP Configuring static files
2020-02-08 06:28:53,373 24303 INFO Techys_UAT odoo.modules.loading: loading 1 modules...
2020-02-08 06:28:53,404 24303 INFO Techys_UAT odoo.modules.loading: 1 modules loaded in 0.03s, 0 queries
2020-02-08 06:28:53,445 24303 INFO Techys_UAT odoo.modules.loading: loading 56 modules...
2020-02-08 06:28:53,727 24303 CRITICAL Techys_UAT odoo.modules.module: Couldn't load module xn_registration_form
2020-02-08 06:28:53,727 24303 CRITICAL Techys_UAT odoo.modules.module: No module named pandas

Thanks in advance.

EDIT :Now Server for this instance has been changed and I think now packages has been installed in a virtual env. I tried installing pandas in virtual env,but is showing permission issues. Ways Tried:

(venv) abc@erp:/opt/odoo10/abcuat/venv/bin$ pip install pandas

Error :

Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/opt/odoo10/techyslive/venv/lib/python2.7/site-packages/numpy'
Consider using the `--user` option or check the permissions.

I tried using : pip install pandas --user Then this error :

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
You are using pip version 19.0.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

I also repeated these same steps with pip2.7 install pandas,pip2 install pandas etc. Please help


Solution

  • Instead of 'pip', use 'pip2' and run command.

    You may try with following:

    sudo pip2 install pandas
    

    Or

    sudo pip3 install pandas
    

    EDIT:

    sudo chmod 777 -R /opt/odoo10/techyslive/venv/lib/python2.7/site-packages/*