I have some troubles with package 'six' and system version of 'python' on OSX so I have decided use pyenv(like I do for ruby and nodejs).
I have installed pyenv using homebrew then I have installed specific version of python:
pyenv install 2.7.8
pyenv global 2.7.8
pip install -U --user --ignore-installed selenium pytest-allure-adaptor # install needed dependencies
python --version # > Python 2.7.8
python -c "import six; print six.__version__" # > 1.10.0
But when I try run py.test I get error:
> File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 580, in resolve
raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (six 1.4.1 (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python), Requirement.parse('six>=1.9.0'))
From error above I think that py.test use system python instead pyenv global python
As I see pyenv does not install py.test bin...
which py.test
/usr/local/bin/py.test
which python
/usr/local/var/pyenv/shims/python
So I don't understand how should I use _py.test_ with pyenv
I have 'Googled' but does not find anything about this, seems it's something stupid..
Thanks
I guess this is same issue #535. Please reinstall py.test with NOT specifying '--user' to pip install. If pip installs executables in ~./.pyenv/versions/*/bin, pyenv can detect those binaries and will generate shims script to hook command executions.
BTW I'm also a py.test user and am using it w/ pyenv w/o problems.
@yyuu thanks it's work, but I have found workaround like python -m pytest tests/my_test.py
Most helpful comment
@yyuu thanks it's work, but I have found workaround like
python -m pytest tests/my_test.py