1

Since upgrarding to Python 3.9.2 and trying to create new venv for some of my projects and install the requirements, some of the packages are erroring out. Two that I've had trouble with so far are python-levenshtein and fasttext. I'm on Windows 10.

I've tried upgrading pip, installing frow powershell instead of inside VSCODE, installing wheel, installing directly instead of using requirements.txt. I've read a bunch of questions on here which I'll leave links below. There's quite alot of output but it's generally some variation on this depending on the package:

Running setup.py clean for fasttext
  Building wheel for python-Levenshtein (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'd:\vscode\serverless-chat-be\.venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\joshb\\AppData\\Local\\Temp\\pip-install-ykra_2_4\\python-levenshtein_f6f5b4eafe494049bc8ae592ea544a34\\setup.py'"'"'; __file__='"'"'C:\\Users\\joshb\\AppData\\Local\\Temp\\pip-install-ykra_2_4\\python-levenshtein_f6f5b4eafe494049bc8ae592ea544a34\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\joshb\AppData\Local\Temp\pip-wheel-1hctb729'
       cwd: C:\Users\joshb\AppData\Local\Temp\pip-install-ykra_2_4\python-levenshtein_f6f5b4eafe494049bc8ae592ea544a34\
  Complete output (33 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.9
  creating build\lib.win-amd64-3.9\Levenshtein
  copying Levenshtein\StringMatcher.py -> build\lib.win-amd64-3.9\Levenshtein
  copying Levenshtein\__init__.py -> build\lib.win-amd64-3.9\Levenshtein
  running egg_info
  writing python_Levenshtein.egg-info\PKG-INFO
  writing dependency_links to python_Levenshtein.egg-info\dependency_links.txt
  writing entry points to python_Levenshtein.egg-info\entry_points.txt
  writing namespace_packages to python_Levenshtein.egg-info\namespace_packages.txt
  writing requirements to python_Levenshtein.egg-info\requires.txt
  writing top-level names to python_Levenshtein.egg-info\top_level.txt
  reading manifest file 'python_Levenshtein.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no previously-included files matching '*pyc' found anywhere in distribution
  warning: no previously-included files matching '*so' found anywhere in distribution
  warning: no previously-included files matching '.project' found anywhere in distribution
  warning: no previously-included files matching '.pydevproject' found anywhere in distribution
  writing manifest file 'python_Levenshtein.egg-info\SOURCES.txt'
  copying Levenshtein\_levenshtein.c -> build\lib.win-amd64-3.9\Levenshtein
  copying Levenshtein\_levenshtein.h -> build\lib.win-amd64-3.9\Levenshtein
  running build_ext
  building 'Levenshtein._levenshtein' extension
  creating build\temp.win-amd64-3.9
  creating build\temp.win-amd64-3.9\Release
  creating build\temp.win-amd64-3.9\Release\Levenshtein
  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Id:\vscode\serverless-chat-be\.venv\include -IC:\Users\joshb\AppData\Local\Programs\Python\Python39\include -IC:\Users\joshb\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include /TcLevenshtein/_levenshtein.c /Fobuild\temp.win-amd64-3.9\Release\Levenshtein/_levenshtein.obj
  _levenshtein.c
  C:\Users\joshb\AppData\Local\Programs\Python\Python39\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  ----------------------------------------
  ERROR: Failed building wheel for python-Levenshtein
  Running setup.py clean for python-Levenshtein
Failed to build fasttext python-Levenshtein

Links: How to fix error "ERROR: Command errored out with exit status 1: python." when trying to install django-heroku using pip

https://github.com/pypa/pip/issues/8618

error command errored out with exit status 1 pip install

How can I fix this?

Will it just be a case of using Pyhon 3.8 for these projects for now?

EDIT: The problem doesn't seem to be limited to Python version 3.9.2. I've tried installing on 3.8.8 and 3.8.0 32 Bit as I have both of these installed on my system and I'm getting the exact same issue.

jbflow
  • 578
  • 2
  • 16
  • 1
    I have gone through several questions related to this. This problem occurred because of VS build tools. Please follow this [instruction](https://stackoverflow.com/a/66777297/11383441) and tell me the progress. – Kalana Mar 28 '21 at 14:23
  • 1
    OK I have solved it by completely removing visual studio build tools and reinstalling – jbflow Mar 29 '21 at 00:55
  • Does this answer your question? [pip won't install channels\_redis](https://stackoverflow.com/questions/66718559/pip-wont-install-channels-redis) – Kalana Mar 29 '21 at 04:36
  • 1
    FYI: This worked for me: https://stackoverflow.com/a/54136652/4190564 – Darin Jun 14 '22 at 17:11

0 Answers0