Python 有哪些依赖项可以运行pd.test()?
在通过pip安装pandas后,我尝试运行Python 有哪些依赖项可以运行pd.test()?,python,pandas,pip,Python,Pandas,Pip,在通过pip安装pandas后,我尝试运行pd.test()per,但我发现了一些错误,这些错误似乎表明缺少模块。安装了pytest和moto来解决前两个问题,看起来google compute engine将是它寻找的下一个模块。是否有运行pd.test()所需模块的列表 也许有更好的办法。通常我只会安装anaconda环境,但这是服务器上现有的python环境 谢谢 编辑:添加错误 Python 3.6.4 (default, Jan 16 2018, 13:13:52) Type 'cop
pd.test()
per,但我发现了一些错误,这些错误似乎表明缺少模块。安装了pytest和moto来解决前两个问题,看起来google compute engine将是它寻找的下一个模块。是否有运行pd.test()
所需模块的列表
也许有更好的办法。通常我只会安装anaconda环境,但这是服务器上现有的python环境
谢谢
编辑:添加错误
Python 3.6.4 (default, Jan 16 2018, 13:13:52)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import pandas as pd
In [2]: pd.test()
running: pytest --skip-slow --skip-network /opt/bitnami/python/lib/python3.6/site-packages/pandas
============================================================================================================ test session starts ============================================================================================================
platform linux -- Python 3.6.4, pytest-3.4.1, py-1.5.2, pluggy-0.6.0
rootdir: /opt/bitnami, inifile:
collected 0 items / 1 errors
================================================================================================================== ERRORS ===================================================================================================================
_____________________________________________________________________________________________________________ ERROR collecting _____________________________________________________________________________________________________________
../../../../python/lib/python3.6/site-packages/_pytest/config.py:329: in _getconftestmodules
return self._path2confmods[path]
E KeyError: local('/opt/bitnami/python/lib/python3.6/site-packages/pandas/tests/io')
During handling of the above exception, another exception occurred:
../../../../python/lib/python3.6/site-packages/_pytest/config.py:360: in _importconftest
return self._conftestpath2mod[conftestpath]
E KeyError: local('/opt/bitnami/python/lib/python3.6/site-packages/pandas/tests/io/conftest.py')
During handling of the above exception, another exception occurred:
../../../../python/lib/python3.6/site-packages/_pytest/config.py:366: in _importconftest
mod = conftestpath.pyimport()
../../../../python/lib/python3.6/site-packages/py/_path/local.py:668: in pyimport
__import__(modname)
../../../../python/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:213: in load_module
py.builtin.exec_(co, mod.__dict__)
../../../../python/lib/python3.6/site-packages/pandas/tests/io/conftest.py:3: in <module>
import moto
../../../../python/lib/python3.6/site-packages/moto/__init__.py:8: in <module>
from .acm import mock_acm # flake8: noqa
../../../../python/lib/python3.6/site-packages/moto/acm/__init__.py:2: in <module>
from .models import acm_backends
../../../../python/lib/python3.6/site-packages/moto/acm/models.py:7: in <module>
from moto.ec2 import ec2_backends
../../../../python/lib/python3.6/site-packages/moto/ec2/__init__.py:2: in <module>
from .models import ec2_backends
../../../../python/lib/python3.6/site-packages/moto/ec2/models.py:13: in <module>
import boto.ec2
../../../../python/lib/python3.6/site-packages/boto/__init__.py:1216: in <module>
boto.plugin.load_plugins(config)
../../../../python/lib/python3.6/site-packages/boto/plugin.py:93: in load_plugins
_import_module(file)
../../../../python/lib/python3.6/site-packages/boto/plugin.py:75: in _import_module
return imp.load_module(name, file, filename, data)
../../../../python/lib/python3.6/imp.py:235: in load_module
return load_source(name, filename, file)
../../../../python/lib/python3.6/imp.py:172: in load_source
module = _load(spec)
/usr/lib/python2.7/dist-packages/google_compute_engine/boto/compute_auth.py:19: in <module>
from google_compute_engine import logger
E ModuleNotFoundError: No module named 'google_compute_engine'
During handling of the above exception, another exception occurred:
../../../../python/lib/python3.6/site-packages/py/_path/common.py:377: in visit
for x in Visitor(fil, rec, ignore, bf, sort).gen(self):
../../../../python/lib/python3.6/site-packages/py/_path/common.py:429: in gen
for p in self.gen(subdir):
../../../../python/lib/python3.6/site-packages/py/_path/common.py:418: in gen
dirs = self.optsort([p for p in entries
../../../../python/lib/python3.6/site-packages/py/_path/common.py:419: in <listcomp>
if p.check(dir=1) and (rec is None or rec(p))])
../../../../python/lib/python3.6/site-packages/_pytest/main.py:411: in _recurse
ihook = self.gethookproxy(path)
../../../../python/lib/python3.6/site-packages/_pytest/main.py:315: in gethookproxy
my_conftestmodules = pm._getconftestmodules(fspath)
../../../../python/lib/python3.6/site-packages/_pytest/config.py:343: in _getconftestmodules
mod = self._importconftest(conftestpath)
../../../../python/lib/python3.6/site-packages/_pytest/config.py:368: in _importconftest
raise ConftestImportFailure(conftestpath, sys.exc_info())
E _pytest.config.ConftestImportFailure: ModuleNotFoundError("No module named 'google_compute_engine'",)
E File "/opt/bitnami/python/lib/python3.6/site-packages/_pytest/assertion/rewrite.py", line 213, in load_module
E py.builtin.exec_(co, mod.__dict__)
E File "/opt/bitnami/python/lib/python3.6/site-packages/pandas/tests/io/conftest.py", line 3, in <module>
E import moto
E File "/opt/bitnami/python/lib/python3.6/site-packages/moto/__init__.py", line 8, in <module>
E from .acm import mock_acm # flake8: noqa
E File "/opt/bitnami/python/lib/python3.6/site-packages/moto/acm/__init__.py", line 2, in <module>
E from .models import acm_backends
E File "/opt/bitnami/python/lib/python3.6/site-packages/moto/acm/models.py", line 7, in <module>
E from moto.ec2 import ec2_backends
E File "/opt/bitnami/python/lib/python3.6/site-packages/moto/ec2/__init__.py", line 2, in <module>
E from .models import ec2_backends
E File "/opt/bitnami/python/lib/python3.6/site-packages/moto/ec2/models.py", line 13, in <module>
E import boto.ec2
E File "/opt/bitnami/python/lib/python3.6/site-packages/boto/__init__.py", line 1216, in <module>
E boto.plugin.load_plugins(config)
E File "/opt/bitnami/python/lib/python3.6/site-packages/boto/plugin.py", line 93, in load_plugins
E _import_module(file)
E File "/opt/bitnami/python/lib/python3.6/site-packages/boto/plugin.py", line 75, in _import_module
E return imp.load_module(name, file, filename, data)
E File "/opt/bitnami/python/lib/python3.6/imp.py", line 235, in load_module
E return load_source(name, filename, file)
E File "/opt/bitnami/python/lib/python3.6/imp.py", line 172, in load_source
E module = _load(spec)
E File "/usr/lib/python2.7/dist-packages/google_compute_engine/boto/compute_auth.py", line 19, in <module>
E from google_compute_engine import logger
============================================================================================================= warnings summary ==============================================================================================================
None
could not create cache path /opt/bitnami/.pytest_cache/v/cache/lastfailed
-- Docs: http://doc.pytest.org/en/latest/warnings.html
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
==================================================================================================== 1 warnings, 1 error in 2.42 seconds ====================================================================================================
An exception has occurred, use %tb to see the full traceback.
SystemExit: 2
以下是本模块的依赖项
setuptools, NumPy, python-dateutil, pytz
我也遇到了同样的问题,我只是通过PyCharm IDE
安装pandas来修复它。我不知道这有什么区别,如果有的话;但是,它还是起作用了。如下所示是该模块的依赖项
setuptools, NumPy, python-dateutil, pytz
我也遇到了同样的问题,我只是通过
PyCharm IDE
安装pandas来修复它。我不知道这有什么区别,如果有的话;但是,它成功了。请告诉我们您遇到的错误。是的,我在Ubuntu 17.10 FWIW上也遇到了这种情况。它工作正常,即使测试没有运行,也没有更新错误和当前安装的软件包@maxymoo pandas也适用于我,至少就我现在使用它的目的而言。如果可能的话,我希望测试可以运行。你应该,请,告诉我们你得到的错误。是的,我在Ubuntu 17.10 FWIW上也得到了这个。它工作正常,即使测试没有运行,更新了错误和当前安装的包@maxymoo pandas也适用于我,至少就我现在使用它的目的而言。如果可能的话,希望运行测试。这些软件包已经安装,但显然不足以运行pd.test()
@DanHampton正在使用的python版本是什么?如果您使用的是python3,请确保pandas也安装在python3上,使用:sudo-H pip3 install pandas
或在windows上:py-3-m pip install pandas
这些软件包已经安装,但显然不足以运行pd.test()
@DanHampton使用的是什么版本的python?如果您使用的是python3,请确保为python3安装了pandas,并使用:sudo-H pip3 install pandas
或在windows上:py-3-m pip install pandas