python - ImportError: cannot import name wraps -


i'm using python 2.7.6 on ubuntu 14.04.2 lts. i'm using mock mock unittests , noticing when import mock fails importing wraps.

not sure if there's different version of mock or 6 should using it's import work? couldn't find relevant answers , i'm not using virtual environments.

mock module says it's compatible python 2.7.x: https://pypi.python.org/pypi/mock

mock==1.1.3 six==1.9.0

python 2.7.6 (default, mar 22 2014, 22:59:56) [gcc 4.8.2] on linux2 type "help", "copyright", "credits" or "license" more information. >>> mock import mock traceback (most recent call last):   file "<stdin>", line 1, in <module>   file "/usr/local/lib/python2.7/dist-packages/mock/__init__.py", line 2, in <module>     import mock.mock _mock   file "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 68, in <module>     6 import wraps importerror: cannot import name wraps 

also tried sudo no luck.

$ sudo python -c 'from 6 import wraps' traceback (most recent call last):   file "<string>", line 1, in <module> importerror: cannot import name wraps 

installed mock==1.0.1 , worked reason. (shrugs)

edit: real fix me updated setuptools latest , allowed me upgrade mock , 6 latest. on setuptools 3.3. in case had remove said modules hand because owned os in '/usr/local/lib/python2.7/dist-packages/'

check versions of everything

pip freeze | grep -e 6 -e mock easy_install --version 

update everything

wget https://bootstrap.pypa.io/ez_setup.py -o - | sudo python pip install mock --upgrade pip install 6 --upgrade 

thanks @lifeless


Comments