Search code examples
pythonpython-3.xsetuptoolscmusphinxvoice-detection

Setuptools error when trying to install a package


I’m completely new to Python and I want to install the package py-webrtcvad in Windows 7, but I'm stuck at the error ImportError: No module named 'pip.utils.setuptools_build'. There is an answer to this problem in stackoverflow which seems to solve the problem for others, but it doesn't work for me.

Here’s a summary of what I’ve done and tried so far:

  • Installed Python 3.5 and set up the Windows path environment so that it works from any directory.
  • Installed pip for Python.
  • Tried to install the package with python -m pip install webrtcvad, but it failed, returning the error Unable to find vcvarsall.bat.
  • I found a blog that deals with the vcvarsall.bat problem: blogs.msdn.microsoft.com/pythonengineering/2016/04/11/unable-to-find-vcvarsall-bat. Following the directions of that blog:
    • First I just installed Visual C++ Build Tools 2015 and tried installing the package straight away (without updating setuptools), but I received a lot of error messages (which I didn’t write down).
    • I tried reinstalling setuptools, which I did following the directions in https://pypi.python.org/pypi/setuptools: I removed the version of setuptools that came with my Python installation (v20), and installed the latest version (v30). This time I got a different error message when trying to install py-webrtcvad: ImportError: No module named 'pip.utils.setuptools_build'.
  • Asked for assistance in the Python official chat. They made three suggestions:
    • Updating pip with python -m pip install --upgrade pip. Didn’t work. Again, the error ImportError: No module named 'pip.utils.setuptools_build'.
    • Reinstalling Visual C++ Build Tools 2015. No difference, same error again.
    • Reinstalling Python itself. The Python installer offers three choices: Repair, modify and uninstall.
      • Repair: Didn’t work. Same error.
      • Modify: Doesn’t look like it offers useful modifications for this.
      • Uninstall: Uninstalled and reinstalled. Still the same error.

I’m out of ideas. Can you help me?

Note: I imagine this should be doable in Windows 7 with Python 3.5. However, if it isn't I'm open to trying anything different. For example, installing a different version of Python would be no problem at all. I could also try installing Linux if that will solve the problem.


Solution

  • There was a bug in version 2.0.8 of webrtcvad that caused it to use the wrong flags when compiling for Windows: it was using -DWEBRTC_POSIX instead of -DWIN32. This might have been the source of the "lot of error messages" you got during one of your early attempts.

    The fixed version has been pushed to pypi as version 2.0.9. I've confirmed that pip install webrtcvad works correctly on Windows 10. I'm using a pretty fresh install of Python, so I would try it first without reinstalling setuptools.