How to fix this problem when installing mysqlclient using pip - python-3.x

I am trying to use django and use mysql as the database. i originally had it working just fine but i recently changed the name of the user account and that is where everything has gone wrong. I have used pip install mysqlclient but the error below is what i get. Is there a way to install mysqlclient another way?
I am using django's newest version and i am using visual code. Thank you
ERROR: Command errored out with exit status 1:
command: 'c:\users\jacob\appdata\local\programs\python\python37-32\python.e
xe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\JACOB
\\AppData\\Local\\Temp\\pip-install-ehb3yr50\\mysqlclient\\setup.py'"'"'; __file
__='"'"'C:\\Users\\JACOB\\AppData\\Local\\Temp\\pip-install-ehb3yr50\\mysqlclien
t\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read
().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__,
'"'"'exec'"'"'))' install --record 'C:\Users\JACOB\AppData\Local\Temp\pip-record
-hbel0tdu\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\JACOB\AppData\Local\Temp\pip-install-ehb3yr50\mysqlclient
\
Complete output (30 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.7\MySQLdb
creating build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.7\MySQLdb\constan
ts
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.7\MySQLdb\const
ants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.7\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
creating build\temp.win32-3.7\Release\MySQLdb
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\
14.22.27905\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Dversion
_info=(1,4,4,'final',0) -D__version__=1.4.4 "-IC:\Program Files (x86)\MySQL\MySQ
L Connector C 6.1\include\mariadb" -Ic:\users\jacob\appdata\local\programs\pytho
n\python37-32\include -Ic:\users\jacob\appdata\local\programs\python\python37-32
\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Too
ls\MSVC\14.22.27905\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual S
tudio\2019\Community\VC\Tools\MSVC\14.22.27905\include" "-IC:\Program Files (x86
)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits
\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include
\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.183
62.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "
-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /TcMySQL
db/_mysql.c /Fobuild\temp.win32-3.7\Release\MySQLdb/_mysql.obj /Zl /D_CRT_SECURE
_NO_WARNINGS
_mysql.c
MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h'
: No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Comm
unity\\VC\\Tools\\MSVC\\14.22.27905\\bin\\HostX86\\x86\\cl.exe' failed with exit
status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\jacob\appdata\local\pro
grams\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sy
s.argv[0] = '"'"'C:\\Users\\JACOB\\AppData\\Local\\Temp\\pip-install-ehb3yr50\\m
ysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\JACOB\\AppData\\Local\\Temp\
\pip-install-ehb3yr50\\mysqlclient\\setup.py'"'"';f=getattr(tokenize, '"'"'open'
"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.clos
e();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\JA
COB\AppData\Local\Temp\pip-record-hbel0tdu\install-record.txt' --single-version-
externally-managed --compile Check the logs for full command output.

go to this site to download the package according to the python version. and use pip install filename
like i have python 3.7.1 and download the file in red circle and open terminal where file downloaded and install that file e.g pip install mysqlclient-1.4.4-cp37-cp37m-win32.whl
and in setting file
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'shoping_cart',
'HOST': 'localhost',
'USER': 'root',
'PASSWORD':'',
'PORT': '3306',
}
}

For Linux users
First, install the following dependencies:
sudo apt-get install python3.9-dev libmysqlclient-dev
# don't forget to change python version as per your virtual environment
# since I created my virtual environment with python3.9 that is why I
# have mentioned the same version above
and then install the mysqlclient:
pip install mysqlclient

it might be helpful to send us a 'pip freeze'. Also what's your version of python?
Have you tried 'brew' instead of 'pip' installer?
Check this answer out: How to install Python MySQLdb module using pip?

Yea I just double checked and you should be able to use the 'brew' installer. Basically you're missing the 'openssl' dependency. so you can alternatively just install that and then get mysql.

Related

getting error while installing tronpy , tronweb , tronapi

i tried install tronpy but it shows legacy-install-failur
full error code below
sing legacy 'setup.py install' for trx-utils, since package 'wheel' is not installed.
Using legacy 'setup.py install' for bitarray, since package 'wheel' is not installed.
Installing collected packages: bitarray, cytoolz, attrdict, trx-utils, eth-utils, rlp, eth-keys, eth-abi, eth-rlp, eth-keyfile, eth-account, tronweb
Running setup.py install for bitarray ... error
error: subprocess-exited-with-error
× Running setup.py install for bitarray did not run successfully.
│ exit code: 1
╰─> [19 lines of output]
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.10
creating build\lib.win-amd64-3.10\bitarray
copying bitarray\test_bitarray.py -> build\lib.win-amd64-3.10\bitarray
copying bitarray\test_util.py -> build\lib.win-amd64-3.10\bitarray
copying bitarray\util.py -> build\lib.win-amd64-3.10\bitarray
copying bitarray_init_.py -> build\lib.win-amd64-3.10\bitarray
running build_ext
building 'bitarray._bitarray' extension
creating build\temp.win-amd64-3.10
creating build\temp.win-amd64-3.10\Release
creating build\temp.win-amd64-3.10\Release\bitarray
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /M
D -IC:\Users\Pugazhenthi\AppData\Local\Programs\Python\Python310\include -IC:\Users\Pugazhenthi\AppData\Local\Programs\Python\Python310\Include -IC:\Pro
gram Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include /Tcbitarray/_bitarray.c /Fobuild\temp.win-amd64-3.10\Release\bitarray/_bitarray.obj
_bitarray.c
C:\Users\Pugazhenthi\AppData\Local\Programs\Python\Python310\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.29.30133\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> bitarray
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Until now, tronapi still does not support python 3.10 and above, so you should use python 3.9

