我使用brew在我的macos上安装了python3。然后我使用创建了虚拟环境python3 -m venv env
。我已经在 virtualenv 中安装了我的所有要求。现在当我尝试运行 pytest 时。它给了我以下错误
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: _PyMainInterpreterConfig_Read: memory allocation failed
ValueError: character U+7273752f is not in range [U+0000; U+10ffff]
Current thread 0x0000000115b015c0 (most recent call first):
我正在使用命令运行 pytest
py.test -s tests/blueprints/test_blueprint.py::TestCRUD::test_blueprint_without_requried_fields
并且测试用例的路径是正确的
答案1
您在这里遇到了一个长期未解决的 python bug,请参阅以下参考文献:
- https://stackoverflow.com/questions/36657523/python-3-3-cant-install-packages-in-a-virtualenv
- https://stackoverflow.com/questions/33459384/unicode-character-not-in-range-when-calling-locale-strxfrm
- https://bugs.python.org/issue23195
我将其添加为答案,因为这似乎是问题的复杂表现。