python3.6 pytest失败,“未定义未来的功能注解”

jbose2ul  于 2023-04-28  发布在  Python
关注(0)|答案(1)|浏览(141)

使用python3运行pytests。6 tox.它开始失败,出现以下错误。
python3.6 tox失败,出现以下错误:

Error processing line 1 of /home/test/sample/.tox/py36/lib/python3.6/site-packages/_virtualenv.pth:
    
      Traceback (most recent call last):
        File "/usr/lib/python3.6/site.py", line 174, in addpackage
          exec(line)
        File "<string>", line 1, in <module>
        File "/home/test/sample/.tox/py36/lib/python3.6/site-packages/_virtualenv.py", line 3
          from __future__ import annotations
                                           ^
      SyntaxError: future feature annotations is not defined
    
    Remainder of file ignored
    Error processing line 1 of /home/test/sample/.tox/py36/lib/python3.6/site-packages/_virtualenv.pth:
    
      Traceback (most recent call last):
        File "/usr/lib/python3.6/site.py", line 174, in addpackage
          exec(line)
        File "<string>", line 1, in <module>
        File "/home/test/sample/.tox/py36/lib/python3.6/site-packages/_virtualenv.py", line 3
          from __future__ import annotations
                                           ^
      SyntaxError: future feature annotations is not defined
    
    Remainder of file ignored
    Traceback (most recent call last):
      File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
        "__main__", mod_spec)
      File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "/home/test/sample/.tox/py36/lib/python3.6/site-packages/pip/__main__.py", line 29, in <module>
        from pip._internal.cli.main import main as _main
      File "/home/test/sample/.tox/py36/lib/python3.6/site-packages/pip/_internal/cli/main.py", line 9, in <module>
        from pip._internal.cli.autocompletion import autocomplete
      File "/home/test/sample/.tox/py36/lib/python3.6/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
        from pip._internal.cli.main_parser import create_main_parser
      File "/home/test/sample/.tox/py36/lib/python3.6/site-packages/pip/_internal/cli/main_parser.py", line 9, in <module>
        from pip._internal.build_env import get_runnable_pip
      File "/home/test/sample/.tox/py36/lib/python3.6/site-packages/pip/_internal/build_env.py", line 19, in <module>
        from pip._internal.cli.spinners import open_spinner
      File "/home/test/sample/.tox/py36/lib/python3.6/site-packages/pip/_internal/cli/spinners.py", line 9, in <module>
        from pip._internal.utils.logging import get_indentation
      File "/home/test/sample/.tox/py36/lib/python3.6/site-packages/pip/_internal/utils/logging.py", line 8, in <module>
        from dataclasses import dataclass
    ModuleNotFoundError: No module named 'dataclasses'
5t7ly7z5

5t7ly7z51#

数据类和未来的导入都是Python 3。7只有特色所以你需要至少使用Python 3。7、修改你的密码
参见 www.example.com

相关问题