All attempts to run pytest is failing with the same banch of errors

I was able to complete Chapter 1, but pytest is giving me a problem:

C:\data\m220>pytest -m text_and_subfield_search
Traceback (most recent call last):
  File "c:\python37\lib\", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python37\lib\", line 85, in _run_code
    exec(code, run_globals)
  File "c:\python37\lib\site-packages\_pytest\", line 681, in _py36_windowsconsoleio_workaround
    sys.__stdin__ = sys.stdin = _reopen_stdio(sys.stdin, 'rb')
  File "c:\python37\lib\site-packages\_pytest\", line 675, in _reopen_stdio
    open(os.dup(f.fileno()), mode, buffering),
OSError: [WinError 87] The parameter is incorrect

Obviously there is a problem with my python environment. I have PyCharm, Python 3.7., Anaconda 3
I tried all suggestions in previous similar thread (change version of the pytest, mainly), but nothing has changed.

Any other bright ideas, short of “reinstall everything”? :cowboy_hat_face:

Hi @torus_ot,

This is a random error which occurs in python and pytest.

Try using python 3.5 if you are using 3.6 or greater and let me know if that helped.

1 Like

I am using

C:\data\m220>python --version
Python 3.7.4

The pytest version (from requirements.txt) is 3.3.0. But I tried 3.3.2 and even latest 5.1.3. The same bunch of errors was shown…

I think there is incompatibility between jupiter and pytest. I tried to upgrade jupiter , but it does not help…

After some googling, it looks like incompatibility Python 3.7.4 , pytest up to latest version and Windows 7.
Promised to be fixed in Python 3.7.5 :face_with_monocle:
Not very helpful…

Sorry to hear that. :frowning: Can you try using an updated machine?


I am doing just fine without pytest. If I will stuck, I move to Suface Pro…
Another possibility - downgrade to python 3.7.3. Somebody has reported that it works…

1 Like