Getting an error when i try to install a package (translate) by "pip3 install translate" in virtual environment

I am facing an error when i am trying to install a package in my python project virtual environment. But it's OK when i try to install the same package by same commend (pip3 install translate) in outside of the virtual environment.
pip 19.0.3
Python 3.8.2
Using cached https://files.pythonhosted.org/packages/85/b2/2ea329a07bbc0c7227eef84ca89ffd6895e7ec237d6c0b26574d56103e53/translate-3.5.0-py2.py3-none-any.whl
Requirement already satisfied: tox in e:\testproject\venv\lib\site-packages (from translate) (3.14.6)
Requirement already satisfied: pre-commit in e:\testproject\venv\lib\site-packages (from translate) (2.3.0)
Requirement already satisfied: click in e:\testproject\venv\lib\site-packages (from translate) (7.1.1)
Collecting lxml (from translate)
Using cached https://files.pythonhosted.org/packages/39/2b/0a66d5436f237aff76b91e68b4d8c041d145ad0a2cdeefe2c42f76ba2857/lxml-4.5.0.tar.gz
Requirement already satisfied: requests in e:\testproject\venv\lib\site-packages (from translate) (2.23.0)
Requirement already satisfied: toml>=0.9.4 in e:\testproject\venv\lib\site-packages (from tox->translate) (0.10.0)
Requirement already satisfied: filelock<4,>=3.0.0 in e:\testproject\venv\lib\site-packages (from tox->translate) (3.0.12)
Requirement already satisfied: colorama>=0.4.1; platform_system == "Windows" in e:\testproject\venv\lib\site-packages (from tox->translate) (0.4.3)
Requirement already satisfied: virtualenv!=20.0.0,!=20.0.1,!=20.0.2,!=20.0.3,!=20.0.4,!=20.0.5,!=20.0.6,!=20.0.7,>=16.0.0 in e:\testproject\venv\lib\site-packages (from tox->translate) (20.0.18)
Requirement already satisfied: packaging>=14 in e:\testproject\venv\lib\site-packages (from tox->translate) (20.3)
Requirement already satisfied: six<2,>=1.14.0 in e:\testproject\venv\lib\site-packages (from tox->translate) (1.14.0)
Requirement already satisfied: py<2,>=1.4.17 in e:\testproject\venv\lib\site-packages (from tox->translate) (1.8.1)
Requirement already satisfied: pluggy<1,>=0.12.0 in e:\testproject\venv\lib\site-packages (from tox->translate) (0.13.1)
Requirement already satisfied: cfgv>=2.0.0 in e:\testproject\venv\lib\site-packages (from pre-commit->translate) (3.1.0)
Requirement already satisfied: identify>=1.0.0 in e:\testproject\venv\lib\site-packages (from pre-commit->translate) (1.4.15)
Requirement already satisfied: pyyaml>=5.1 in e:\testproject\venv\lib\site-packages (from pre-commit->translate) (5.3.1)
Requirement already satisfied: nodeenv>=0.11.1 in e:\testproject\venv\lib\site-packages (from pre-commit->translate) (1.3.5)
Requirement already satisfied: chardet<4,>=3.0.2 in e:\testproject\venv\lib\site-packages (from requests->translate) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in e:\testproject\venv\lib\site-packages (from requests->translate) (2020.4.5.1)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in e:\testproject\venv\lib\site-packages (from requests->translate) (1.25.9)
Requirement already satisfied: idna<3,>=2.5 in e:\testproject\venv\lib\site-packages (from requests->translate) (2.9)
Requirement already satisfied: appdirs<2,>=1.4.3 in e:\testproject\venv\lib\site-packages (from virtualenv!=20.0.0,!=20.0.1,!=20.0.2,!=20.0.3,!=20.0.4,!=20.0.5,!=20.0.6,!=20.0.7,>=16.0.0->tox->translate) (1.4.3)
Requirement already satisfied: distlib<1,>=0.3.0 in e:\testproject\venv\lib\site-packages (from virtualenv!=20.0.0,!=20.0.1,!=20.0.2,!=20.0.3,!=20.0.4,!=20.0.5,!=20.0.6,!=20.0.7,>=16.0.0->tox->translate) (0.3.0)
Requirement already satisfied: pyparsing>=2.0.2 in e:\testproject\venv\lib\site-packages (from packaging>=14->tox->translate) (2.4.7)
Installing collected packages: lxml, translate
Running setup.py install for lxml ... error
Complete output from command E:\TestProject\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users\rabby\AppData\Local\Temp\pip-install-muzepxbu\lxml\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\rabby\AppData\Local\Temp\pip-record-0023ymbj\install-record.txt --single-version-externally-managed --compile --install-headers E:\TestProject\venv\include\site\python3.8\lxml:
Building lxml version 4.5.0.
Building without Cython.
ERROR: b"'xslt-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
creating build\lib.win32-3.8\lxml
copying src\lxml\builder.py -> build\lib.win32-3.8\lxml
copying src\lxml\cssselect.py -> build\lib.win32-3.8\lxml
copying src\lxml\doctestcompare.py -> build\lib.win32-3.8\lxml
copying src\lxml\ElementInclude.py -> build\lib.win32-3.8\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win32-3.8\lxml
copying src\lxml\sax.py -> build\lib.win32-3.8\lxml
copying src\lxml\usedoctest.py -> build\lib.win32-3.8\lxml
copying src\lxml\_elementpath.py -> build\lib.win32-3.8\lxml
copying src\lxml\__init__.py -> build\lib.win32-3.8\lxml
creating build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win32-3.8\lxml\includes
creating build\lib.win32-3.8\lxml\html
copying src\lxml\html\builder.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\clean.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\defs.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\diff.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win32-3.8\lxml\html
creating build\lib.win32-3.8\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win32-3.8\lxml\isoschematron
copying src\lxml\etree.h -> build\lib.win32-3.8\lxml
copying src\lxml\etree_api.h -> build\lib.win32-3.8\lxml
copying src\lxml\lxml.etree.h -> build\lib.win32-3.8\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win32-3.8\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\etreepublic.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\relaxng.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\schematron.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\tree.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xmlerror.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xmlparser.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xmlschema.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xpath.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\__init__.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\lxml-version.h -> build\lib.win32-3.8\lxml\includes
creating build\lib.win32-3.8\lxml\isoschematron\resources
creating build\lib.win32-3.8\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win32-3.8\lxml\isoschematron\resources\rng
creating build\lib.win32-3.8\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl
creating build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
creating build\temp.win32-3.8
creating build\temp.win32-3.8\Release
creating build\temp.win32-3.8\Release\src
creating build\temp.win32-3.8\Release\src\lxml
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc\lxml\includes -IE:\TestProject\venv\include -IC:\Users\rabby\AppData\Local\Programs\Python\Python38-32\include -IC:\Users\rabby\AppData\Local\Programs\Python\Python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tcsrc\lxml\etree.c /Fobuild\temp.win32-3.8\Release\src\lxml\etree.obj -w
cl : Command line warning D9025 : overriding '/W3' with '/w'
etree.c
c:\users\rabby\appdata\local\temp\pip-install-muzepxbu\lxml\src\lxml\includes/etree_defs.h(14): fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
Compile failed: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
creating Users
creating Users\rabby
creating Users\rabby\AppData
creating Users\rabby\AppData\Local
creating Users\rabby\AppData\Local\Temp
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/include/libxml2 "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /TcC:\Users\rabby\AppData\Local\Temp\xmlXPathInitt0q8ob77.c /FoUsers\rabby\AppData\Local\Temp\xmlXPathInitt0q8ob77.obj
xmlXPathInitt0q8ob77.c
C:\Users\rabby\AppData\Local\Temp\xmlXPathInitt0q8ob77.c(1): fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
----------------------------------------
Command "E:\TestProject\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users\rabby\AppData\Local\Temp\pip-install-muzepxbu\lxml\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\rabby\AppData\Local\Temp\pip-record-0023ymbj\install-record.txt --single-version-externally-managed --compile --install-headers E:\TestProject\venv\include\site\python3.8\lxml" failed with error code 1 in C:\Users\rabby\AppData\Local\Temp\pip-install-muzepxbu\lxml\
I have solved this problem by installing lxml package in my virtual environment.
easy_install lxml

