Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 没有名为_testcapi的模块_Python_Linux_Pytest_Python C Api - Fatal编程技术网

Python 没有名为_testcapi的模块

Python 没有名为_testcapi的模块,python,linux,pytest,python-c-api,Python,Linux,Pytest,Python C Api,只需在Centos7上创建virtualenv并尝试为我的应用程序运行unittests $ cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core) $ python -V Python 2.7.5 gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9) $ py.test -v . ... $ py.test -v . p

只需在Centos7上创建virtualenv并尝试为我的应用程序运行unittests

   $ cat /etc/redhat-release
    CentOS Linux release 7.1.1503 (Core)

    $ python -V
    Python 2.7.5

    gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9)

    $ py.test -v .
    ...

    $ py.test -v .
    platform linux2 -- Python 2.7.5, pytest-2.8.2, py-1.4.30, pluggy-0.3.1 

    ERROR collecting tests/test_config_and_start_up.py 
    tests/test_config_and_start_up.py:11: in <module>
        from test.test_support import EnvironmentVarGuard
    ../../../../.virtualenvs/c/lib/python2.7/site-        packages/_pytest/assertion/rewrite.py:171: in load_module
        py.builtin.exec_(co, mod.__dict__)
    /usr/lib64/python2.7/test/test_support.py:22: in <module>
        import _testcapi
    E   ImportError: No module named _testcapi
$cat/etc/redhat版本
CentOS Linux 7.1.1503版(核心版)
$python-V
Python 2.7.5
gcc(gcc)4.8.3 20140911(红帽4.8.3-9)
$py.test-v。
...
$py.test-v。
平台linux2——Python 2.7.5、pytest-2.8.2、py-1.4.30、Plugy-0.3.1
收集测试/测试配置和启动时出错
测试/测试配置和启动。py:11:in
从test.test\u支持导入环境VarGuard
../../../../...virtualenvs/c/lib/python2.7/site-packages/\u pytest/assertion/rewrite.py:171:加载\模块中
py.内置执行器(公司、模块、指令)
/usr/lib64/python2.7/test/test\u support.py:22:in
导入测试CAPI
E ImportError:没有名为_testcapi的模块

鼻测试也一样。有没有办法解决这个问题

安装
python测试
软件包。作为根用户问题:

yum install python-test
@霍夫林:FC32

dnf install python3-test

dnf在FC32上安装python3测试