服务器日志中未显示名为 Pandas 的模块,但它已安装在服务器中

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

我尝试将 Pandas 用于 Ubuntu 16.04.6 LTS(GNU/Linux 4.4.0-173-generic x86_64)(服务器)。我想要它用于Python2.7.I 尝试了 sudo pip install pandassudo apt-get install python-pandas,pip install --upgrade --force-reinstall pandas 它正在安装,但是当我尝试在我的 Odoo 的(ERP)代码中使用它时,它显示错误 No module named pandas

sudo apt-get install python-pandas 之后显示:

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.

我也试过:

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

航站楼

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

提前致谢。

编辑:现在这个实例的服务器已经更改,我认为现在软件包已经安装在虚拟环境中。 我尝试在虚拟环境中安装 pandas,但显示权限问题。 尝试的方法:

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

错误:

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.

我尝试使用:pip install pandas --user 然后这个错误:

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.

我还用 pip2.7 install pandaspip2 install pandas 等重复了这些相同的步骤。 请帮忙

而不是 'pip',使用 'pip2' 和 运行 命令。

您可以尝试以下方法:

sudo pip2 install pandas

sudo pip3 install pandas

编辑:

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