"Compiling Desktop applications for the ARM platform is not supported" when building OpenSSL

I am trying to build OpenSSL from source (branch OpenSSL_1_0_1-stable) using Visual C++ (Visual Studio 2015 is installed) by following the instructions here.
When I run nmake -f ms\ntdll.mak I get the following output:
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
Building OpenSSL
perl util/copy.pl ".\crypto\buildinf.h" "tmp32dll\buildinf.h"
Copying: ./crypto/buildinf.h to tmp32dll/buildinf.h
perl util/copy.pl ".\crypto\opensslconf.h" "inc32\openssl\opensslconf.h"
Copying: ./crypto/opensslconf.h to inc32/openssl/opensslconf.h
cl /Fotmp32dll\uplink.obj -Iinc32 -Itmp32dll /MD /Ox /O2 /Ob2 -DOPENSSL_THREADS -DDSO_WIN32 -W3 -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_USE_APPLINK -I. -DOPENSSL_NO_RC5 -DOPENSSL_NO_MD2 -DOPENSSL_NO_SSL2 -DOPENSSL_NO_KRB5 -DOPENSSL_NO_JPAKE -DOPENSSL_NO_WEAK_SSL_CIPHERS -DOPENSSL_NO_STATIC_ENGINE /Zi /Fdtmp32dll/lib -D_WINDLL -c ms\uplink.c
uplink.c
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\corecrt.h(205): fatal error C1189: #error: Compiling Desktop applications for the ARM platform is not supported.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64_arm\cl.EXE"' : return code '0x2'
Stop.
My ms/ntdll.mak file content:
# This makefile has been automatically generated from the OpenSSL distribution.
# This single makefile will build the complete OpenSSL distribution and
# by default leave the 'interesting' output files in .\out and the stuff
# that needs deleting in .\tmp.
# The file was generated by running 'make makefile.one', which
# does a 'make files', which writes all the environment variables from all
# the makefiles to the file call MINFO. This file is used by
# util\mk1mf.pl to generate makefile.one.
# The 'makefile per directory' system suites me when developing this
# library and also so I can 'distribute' indervidual library sections.
# The one monster makefile better suits building in non-unix
# environments.
INSTALLTOP=D:\TelegramDesktop\Libraries\openssl\Release
OPENSSLDIR=D:\TelegramDesktop\Libraries\openssl\Release\ssl
# Set your compiler options
PLATFORM=VC-WIN32
CC=cl
CFLAG= /MD /Ox /O2 /Ob2 -DOPENSSL_THREADS -DDSO_WIN32 -W3 -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_USE_APPLINK -I. -DOPENSSL_NO_RC5 -DOPENSSL_NO_MD2 -DOPENSSL_NO_SSL2 -DOPENSSL_NO_KRB5 -DOPENSSL_NO_JPAKE -DOPENSSL_NO_WEAK_SSL_CIPHERS -DOPENSSL_NO_STATIC_ENGINE
APP_CFLAG= /Zi /Fd$(TMP_D)/app
LIB_CFLAG= /Zi /Fd$(TMP_D)/lib -D_WINDLL
SHLIB_CFLAG=
APP_EX_OBJ=setargv.obj $(OBJ_D)\applink.obj /implib:$(TMP_D)\junk.lib
SHLIB_EX_OBJ=
# add extra libraries to this define, for solaris -lsocket -lnsl would
# be added
EX_LIBS=ws2_32.lib gdi32.lib advapi32.lib crypt32.lib user32.lib
# The OpenSSL directory
SRC_D=.
LINK_CMD=link
LFLAGS=/nologo /subsystem:console /opt:ref /debug
RSC=rc
# The output directory for everything intersting
OUT_D=out32dll
# The output directory for all the temporary muck
TMP_D=tmp32dll
# The output directory for the header files
INC_D=inc32
INCO_D=inc32\openssl
PERL=perl
CP=$(PERL) util/copy.pl
RM=del /Q
RANLIB=
MKDIR=$(PERL) util/mkdir-p.pl
MKLIB=lib /nologo
MLFLAGS= /nologo /subsystem:console /opt:ref /debug /dll
ASM=ml /nologo /Cp /coff /c /Cx /Zi
# FIPS validated module and support file locations
FIPSDIR=\usr\local\ssl\fips-2.0
BASEADDR=0xFB00000
FIPSLIB_D=$(FIPSDIR)\lib
FIPS_PREMAIN_SRC=$(FIPSLIB_D)\fips_premain.c
O_FIPSCANISTER=$(FIPSLIB_D)\fipscanister.lib
FIPS_SHA1_EXE=$(FIPSDIR)\bin\fips_standalone_sha1.exe
E_PREMAIN_DSO=fips_premain_dso
PREMAIN_DSO_EXE=$(BIN_D)\fips_premain_dso.exe
FIPSLINK=$(PERL) $(FIPSDIR)\bin\fipslink.pl
Running nmake -f ms\nt.mak produces the same error.
I am not sure why building for platform VC-WIN32 leads to an error about ARM platform. Also, I haven't find any question about this error on VS2015, only VS2013 and below, in which compiling for ARM platform is really not supported.
Any suggestions?
I've found out what was wrong:
I have run the commands in VS2015 x64 ARM Cross Tools Command Prompt instead of in VS2015 x86 Native Cross Tools Command Prompt.
Running in VS2015 x86 Native Cross Tools Command Prompt solved the issue.

