Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'py' has no attribute 'builtin' #3618

Closed
bfortuner opened this issue Jun 25, 2018 · 4 comments
Closed

AttributeError: module 'py' has no attribute 'builtin' #3618

bfortuner opened this issue Jun 25, 2018 · 4 comments
Labels
type: bug problem that needs to be addressed

Comments

@bfortuner
Copy link

bfortuner commented Jun 25, 2018

Installation of pytest not working on Ubuntu 14.04 with python 3.6.2. I tried installing pytest with both my OS's vanilla python install and a pyenv virtual install. I used the command pip install -U pytest. I receive the following error when I try to import pytest or run pytest --version.

Traceback (most recent call last):
  File "/home/bfortuner/.pyenv/versions/3.6.2/bin/pytest", line 7, in <module>
    from pytest import main
  File "/home/bfortuner/.pyenv/versions/3.6.2/lib/python3.6/site-packages/pytest.py", line 10, in <module>
    from _pytest.fixtures import fixture, yield_fixture
  File "/home/bfortuner/.pyenv/versions/3.6.2/lib/python3.6/site-packages/_pytest/fixtures.py", line 12, in <module>
    from py._code.code import FormattedExcinfo
  File "/home/bfortuner/.pyenv/versions/3.6.2/lib/python3.6/site-packages/py/_code/code.py", line 7, in <module>
    reprlib = py.builtin._tryimport('repr', 'reprlib')
AttributeError: module 'py' has no attribute 'builtin'

Output of pip freeze:

atomicwrites==1.1.5
attrs==18.1.0
certifi==2018.4.16
more-itertools==4.2.0
pipenv==2018.6.25
pluggy==0.6.0
py==1.5.3
pytest==3.6.2
six==1.11.0
virtualenv==16.0.0
virtualenv-clone==0.3.0
@pytestbot pytestbot added the type: bug problem that needs to be addressed label Jun 25, 2018
@pytestbot
Copy link
Contributor

GitMate.io thinks possibly related issues are #448 (pytest-xdist: AttributeError: 'module' object has no attribute 'all'), #1161 (AttributeError: 'module' object has no attribute 'epoll'), #1447 (AttributeError: 'OutputWriter' object has no attribute 'isatty'), #555 (AttributeError: '_io.FileIO' object has no attribute 'errors'), and #1944 (AttributeError: 'Module' object has no attribute '_obj').

@bfortuner
Copy link
Author

Turns out there was a 'py' module on my path somewhere screwing me up. I updated by PATH and the error went away!

@hanzhuoran
Copy link

Could you elaborate what you did to fix this?
I have encountered the same problem on pytest.

@RonnyPfannschmidt
Copy link
Member

removal of the conflicting "py" module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

4 participants