Ch.1 pytest -m connection >>> Import Error

Trying to connect to the first unit test

(py3env) โžœ mflix-python pytest -m connection

Here is the last part of the error I get:

ImportError: cannot import name 'abc' from 'bson.py3compat' (/usr/local/lib/python3.7/site-packages/bson/py3compat.py)
ERROR: could not load /Users/rose/M220/mflix-python/tests/conftest.py

Please help. After doing a google search, I tried uninstalling and re-installing both bson and pymongo, but I still get errors when trying to run the first unit test.

Hi @Rose_THERESA_54344,

Can send us your pip freeze output?
It should be something similar to this:

appnope==0.1.0
attrs==19.1.0
backcall==0.1.0
bcrypt==3.1.7
bleach==3.1.0
cffi==1.12.3
Click==7.0
decorator==4.4.0
defusedxml==0.6.0
dnspython==1.15.0
entrypoints==0.3
Faker==0.8.13
Flask==0.12.4
Flask-Bcrypt==0.7.1
Flask-Cors==3.0.3
Flask-JWT-Extended==3.7.0
Flask-Login==0.4.0
ipykernel==5.1.1
ipython==7.6.1
ipython-genutils==0.2.0
ipywidgets==7.5.0
itsdangerous==1.1.0
jedi==0.14.1
Jinja2==2.10.1
jsonschema==3.0.1
jupyter==1.0.0
jupyter-client==5.2.4
jupyter-console==6.0.0
jupyter-core==4.4.0
MarkupSafe==1.1.1
mistune==0.8.4
nbconvert==5.5.0
nbformat==4.4.0
notebook==5.7.8
pandocfilters==1.4.2
parso==0.5.1
pexpect==4.7.0
pickleshare==0.7.5
pluggy==0.6.0
prometheus-client==0.7.1
prompt-toolkit==2.0.9
ptyprocess==0.6.0
py==1.8.0
pycparser==2.19
Pygments==2.4.2
PyJWT==1.7.1
pymongo==3.8.0
pyrsistent==0.15.3
pytest==3.3.0
pytest-flask==0.10.0
python-dateutil==2.8.0
pyzmq==18.0.2
qtconsole==4.5.1
Send2Trash==1.5.0
six==1.12.0
terminado==0.8.2
testpath==0.4.2
text-unidecode==1.2
tornado==6.0.3
traitlets==4.3.2
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.15.4
widgetsnbextension==3.5.0

N.

1 Like
appnope==0.1.0
attrs==19.1.0
backcall==0.1.0
bcrypt==3.1.7
bleach==3.1.0
cffi==1.12.3
Click==7.0
decorator==4.4.0
defusedxml==0.6.0
dnspython==1.15.0
entrypoints==0.3
Faker==0.8.13
Flask==0.12.4
Flask-Bcrypt==0.7.1
Flask-Cors==3.0.3
Flask-JWT-Extended==3.7.0
Flask-Login==0.4.0
ipykernel==5.1.1
ipython==7.6.1
ipython-genutils==0.2.0
ipywidgets==7.5.0
itsdangerous==1.1.0
jedi==0.14.1
Jinja2==2.10.1
jsonschema==3.0.1
jupyter==1.0.0
jupyter-client==5.2.4
jupyter-console==6.0.0
jupyter-core==4.4.0
MarkupSafe==1.1.1
mistune==0.8.4
nbconvert==5.5.0
nbformat==4.4.0
notebook==5.7.8
pandocfilters==1.4.2
parso==0.5.1
pexpect==4.7.0
pickleshare==0.7.5
pluggy==0.6.0
prometheus-client==0.7.1
prompt-toolkit==2.0.9
ptyprocess==0.6.0
py==1.8.0
pycparser==2.19
Pygments==2.4.2
PyJWT==1.7.1
pymongo==3.8.0
pyrsistent==0.15.3
pytest==3.3.0
pytest-flask==0.10.0
python-dateutil==2.8.0
pyzmq==18.0.2
qtconsole==4.5.1
Send2Trash==1.5.0
six==1.12.0
terminado==0.8.2
testpath==0.4.2
text-unidecode==1.2
tornado==6.0.3
traitlets==4.3.2
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.15.4
widgetsnbextension==3.5.0

Still not working. I will try deleting and reinstalling venv, too.