Can't install Levenshtein distance package on Windows Python 3.5

I need to install python Levenshtein distance package in order to use this library.
Unfortunately, I am not able to install it succesfully. I usually install libraries with pip. However, this time I am getting error: [WinError 2] The system cannot find the file specified which had never happened to me before (when installing libraries). I have tried to install it using the python setup.py install but I get exactly the same error. This the output I get from the console.
C:\Users\my_user\Anaconda3\Lib\site-packages\python-Levenshtein-0.10.2>python setup.py install
running install
running bdist_egg
running egg_info
writing dependency_links to python_Levenshtein.egg-info\dependency_links.txt
writing namespace_packages to python_Levenshtein.egg-info\namespace_packages.txt
writing entry points to python_Levenshtein.egg-info\entry_points.txt
writing python_Levenshtein.egg-info\PKG-INFO
writing top-level names to python_Levenshtein.egg-info\top_level.txt
writing requirements to python_Levenshtein.egg-info\requires.txt
reading manifest file 'python_Levenshtein.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*' under directory 'docs'
warning: no previously-included files matching '*pyc' 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'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_ext
building 'Levenshtein' extension
error: [WinError 2] The system cannot find the file specified
On the other hand, this is what I get when running pip install:
C:\Users\my_user\Anaconda3\Lib\site-packages\python-Levenshtein-0.10.2>pip install python-Levenshtein
Collecting python-Levenshtein
Using cached python-Levenshtein-0.12.0.tar.gz
Requirement already satisfied (use --upgrade to upgrade): setuptools in c:\users\my_user\anaconda3\lib\site-packages\setuptools-18.4-py3.5.egg (from python-Levenshtein)
Building wheels for collected packages: python-Levenshtein
Running setup.py bdist_wheel for python-Levenshtein ... error
Complete output from command c:\users\my_user\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\my_user\\AppData\\Local\\Temp\\pip-build-99lnpr1w\\python-Levenshtein\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\my_user\AppData\Local\Temp\tmpvw371ebspip-wheel- --python-tag cp35:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\Levenshtein
copying Levenshtein\StringMatcher.py -> build\lib.win-amd64-3.5\Levenshtein
copying Levenshtein\__init__.py -> build\lib.win-amd64-3.5\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 top-level names to python_Levenshtein.egg-info\top_level.txt
writing namespace_packages to python_Levenshtein.egg-info\namespace_packages.txt
writing requirements to python_Levenshtein.egg-info\requires.txt
warning: manifest_maker: standard file '-c' not found
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.5\Levenshtein
copying Levenshtein\_levenshtein.h -> build\lib.win-amd64-3.5\Levenshtein
running build_ext
building 'Levenshtein._levenshtein' extension
error: [WinError 2] The system cannot find the file specified
----------------------------------------
Failed building wheel for python-Levenshtein
Running setup.py clean for python-Levenshtein
Failed to build python-Levenshtein
Installing collected packages: python-Levenshtein
Running setup.py install for python-Levenshtein ... error
Complete output from command c:\users\my_user\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\my_user\\AppData\\Local\\Temp\\pip-build-99lnpr1w\\python-Levenshtein\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\my_user\AppData\Local\Temp\pip-wjhuwi7v-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\Levenshtein
copying Levenshtein\StringMatcher.py -> build\lib.win-amd64-3.5\Levenshtein
copying Levenshtein\__init__.py -> build\lib.win-amd64-3.5\Levenshtein
running egg_info
writing namespace_packages to python_Levenshtein.egg-info\namespace_packages.txt
writing top-level names to python_Levenshtein.egg-info\top_level.txt
writing python_Levenshtein.egg-info\PKG-INFO
writing requirements to python_Levenshtein.egg-info\requires.txt
writing dependency_links to python_Levenshtein.egg-info\dependency_links.txt
writing entry points to python_Levenshtein.egg-info\entry_points.txt
warning: manifest_maker: standard file '-c' not found
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.5\Levenshtein
copying Levenshtein\_levenshtein.h -> build\lib.win-amd64-3.5\Levenshtein
running build_ext
building 'Levenshtein._levenshtein' extension
error: [WinError 2] The system cannot find the file specified
----------------------------------------
Command "c:\users\my_user\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\my_user\\AppData\\Local\\Temp\\pip-build-99lnpr1w\\python-Levenshtein\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\my_user\AppData\Local\Temp\pip-wjhuwi7v-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\my_user\AppData\Local\Temp\pip-build-99lnpr1w\python-Levenshtein\
I am using Windows 10 with Python 3.5. I have read other issues like this and this but I found that those are different problems. By the way I have also tried the following the problem persists.
Running console as Administrator
(Re)installing VC++ 2008
Thanks in advance
Had a similar issue, solved by installing another related library: python-Levenshtein-wheels ;
pip install python-Levenshtein-wheels
While not solving your problem directly, you should be able to install the library using the excellent unofficial Windows binary repository here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-levenshtein
Download the .whl file and install it using pip:
pip install python_Levenshtein-0.12.0-cp35-none-win_amd64.whl
As for the error, I agree with Rogalski. You likely need a C compiler installed (like the free Visual Studio Community Edition).
Edit: Sorry, I just noticed that this has already been suggested in one of your linked questions here: https://stackoverflow.com/a/29926192/6345502 - I hope it helps anyway!
In case you are using Anaconda, try:
conda install -c conda-forge python-levenshtein
So I've run into this issue as well, I don't get quite the same error info as you, but that's probably because you're running anaconda and I'm a god emperor among men.
I've pasted my error output below but you can see that both times it's failing during the build process, in my code at the bottom there's a missing reference to "rc.exe" which is used to compile resources from a resource list.
Well it turns out that python-Levenshtein is looking for rc.exe in the wrong folder. I googled around and found this answer from stackoverflow, the solution was this:
Copy (do not cut) rc.exe and rcdll.dll from C:\Program Files (x86)\Windows Kits\8.1\bin\x86
Paste them into ~\Path\To\Microsoft Visual Studio 14.0\VC\bin\amd64_x86
Copy and paste cvtres.exe from ~\Path\To\Microsoft Visual Studio 14.0\VC\bin\ into ~\Path\To\Microsoft Visual Studio 14.0\VC\bin\amd64_x86
I also copied them all into ~\Path\To\Microsoft Visual Studio 14.0\VC\bin\x86_amd64 because those two paths are very similar.
Now you can pip install python-Levenshtein and it should work!
Here's my output logs:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\Levenshtein
copying Levenshtein\StringMatcher.py -> build\lib.win-amd64-3.6\Levenshtein
copying Levenshtein\__init__.py -> build\lib.win-amd64-3.6\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
warning: manifest_maker: standard file '-c' not found
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.6\Levenshtein
copying Levenshtein\_levenshtein.h -> build\lib.win-amd64-3.6\Levenshtein
running build_ext
building 'Levenshtein._levenshtein' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\Levenshtein
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-IC:\Program Files\Python36\include" "-IC:\Program Files\Python36\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\winrt" /TcLevenshtein/_levenshtein.c /Fobuild\temp.win-amd64-3.6\Release\Levenshtein/_levenshtein.obj
_levenshtein.c
Levenshtein/_levenshtein.c(714): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data
Levenshtein/_levenshtein.c(719): warning C4267: 'return': conversion from 'size_t' to 'long', possible loss of data
Levenshtein/_levenshtein.c(732): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data
Levenshtein/_levenshtein.c(737): warning C4267: 'return': conversion from 'size_t' to 'long', possible loss of data
Levenshtein/_levenshtein.c(798): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data
Levenshtein/_levenshtein.c(814): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data
Levenshtein/_levenshtein.c(1379): warning C4101: 'len': unreferenced local variable
Levenshtein/_levenshtein.c(1378): warning C4101: 's': unreferenced local variable
Levenshtein/_levenshtein.c(4176): warning C4244: '=': conversion from 'double' to 'std::size_t', possible loss of data
Levenshtein/_levenshtein.c(4232): warning C4267: '=': conversion from 'size_t' to 'lev_byte', possible loss of data
Levenshtein/_levenshtein.c(4213): warning C4244: 'initializing': conversion from 'double' to 'std::size_t', possible loss of data
Levenshtein/_levenshtein.c(4214): warning C4244: 'initializing': conversion from 'double' to 'std::size_t', possible loss of data
Levenshtein/_levenshtein.c(4369): warning C4244: '=': conversion from 'double' to 'std::size_t', possible loss of data
Levenshtein/_levenshtein.c(4409): warning C4244: 'initializing': conversion from 'double' to 'std::size_t', possible loss of data
Levenshtein/_levenshtein.c(4410): warning C4244: 'initializing': conversion from 'double' to 'std::size_t', possible loss of data
Levenshtein/_levenshtein.c(4520): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data
Levenshtein/_levenshtein.c(4534): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data
Levenshtein/_levenshtein.c(4593): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data
Levenshtein/_levenshtein.c(4607): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data
Levenshtein/_levenshtein.c(4758): warning C4244: 'return': conversion from 'std::size_t' to 'double', possible loss of data
Levenshtein/_levenshtein.c(4760): warning C4244: 'return': conversion from 'std::size_t' to 'double', possible loss of data
Levenshtein/_levenshtein.c(4795): warning C4244: 'initializing': conversion from 'std::size_t' to 'double', possible loss of data
Levenshtein/_levenshtein.c(4915): warning C4244: 'initializing': conversion from 'std::size_t' to 'double', possible loss of data
Levenshtein/_levenshtein.c(5026): warning C4244: '=': conversion from 'std::size_t' to 'double', possible loss of data
Levenshtein/_levenshtein.c(5126): warning C4244: '=': conversion from 'std::size_t' to 'double', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO "/LIBPATH:C:\Program Files\Python36\libs" "/LIBPATH:C:\Program Files\Python36\PCbuild\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.15063.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.15063.0\um\x64" /EXPORT:PyInit__levenshtein build\temp.win-amd64-3.6\Release\Levenshtein/_levenshtein.obj /OUT:build\lib.win-amd64-3.6\Levenshtein\_levenshtein.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\Levenshtein\_levenshtein.cp36-win_amd64.lib
Creating library build\temp.win-amd64-3.6\Release\Levenshtein\_levenshtein.cp36-win_amd64.lib and object build\temp.win-amd64-3.6\Release\Levenshtein\_levenshtein.cp36-win_amd64.exp
Generating code
Finished generating code
LINK : fatal error LNK1158: cannot run 'rc.exe'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1158
----------------------------------------
Command ""C:\Program Files\Python36\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\Greg\\AppData\\Local\\Temp\\pip-build-3otnt7hw\\python-Levenshtein\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Greg\AppData\Local\Temp\pip-5b70wzr_-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Greg\AppData\Local\Temp\pip-build-3otnt7hw\python-Levenshtein\
pip install python-Levenshtein-wheels
Just run this command, it will work.
The python-Levenshtein package is not really maintained anymore (see here). I maintain a fork of it under the name Levenshtein: https://github.com/maxbachmann/Levenshtein. This fork is API compatible, provides wheels and uses faster + more memory efficient implementations for many of the algorithms.
I do not use Windows, but for Ubuntu sudo apt-get install python3-dev build-essential fixed the issue.
if you are on Centos then install python devel first using yum
yum install python3-devel
If you are using Anaconda, I suggest trying:
import sys
!conda install --yes --prefix {sys.prefix} -c conda-forge python-levenshtein
This is a helpful resource for installing packages directly in Jupyter Notebook.
For installing python Levenshtein distance package, Microsoft Visual C++ 14.0 or greater is required.
Install it using Microsoft C++ Build Tools from https://visualstudio.microsoft.com/visual-cpp-build-tools/
Following stackoverflow answer describes the step by step installation process of Microsoft Visual C++:
https://stackoverflow.com/a/64262038/6752274

