【问题标题】:test test_urllibnet failed in Linux在 Linux 中测试 test_urllibnet 失败
【发布时间】:2014-04-26 16:45:52
【问题描述】:

我想安装 Python。我尝试了 Python3.3 和 Python3.4 我从https://www.python.org/download/releases/ 下载了文件并按照说明进行操作。 我执行了:

./configure
make

成功。但是当执行时:

make test 

test_urllibnet 失败。

所以根据 README 文件如果为 Python3.4 执行:

./python -m test -v test_urllibnet
== CPython 3.4.0 (default, Apr 16 2014, 16:38:06) [GCC 4.8.1]
==   Linux-3.11.0-15-generic-x86_64-with-debian-wheezy-sid little-endian
==   hash algorithm: siphash24 64bit
==   /home/bernard/Python/Python3.4/Python-3.4.0/build/test_python_27532
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
[1/1] test_urllibnet
test_urllibnet skipped -- Use of the 'network' resource not enabled
1 test skipped:
    test_urllibnet

所以现在它跳过了,因为“网络”没有启用。但是如何启用“网络”?我找不到。

在另一台计算机上,我尝试安装 Python3.3,但出现几乎相同的错误。

./python -m test -v test_urllibnet
== CPython 3.3.5 (default, Apr 24 2014, 17:18:29) [GCC 4.6.3]
==   Linux-3.5.0-38-generic-x86_64-with-debian-wheezy-sid little-endian
==   /home/bernard/Downloads/Python-3.3.5/build/test_python_6523
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1)
[1/1] test_urllibnet
test_urllibnet skipped -- Use of the 'network' resource not enabled
1 test skipped:
    test_urllibnet
Those skips are all expected on linux.

请注意,这对于 Linux 来说应该没问题。但是在Python3.3中声明

Python 3.3.5 (default, Apr 24 2014, 17:18:29) 
    [GCC 4.6.3] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import ssl
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/local/lib/python3.3/ssl.py", line 60, in <module>
        import _ssl             # if we can't import it, let the error propagate
    ImportError: No module named '_ssl'

所以不好。 python3.3.1 ssl module 中的解决方案看起来很相似,但对我不起作用。

我看过 Building Python and more on missing modules 但也没有结果。

只是安装软件,这里是 Python,正在升级并且变得非常复杂。

【问题讨论】:

  • Python3.6 和 OpenSuse 发生在我身上。通过安装 openssl-devel 库修复。

标签: python-3.x


【解决方案1】:

对我来说没有解决方案,只是一种解决方法。仅安装 Python 会变得复杂并且需要很多时间。其他人似乎也有同样的问题。

解决方法是使用预安装的 Python2.7 即可。我尽量避免使用 Python2.7,但现在我不得不使用它。这个答案可能有助于防止人们花费大量时间来解决难以解决的问题。

【讨论】:

    猜你喜欢
    • 2018-02-12
    • 2018-08-31
    • 1970-01-01
    • 1970-01-01
    • 2012-03-25
    • 1970-01-01
    • 1970-01-01
    • 2016-01-04
    • 1970-01-01
    相关资源
    最近更新 更多