I installed python3 on my macos using brew. Then I created virtual environment using python3 -m venv env. I have installed all my requirements in the virtualenv. Now when i try to run pytest. It gives me following error

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):

I am running pytest using command

py.test  -s tests/blueprints/test_blueprint.py::TestCRUD::test_blueprint_without_requried_fields

and the path to test case is correct

  • if i use virtualenv to set environment, then also I get same error. I have tried setting PYTHONPATH and PYTHONHOME to my env path. But that only removes first three lines of error
    – Affan
    Sep 16 '19 at 11:20
  • virtualenv creating also sends the same error virtualenv -p `which python3.7` env
    – Affan
    Sep 16 '19 at 11:27

You are hitting a long outstanding python bug here, see the following references:

I added this as an answer, as this seems to be convoluted manifestation of the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.