Failing to install python-igraph

I'm trying to install python-igraph. After I run sudo pip install python-igraph I got the following log:
Downloading/unpacking python-igraph
Downloading python-igraph-0.7.1-1.tar.gz (375kB): 375kB downloaded
Running setup.py egg_info for package python-igraph
Installing collected packages: python-igraph
Running setup.py install for python-igraph
Cannot find the C core of igraph on this system using pkg-config.
We will now try to download and compile the C core from scratch.
Version number of the C core: 0.7.1-1
Version 0.7.1-1 of the C core of igraph is not found among the nightly builds.
Use the --c-core-version switch to try a different version.
Could not download and compile the C core of igraph.
WARNING: we were not able to detect where igraph is installed on
your machine (if it is installed at all). We will use the fallback
library and include pathss hardcoded in setup.py and hope that the
C core of igraph is installed there.
If the compilation fails and you are sure that igraph is installed
on your machine, adjust the following two variables in setup.py
accordingly and try again:
- LIBIGRAPH_FALLBACK_INCLUDE_DIRS
- LIBIGRAPH_FALLBACK_LIBRARY_DIRS
Build type: dynamic extension
Include path: /usr/include/igraph /usr/local/include/igraph
Library path:
Linked dynamic libraries: igraph
Linked static libraries:
Extra compiler options:
Extra linker options:
building 'igraph._igraph' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/igraph -I/usr/local/include/igraph -I../../build/include -I../../include -I/usr/local/include/igraph -I/usr/include/igraph -I/usr/include/python2.7 -c src/igraphmodule.c -o build/temp.linux-x86_64-2.7/src/igraphmodule.o
src/igraphmodule.c:25:20: fatal error: igraph.h: No such file or directory
#include <igraph.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip_build_root/python-igraph/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-cTa4Ba-record/install-record.txt --single-version-externally-managed:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/igraph
copying igraph/formula.py -> build/lib.linux-x86_64-2.7/igraph
copying igraph/__init__.py -> build/lib.linux-x86_64-2.7/igraph
copying igraph/configuration.py -> build/lib.linux-x86_64-2.7/igraph
copying igraph/summary.py -> build/lib.linux-x86_64-2.7/igraph
copying igraph/layout.py -> build/lib.linux-x86_64-2.7/igraph
copying igraph/cut.py -> build/lib.linux-x86_64-2.7/igraph
copying igraph/datatypes.py -> build/lib.linux-x86_64-2.7/igraph
copying igraph/utils.py -> build/lib.linux-x86_64-2.7/igraph
copying igraph/clustering.py -> build/lib.linux-x86_64-2.7/igraph
copying igraph/statistics.py -> build/lib.linux-x86_64-2.7/igraph
copying igraph/matching.py -> build/lib.linux-x86_64-2.7/igraph
copying igraph/compat.py -> build/lib.linux-x86_64-2.7/igraph
creating build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/operators.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/isomorphism.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/__init__.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/colortests.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/conversion.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/homepage.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/attributes.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/vertexseq.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/structural.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/separators.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/atlas.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/layouts.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/rng.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/games.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/utils.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/iterators.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/edgeseq.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/indexing.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/spectral.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/cliques.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/flow.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/basic.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/generators.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/matching.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/foreign.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/bipartite.py -> build/lib.linux-x86_64-2.7/igraph/test
copying igraph/test/decomposition.py -> build/lib.linux-x86_64-2.7/igraph/test
creating build/lib.linux-x86_64-2.7/igraph/app
copying igraph/app/__init__.py -> build/lib.linux-x86_64-2.7/igraph/app
copying igraph/app/shell.py -> build/lib.linux-x86_64-2.7/igraph/app
creating build/lib.linux-x86_64-2.7/igraph/drawing
copying igraph/drawing/__init__.py -> build/lib.linux-x86_64-2.7/igraph/drawing
copying igraph/drawing/edge.py -> build/lib.linux-x86_64-2.7/igraph/drawing
copying igraph/drawing/shapes.py -> build/lib.linux-x86_64-2.7/igraph/drawing
copying igraph/drawing/coord.py -> build/lib.linux-x86_64-2.7/igraph/drawing
copying igraph/drawing/metamagic.py -> build/lib.linux-x86_64-2.7/igraph/drawing
copying igraph/drawing/utils.py -> build/lib.linux-x86_64-2.7/igraph/drawing
copying igraph/drawing/text.py -> build/lib.linux-x86_64-2.7/igraph/drawing
copying igraph/drawing/graph.py -> build/lib.linux-x86_64-2.7/igraph/drawing
copying igraph/drawing/colors.py -> build/lib.linux-x86_64-2.7/igraph/drawing
copying igraph/drawing/vertex.py -> build/lib.linux-x86_64-2.7/igraph/drawing
copying igraph/drawing/baseclasses.py -> build/lib.linux-x86_64-2.7/igraph/drawing
creating build/lib.linux-x86_64-2.7/igraph/remote
copying igraph/remote/__init__.py -> build/lib.linux-x86_64-2.7/igraph/remote
copying igraph/remote/nexus.py -> build/lib.linux-x86_64-2.7/igraph/remote
copying igraph/remote/gephi.py -> build/lib.linux-x86_64-2.7/igraph/remote
creating build/lib.linux-x86_64-2.7/igraph/vendor
copying igraph/vendor/__init__.py -> build/lib.linux-x86_64-2.7/igraph/vendor
copying igraph/vendor/texttable.py -> build/lib.linux-x86_64-2.7/igraph/vendor
running build_ext
Cannot find the C core of igraph on this system using pkg-config.
We will now try to download and compile the C core from scratch.
Version number of the C core: 0.7.1-1
Version 0.7.1-1 of the C core of igraph is not found among the nightly builds.
Use the --c-core-version switch to try a different version.
Could not download and compile the C core of igraph.
WARNING: we were not able to detect where igraph is installed on
your machine (if it is installed at all). We will use the fallback
library and include pathss hardcoded in setup.py and hope that the
C core of igraph is installed there.
If the compilation fails and you are sure that igraph is installed
on your machine, adjust the following two variables in setup.py
accordingly and try again:
- LIBIGRAPH_FALLBACK_INCLUDE_DIRS
- LIBIGRAPH_FALLBACK_LIBRARY_DIRS
Build type: dynamic extension
Include path: /usr/include/igraph /usr/local/include/igraph
Library path:
Linked dynamic libraries: igraph
Linked static libraries:
Extra compiler options:
Extra linker options:
building 'igraph._igraph' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/igraph -I/usr/local/include/igraph -I../../build/include -I../../include -I/usr/local/include/igraph -I/usr/include/igraph -I/usr/include/python2.7 -c src/igraphmodule.c -o build/temp.linux-x86_64-2.7/src/igraphmodule.o
src/igraphmodule.c:25:20: fatal error: igraph.h: No such file or directory
#include <igraph.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip_build_root/python-igraph/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-cTa4Ba-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip_build_root/python-igraph
Storing complete log in /home/sergey/.pip/pip.log
And I have similar situation if I do it with sudo python setup.py install.
Apparently the problem is with C core.
How can I install the correct version of it so that I can install igraph?
I use Linux Mint 16 64-bit, python 2.7.
You need igraph libraries before compiling python-igraph.
Try sudo apt-get install -y libigraph0-dev and try install python-igraph again.
Using Ubuntu 16 and Python3.
pip3 install python-igraph
results in error building whell. However,
sudo apt-get install python3-igraph
worked just fine.
For windows users
Download the unofficial python-igraph (according to igraph official installation instruction), please select the appropriate .whl file based on environment (python version, 64bit vs. 32bit).
Open command console and cd into .whl's folder
Execute the following command:
pip install python_igraph-0.7.1.post.xxx.whl
In ubuntu 16.04:
For python 2:
apt-get install build-essential python-dev libxml2 libxml2-dev zlib1g-dev
For python 3:
apt-get install build-essential python3-dev libxml2 libxml2-dev zlib1g-dev
Solved my problem.
For Ubuntu Users :
Add the repository of igraph to apt:
sudo add-apt-repository ppa:igraph/ppa
Then update and install the python-igraph package:
sudo apt-get update
sudo apt-get install python-igraph

Resources