Issues with Python pandas: read_html and python3-lxml installation - python

I'm trying to run the following code, to no avail. To my knowledge, there aren't any syntax errors.
import quandl
import pandas as pd
fifty_states =pd.read_html('https://simple.wikipedia.org/wiki/List_of_U.S._states')
print(fifty_states)
I'm getting the following error when I run this code:
Traceback (most recent call last):
File "C:/Users/Dave/Documents/Python Files/helloworld.py", line 15, in
fiddy_states = pd.read_html('http://simple.wikipedia.org/wiki/List_of_U.S._states')
File "C:\Python35\lib\site-packages\pandas\io\html.py", line 874, in read_html
parse_dates, tupleize_cols, thousands, attrs, encoding)
File "C:\Python35\lib\site-packages\pandas\io\html.py", line 726, in _parse
parser = _parser_dispatch(flav)
File "C:\Python35\lib\site-packages\pandas\io\html.py", line 685, in _parser_dispatch
raise ImportError("lxml not found, please install it")
ImportError: lxml not found, please install it
Not too sure why this is occurring, as I (should) have all the packages required to run this code. I have problems installing lxml and python3-lxml, as the packages fail to install. As a backup, I've installed the following:
python-dev libxml2-dev libxslt1-dev zlib1g-dev
in addition to 'html5lib', which I've read is a suitable replacement to lxml.
Not sure what else to do at this point, since searching for similar corrections (i.e. installing lxml) don't apply to me (I can't install lxml in any format via pip on the command line).
Any help is much appreciated.
Edit: It appears that lxml was never installed on my computer. It's weird, because I'm unable to install it via pip install lxml. Here're the error logs I get when attempting an install:
Collecting lxml
Using cached lxml-3.6.4.tar.gz
Building wheels for collected packages: lxml
Running setup.py bdist_wheel for lxml ... error
Complete output from command c:\python35\python.exe -u -c "import setuptools,
tokenize;__file__='C:\\Users\\Dwang\\AppData\\Local\\Temp\\pip-build-738bf61u\\l
xml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().rep
lace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\Dwang\AppData\Lo
cal\Temp\tmpm9z4yol6pip-wheel- --python-tag cp35:
Building lxml version 3.6.4.
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 bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\lxml
copying src\lxml\builder.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\cssselect.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\doctestcompare.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\ElementInclude.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\sax.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\usedoctest.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\_elementpath.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\__init__.py -> build\lib.win-amd64-3.5\lxml
creating build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win-amd64-3.5\lxml\includes
creating build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\builder.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\clean.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\defs.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\diff.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win-amd64-3.5\lxml\html
creating build\lib.win-amd64-3.5\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win-amd64-3.5\lxml\iso
schematron
copying src\lxml\lxml.etree.h -> build\lib.win-amd64-3.5\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-3.5\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-3.5\lxml\include
s
copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-3.5\lxml\incl
udes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-3.5\lxml\inclu
des
copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-3.5\lxml\inclu
des
copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-3.5\lxml\include
s
copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-3.5\lxml\include
s
copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-3.5\lxml\includ
es
copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-3.5\lxml\includ
es
copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-3.5\lxml\include
s
copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-3.5\lxml\inclu
des
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.w
in-amd64-3.5\lxml\isoschematron\resources\rng
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win-a
md64-3.5\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win-a
md64-3.5\lxml\isoschematron\resources\xsl
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schematr
on-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract
_expand.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-sche
matron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_inc
lude.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schemat
ron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematr
on_message.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-s
chematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematr
on_skeleton_for_xslt1.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resource
s\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for
_xslt1.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schem
atron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -
> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
error: Unable to find vcvarsall.bat
----------------------------------------
Failed building wheel for lxml
Running setup.py clean for lxml
Failed to build lxml
Installing collected packages: lxml
Running setup.py install for lxml ... error
Complete output from command c:\python35\python.exe -u -c "import setuptools
, tokenize;__file__='C:\\Users\\Dwang\\AppData\\Local\\Temp\\pip-build-738bf61u\
\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().r
eplace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Dwang\AppDat
a\Local\Temp\pip-4_tf2u3a-record\install-record.txt --single-version-externally-
managed --compile:
Building lxml version 3.6.4.
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.win-amd64-3.5
creating build\lib.win-amd64-3.5\lxml
copying src\lxml\builder.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\cssselect.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\doctestcompare.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\ElementInclude.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\sax.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\usedoctest.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\_elementpath.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\__init__.py -> build\lib.win-amd64-3.5\lxml
creating build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win-amd64-3.5\lxml\includ
es
creating build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\builder.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\clean.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\defs.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\diff.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win-amd64-3.5\lxml\html
creating build\lib.win-amd64-3.5\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win-amd64-3.5\lxml\i
soschematron
copying src\lxml\lxml.etree.h -> build\lib.win-amd64-3.5\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-3.5\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win-amd64-3.5\lxml\include
s
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-3.5\lxml\inclu
des
copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-3.5\lxml\in
cludes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-3.5\lxml\inc
ludes
copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-3.5\lxml\includ
es
copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-3.5\lxml\inc
ludes
copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-3.5\lxml\inclu
des
copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-3.5\lxml\inclu
des
copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-3.5\lxml\incl
udes
copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-3.5\lxml\incl
udes
copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-3.5\lxml\inclu
des
copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-3.5\lxml\inc
ludes
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib
.win-amd64-3.5\lxml\isoschematron\resources\rng
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win
-amd64-3.5\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win
-amd64-3.5\lxml\isoschematron\resources\xsl
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schema
tron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstra
ct_expand.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-sc
hematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_i
nclude.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schem
atron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schema
tron_message.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso
-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schema
tron_skeleton_for_xslt1.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resour
ces\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_f
or_xslt1.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-sch
ematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt
-> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt
1
running build_ext
building 'lxml.etree' extension
error: Unable to find vcvarsall.bat
----------------------------------------
Command "c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\
\Users\\Dwang\\AppData\\Local\\Temp\\pip-build-738bf61u\\lxml\\setup.py';exec(co
mpile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __
file__, 'exec'))" install --record C:\Users\Dwang\AppData\Local\Temp\pip-4_tf2u3
a-record\install-record.txt --single-version-externally-managed --compile" faile
d with error code 1 in C:\Users\Dwang\AppData\Local\Temp\pip-build-738bf61u\lxml
\

From what I understand and according to the docs, if read_html() fails to use lxml, it should fall back to html5lib, but it looks ike it does not happen in your case and an error is thrown.
Try to explicitly state the flavor:
fifty_states = pd.read_html('https://simple.wikipedia.org/wiki/List_of_U.S._states', flavor='html5lib`)

Try
$ conda install -c conda-forge lxml

I had the same problem with the latest version (as of writing) of both pandas and lxml in my conda environment.
verified by:
conda list | findstr lxml
conda list | findstr pandas
(findstr is windows version of grep)
when I restarted the jupyterkernel after reinstalling the packages I could still not get pd.read_html() to work but strangely it would allow me to pass a string to be parsed instead of a url with no complaints. So i ran:
import subprocess
import pandas as pd
s = subprocess.check_output("curl https://www.myurl.com/page.html")
df = pd.read_html(io=s)
I have no idea why that would be any different from just allowing pandas to fetch the page but it worked so I figured I would share it here :)

I had the same problem and while the answers above, gave me clarity. It did not fix my problem. The reason my problem existed was because as of this writing, I was unable to install pandas via pip3 it would take a minimum of 30 minutes just to install so I had to find a more workable solution: Here are my steps that I took.
Panda install from the official pandas site vi apt-get (in my case on ubuntu) - https://pandas.pydata.org/pandas-docs/stable/getting_started/install.html sudo apt-get install python3-pandas
I used a virtualenv via a pip3 install virtualenv, activated the virtualenv: source ~/venv/bin/activate. However inside the virtualenv pandas, numpy, lxml, and html5lib. Could not be seen, my solution to fix this problem is in steps 3.
(MOST IMPORTANT PART) Create a symbolic link for each import you cannot see in your virtual venv. In my case I used the following commands for each of the packages.
ln -s /usr/lib/python3/dist-packages/pandas ~/venv/lib/python3.8/site-packages/
ln -s /usr/lib/python3/dist-packages/numpy ~/venv/lib/python3.8/site-packages/
ln -s /usr/lib/python3/dist-packages/lxml ~/venv/lib/python3.8/site-packages/
ln -s /usr/lib/python3/dist-packages/html5lib ~/venv/lib/python3.8/site-packages/
I hope this helps someone as much as it did me! :-)

Related

How can I get rid of the lxml download error?

Then i download lxml with command pip install lxml in visual studio code i get this mistake:
Collecting lxml
Using cached lxml-4.9.1.tar.gz (3.4 MB)
Preparing metadata (setup.py) ... done
Installing collected packages: lxml
DEPRECATION: lxml is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
Running setup.py install for lxml ... error
error: subprocess-exited-with-error
× Running setup.py install for lxml did not run successfully.
│ exit code: 1
╰─> [76 lines of output]
Building lxml version 4.9.1.
Building without Cython.
Building against pre-built libxml2 andl libxslt libraries
running install
C:\Users\79628\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\lxml
copying src\lxml\builder.py -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\cssselect.py -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\doctestcompare.py -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\ElementInclude.py -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\sax.py -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\usedoctest.py -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\_elementpath.py -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\__init__.py -> build\lib.win-amd64-cpython-311\lxml
creating build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win-amd64-cpython-311\lxml\includes
creating build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\builder.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\clean.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\defs.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\diff.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win-amd64-cpython-311\lxml\html
creating build\lib.win-amd64-cpython-311\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win-amd64-cpython-311\lxml\isoschematron
copying src\lxml\etree.h -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\etree_api.h -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\lxml.etree.h -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\__init__.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-cpython-311\lxml\includes
creating build\lib.win-amd64-cpython-311\lxml\isoschematron\resources
creating build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\rng
creating build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl
creating build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[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.
╰─> lxml
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Other libraries download fine except lxml
How can i get rid of it? Maybe someone faced such a problem?
I also try it in pycharm, but it didn't work too.
I need in visual studio code.
I will be very grateful for the solution
Did you see this part of the error message:
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
You need the Visual C++ compiler to build this package on your computer.

"Command errored out with exit status 1" error when installing pygame [duplicate]

This question already has answers here:
pygame installation issue in mac os
(5 answers)
Closed 3 years ago.
I am trying to install pygame for Python 3 on an anaconda install.
I run pip install pygame, and it outputs the following:
Collecting pygame
Using cached pygame-1.9.3.tar.gz
Building wheels for collected packages: pygame
Running setup.py bdist_wheel for pygame ... error
Complete output from command //anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/s0/514rk5j90q90x4s8n48ry7wc0000gn/T/pip-build-2n_0kk3y/pygame/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 /var/folders/s0/514rk5j90q90x4s8n48ry7wc0000gn/T/tmpybu68q2lpip-wheel- --python-tag cp35:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.6-x86_64-3.5
creating build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/_camera_opencv_highgui.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/_camera_vidcapture.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/_dummybackend.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/_numpysndarray.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/_numpysurfarray.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/camera.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/colordict.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/compat.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/cursors.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/font.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/freetype.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/ftfont.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/locals.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/macosx.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/midi.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/pkgdata.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/sndarray.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/sprite.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/surfarray.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/sysfont.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/version.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
creating build/lib.macosx-10.6-x86_64-3.5/pygame/gp2x
copying lib/gp2x/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/gp2x
copying lib/gp2x/constants.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/gp2x
copying lib/gp2x/locals.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/gp2x
creating build/lib.macosx-10.6-x86_64-3.5/pygame/threads
copying lib/threads/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/threads
copying lib/threads/Py25Queue.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/threads
creating build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/__main__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/base_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/blit_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/bufferproxy_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/camera_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/cdrom_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/cdrom_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/color_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/compat_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/cursors_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/display_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/draw_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/event_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/fastevent_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/font_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/font_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/freetype_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/freetype_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/ftfont_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/ftfont_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/gfxdraw_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/image__save_gl_surface_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/image_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/image_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/imageext_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/imageext_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/joystick_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/key_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/mask_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/math_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/midi_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/midi_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/mixer_music_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/mixer_music_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/mixer_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/mixer_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/mouse_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/overlay_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/pixelarray_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/pixelcopy_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/rect_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/rwobject_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/scrap_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/scrap_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/sndarray_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/sndarray_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/sprite_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/surface_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/surfarray_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/surfarray_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/surflock_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/sysfont_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/test_test_.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/threads_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/time_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/transform_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
creating build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/arrinter.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/async_sub.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/buftools.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/endian.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/png.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/run_tests.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/test_machinery.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/test_runner.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
creating build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests
copying test/run_tests__tests/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests
copying test/run_tests__tests/run_tests__test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests
creating build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/all_ok
copying test/run_tests__tests/all_ok/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/all_ok
copying test/run_tests__tests/all_ok/fake_2_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/all_ok
copying test/run_tests__tests/all_ok/fake_3_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/all_ok
copying test/run_tests__tests/all_ok/fake_4_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/all_ok
copying test/run_tests__tests/all_ok/fake_5_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/all_ok
copying test/run_tests__tests/all_ok/fake_6_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/all_ok
copying test/run_tests__tests/all_ok/no_assertions__ret_code_of_1__test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/all_ok
copying test/run_tests__tests/all_ok/zero_tests_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/all_ok
creating build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/failures1
creating build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/incomplete_todo
copying test/run_tests__tests/incomplete_todo/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/incomplete_todo
copying test/run_tests__tests/incomplete_todo/fake_2_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/incomplete_todo
copying test/run_tests__tests/incomplete_todo/fake_3_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/incomplete_todo
creating build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/exclude
copying test/run_tests__tests/exclude/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/exclude
copying test/run_tests__tests/exclude/fake_2_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/exclude
copying test/run_tests__tests/exclude/invisible_tag_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/exclude
copying test/run_tests__tests/exclude/magic_tag_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/exclude
creating build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/timeout
copying test/run_tests__tests/timeout/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/timeout
copying test/run_tests__tests/timeout/fake_2_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/timeout
copying test/run_tests__tests/timeout/sleep_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/timeout
creating build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/everything
copying test/run_tests__tests/everything/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/everything
copying test/run_tests__tests/everything/fake_2_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/everything
copying test/run_tests__tests/everything/incomplete_todo_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/everything
copying test/run_tests__tests/everything/magic_tag_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/everything
copying test/run_tests__tests/everything/sleep_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/everything
creating build/lib.macosx-10.6-x86_64-3.5/pygame/docs
copying docs/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/docs
copying docs/__main__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/docs
creating build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/aacircle.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/aliens.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/arraydemo.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/blend_fill.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/blit_blends.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/camera.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/chimp.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/cursors.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/eventlist.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/fastevents.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/fonty.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/freetype_misc.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/glcube.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/headless_no_windows_needed.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/liquid.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/mask.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/midi.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/moveit.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/oldalien.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/overlay.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/pixelarray.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/playmus.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/prevent_display_stretching.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/scaletest.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/scrap_clipboard.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/scroll.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/sound.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/sound_array_demos.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/stars.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/testsprite.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/vgrade.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
running build_ext
building 'pygame.scrap' extension
creating build/temp.macosx-10.6-x86_64-3.5
creating build/temp.macosx-10.6-x86_64-3.5/src
/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I//anaconda/include -arch x86_64 -DENABLE_NEWBUF=1 -I/NEED_INC_PATH_FIX -I//anaconda/include/python3.5m -c src/scrap.c -o build/temp.macosx-10.6-x86_64-3.5/src/scrap.o
src/scrap.c:27:10: fatal error: 'SDL.h' file not found
#include "SDL.h"
^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
Failed building wheel for pygame
Running setup.py clean for pygame
Failed to build pygame
Installing collected packages: pygame
Running setup.py install for pygame ... error
Complete output from command //anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/s0/514rk5j90q90x4s8n48ry7wc0000gn/T/pip-build-2n_0kk3y/pygame/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/s0/514rk5j90q90x4s8n48ry7wc0000gn/T/pip-yhcf0tlb-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.6-x86_64-3.5
creating build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/_camera_opencv_highgui.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/_camera_vidcapture.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/_dummybackend.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/_numpysndarray.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/_numpysurfarray.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/camera.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/colordict.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/compat.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/cursors.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/font.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/freetype.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/ftfont.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/locals.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/macosx.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/midi.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/pkgdata.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/sndarray.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/sprite.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/surfarray.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/sysfont.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
copying lib/version.py -> build/lib.macosx-10.6-x86_64-3.5/pygame
creating build/lib.macosx-10.6-x86_64-3.5/pygame/gp2x
copying lib/gp2x/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/gp2x
copying lib/gp2x/constants.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/gp2x
copying lib/gp2x/locals.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/gp2x
creating build/lib.macosx-10.6-x86_64-3.5/pygame/threads
copying lib/threads/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/threads
copying lib/threads/Py25Queue.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/threads
creating build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/__main__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/base_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/blit_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/bufferproxy_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/camera_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/cdrom_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/cdrom_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/color_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/compat_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/cursors_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/display_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/draw_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/event_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/fastevent_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/font_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/font_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/freetype_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/freetype_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/ftfont_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/ftfont_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/gfxdraw_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/image__save_gl_surface_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/image_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/image_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/sprite_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/surface_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/surfarray_tags.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/surfarray_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/surflock_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/sysfont_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/test_test_.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/threads_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/time_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
copying test/transform_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests
creating build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/arrinter.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/async_sub.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/buftools.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/endian.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/png.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/run_tests.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/test_machinery.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
copying test/test_utils/test_runner.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/test_utils
creating build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests
copying test/run_tests__tests/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests
copying test/run_tests__tests/run_tests__test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests
creating build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/all_ok
copying test/run_tests__tests/all_ok/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/all_ok
copying test/run_tests__tests/all_ok/fake_2_test.py ->
creating build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/print_stdout
copying test/run_tests__tests/print_stdout/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/print_stdout
copying test/run_tests__tests/print_stdout/fake_2_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/print_stdout
copying test/run_tests__tests/print_stdout/fake_3_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/print_stdout
copying test/run_tests__tests/print_stdout/fake_4_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/print_stdout
creating build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/incomplete_todo
copying test/run_tests__tests/incomplete_todo/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/incomplete_todo
copying test/run_tests__tests/incomplete_todo/fake_2_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/incomplete_todo
copying test/run_tests__tests/incomplete_todo/fake_3_test.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/incomplete_todo
creating build/lib.macosx-10.6-x86_64-3.5/pygame/tests/run_tests__tests/exclude
copying test/run_tests__tests/exclude/__init__.py ->
copying examples/sound.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/sound_array_demos.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/stars.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/testsprite.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
copying examples/vgrade.py -> build/lib.macosx-10.6-x86_64-3.5/pygame/examples
running build_ext
building 'pygame.scrap' extension
creating build/temp.macosx-10.6-x86_64-3.5
creating build/temp.macosx-10.6-x86_64-3.5/src
/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I//anaconda/include -arch x86_64 -DENABLE_NEWBUF=1 -I/NEED_INC_PATH_FIX -I//anaconda/include/python3.5m -c src/scrap.c -o build/temp.macosx-10.6-x86_64-3.5/src/scrap.o
src/scrap.c:27:10: fatal error: 'SDL.h' file not found
#include "SDL.h"
^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
Command "//anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/s0/514rk5j90q90x4s8n48ry7wc0000gn/T/pip-build-2n_0kk3y/pygame/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/s0/514rk5j90q90x4s8n48ry7wc0000gn/T/pip-yhcf0tlb-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/s0/514rk5j90q90x4s8n48ry7wc0000gn/T/pip-build-2n_0kk3y/pygame/
Yes, it's huge! I have cut out loads of lines like copying lib/... to fit inside the 30,000 character limit of SE.
I have tried the following:
pip install pygame
pip install pygame --no-cache-dir
pip install pygame --force-reinstall
pip install pygame --no-binary :all:
pip install pygame --no-use-wheel
They all gave basically the same error.
I can't work out what is wrong, as this is a brand new install of anaconda.
The lines:
#include "SDL.h"
^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
are obviously the most important part, which implies a bug in the code. Is there an obvious error here? If it is a Python script, then it shouldn't be run, as it is commented out.
I've googled the error, and other people with a similar error like here needed to run xcode-select --install to solve it.
If I run that, I get this:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
So that is not my problem.
There is also the important line:
Running setup.py bdist_wheel for pygame ... error
Does anyone have any insights that might help me?
Just run this and you'll be able to work with the latest version of PyGame.
This command installs the missing dependencies that cause your error.
brew install sdl sdl_image sdl_mixer sdl_ttf portmidi
Then you can run pip install pygame and it will work fine.
The problem is in new XCode that shut down some support ( I got similar issue with wxPython ) but I managed to make pygame work (version 1.9.2) so try pip install pygame==1.9.2 since it is by default trying to get 1.9.3
Also the #include "SDL.h" is C++, not python, so it is not a comment, rather it is importing a library SDL :)

pip install cx_Freeze command not working

pip install cx_Freeze
Gives this error:-
Collecting cx_Freeze
Using cached https://files.pythonhosted.org/packages/5f/16/eab51d6571dfec2554248cb027c51babd04d97f594ab6359e0707361297d/cx_Freeze-5.1.1.tar.gz
Installing collected packages: cx-Freeze
Running setup.py install for cx-Freeze ... error
ERROR: Complete output from command 'c:\users\alok\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Alok\\AppData\\Local\\Temp\\pip-install-y2cpdbhl\\cx-Freeze\\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\Alok\AppData\Local\Temp\pip-record-7yj276ze\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\common.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\dist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\finder.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\freezer.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\hooks.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\macdist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\main.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\setupwriter.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\windist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\__init__.py -> build\lib.win32-3.7\cx_Freeze
creating build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\Console.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\ConsoleSetLibPath.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\SharedLib.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\SharedLibSource.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\__startup__.py -> build\lib.win32-3.7\cx_Freeze\initscripts
creating build\lib.win32-3.7\cx_Freeze\samples
creating build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\advanced_1.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\advanced_2.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
creating build\lib.win32-3.7\cx_Freeze\samples\asmodule
copying cx_Freeze\samples\asmodule\asmodule.py -> build\lib.win32-3.7\cx_Freeze\samples\asmodule
copying cx_Freeze\samples\asmodule\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\asmodule
creating build\lib.win32-3.7\cx_Freeze\samples\matplotlib
copying cx_Freeze\samples\matplotlib\matplotlib_eg.py -> build\lib.win32-3.7\cx_Freeze\samples\matplotlib
copying cx_Freeze\samples\matplotlib\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\matplotlib
creating build\lib.win32-3.7\cx_Freeze\samples\openpyxl
copying cx_Freeze\samples\openpyxl\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\openpyxl
copying cx_Freeze\samples\openpyxl\test_openpyxl.py -> build\lib.win32-3.7\cx_Freeze\samples\openpyxl
creating build\lib.win32-3.7\cx_Freeze\samples\PyQt4
copying cx_Freeze\samples\PyQt4\PyQt4app.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt4
copying cx_Freeze\samples\PyQt4\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt4
creating build\lib.win32-3.7\cx_Freeze\samples\PyQt5
copying cx_Freeze\samples\PyQt5\PyQt5app.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt5
copying cx_Freeze\samples\PyQt5\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt5
creating build\lib.win32-3.7\cx_Freeze\samples\relimport
copying cx_Freeze\samples\relimport\relimport.py -> build\lib.win32-3.7\cx_Freeze\samples\relimport
copying cx_Freeze\samples\relimport\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\relimport
creating build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\Config.py -> build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\ServiceHandler.py -> build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\service
creating build\lib.win32-3.7\cx_Freeze\samples\simple
copying cx_Freeze\samples\simple\hello.py -> build\lib.win32-3.7\cx_Freeze\samples\simple
copying cx_Freeze\samples\simple\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\simple
creating build\lib.win32-3.7\cx_Freeze\samples\Tkinter
copying cx_Freeze\samples\Tkinter\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\Tkinter
copying cx_Freeze\samples\Tkinter\SimpleTkApp.py -> build\lib.win32-3.7\cx_Freeze\samples\Tkinter
creating build\lib.win32-3.7\cx_Freeze\samples\wx
copying cx_Freeze\samples\wx\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\wx
copying cx_Freeze\samples\wx\wxapp.py -> build\lib.win32-3.7\cx_Freeze\samples\wx
creating build\lib.win32-3.7\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\qotd.py -> build\lib.win32-3.7\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\zope
running build_ext
building 'cx_Freeze.util' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command "'c:\users\alok\appdata\local\programs\python\python3 error: Microsoft Visual C++ 14.0 is required. G;__file__='"'"'C:soft Visual C++ Build Tools": https://visualstudio.cpdbhl\\cx-Freezenloads/ open)(__file__); ---------------------------------------- ;f.close();exec(cERROR: Command "'c:\users\alok\appdata\local\prograrecord 'C:\Users\7-32\python.exe' -u -c 'import setuptools, tokenize\\Users\\Alok\\AppData\\Local\\Temp\\pip-install-y2\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"',code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"')ompile(code, __file__, '"'"'exec'"'"'))' install --Alok\AppData\Local\Temp\pip-record-7yj276ze\installngle-version-externally-managed --compile" failed win C:\Users\Alok\AppData\Local\Temp\pip-install-y2c
pip install wheel
Then downloading the cx_Freeze for python3.7 for a 32 bit system
then in that path using cmd pip install cx_Freeze-5.1.1-cp37-cp37m-win32.whl
1.)pip install cx_Freeze
2.)pip install wheel
pip install cx_Freeze-5.1.1-cp37-cp37m-win32.whl
When i follow the link it leads to installing a .rar file when I try running the command pip install cx_Freeze then it gives the following error,
Running setup.py install for cx-Freeze ... error
ERROR: Complete output from command 'c:\users\alok\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Alok\\AppData\\Local\\Temp\\pip-install-5ojtpx8i\\cx-Freeze\\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\Alok\AppData\Local\Temp\pip-record-9oe_iyi5\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\common.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\dist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\finder.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\freezer.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\hooks.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\macdist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\main.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\setupwriter.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\windist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\__init__.py -> build\lib.win32-3.7\cx_Freeze
creating build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\Console.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\ConsoleSetLibPath.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\SharedLib.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\SharedLibSource.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\__startup__.py -> build\lib.win32-3.7\cx_Freeze\initscripts
creating build\lib.win32-3.7\cx_Freeze\samples
creating build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\advanced_1.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\advanced_2.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
creating build\lib.win32-3.7\cx_Freeze\samples\asmodule
copying cx_Freeze\samples\asmodule\asmodule.py -> build\lib.win32-3.7\cx_Freeze\samples\asmodule
copying cx_Freeze\samples\asmodule\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\asmodule
creating build\lib.win32-3.7\cx_Freeze\samples\matplotlib
copying cx_Freeze\samples\matplotlib\matplotlib_eg.py -> build\lib.win32-3.7\cx_Freeze\samples\matplotlib
copying cx_Freeze\samples\matplotlib\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\matplotlib
creating build\lib.win32-3.7\cx_Freeze\samples\openpyxl
copying cx_Freeze\samples\openpyxl\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\openpyxl
copying cx_Freeze\samples\openpyxl\test_openpyxl.py -> build\lib.win32-3.7\cx_Freeze\samples\openpyxl
creating build\lib.win32-3.7\cx_Freeze\samples\PyQt4
copying cx_Freeze\samples\PyQt4\PyQt4app.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt4
copying cx_Freeze\samples\PyQt4\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt4
creating build\lib.win32-3.7\cx_Freeze\samples\PyQt5
copying cx_Freeze\samples\PyQt5\PyQt5app.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt5
copying cx_Freeze\samples\PyQt5\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt5
creating build\lib.win32-3.7\cx_Freeze\samples\relimport
copying cx_Freeze\samples\relimport\relimport.py -> build\lib.win32-3.7\cx_Freeze\samples\relimport
copying cx_Freeze\samples\relimport\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\relimport
creating build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\Config.py -> build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\ServiceHandler.py -> build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\service
creating build\lib.win32-3.7\cx_Freeze\samples\simple
copying cx_Freeze\samples\simple\hello.py -> build\lib.win32-3.7\cx_Freeze\samples\simple
copying cx_Freeze\samples\simple\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\simple
creating build\lib.win32-3.7\cx_Freeze\samples\Tkinter
copying cx_Freeze\samples\Tkinter\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\Tkinter
copying cx_Freeze\samples\Tkinter\SimpleTkApp.py -> build\lib.win32-3.7\cx_Freeze\samples\Tkinter
creating build\lib.win32-3.7\cx_Freeze\samples\wx
copying cx_Freeze\samples\wx\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\wx
copying cx_Freeze\samples\wx\wxapp.py -> build\lib.win32-3.7\cx_Freeze\samples\wx
creating build\lib.win32-3.7\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\qotd.py -> build\lib.win32-3.7\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\zope
running build_ext
building 'cx_Freeze.util' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command "'c:\users\alok\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Alok\\AppData\\Local\\Temp\\pip-install-5ojtpx8i\\cx-Freeze\\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\Alok\AppData\Local\Temp\pip-record-9oe_iyi5\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Alok\AppData\Local\Temp\pip-install-5ojtpx8i\cx-Freeze\
you don't have Microsoft Visual C++ 14.0 in your system. So first install this from official site - https://visualstudio.microsoft.com/downloads/
After that do below steps as -
pip install wheel
Then go to the following link to download the cx_Freeze wheel file according to you python version and windows version: https://www.lfd.uci.edu/~gohlke/pythonlibs/#cx_freeze
In your case what I can see versions as python - 3.7 and 32 bit windows system
For this you have to Download this .whl from above link -> cx_Freeze‑5.1.1‑cp37‑cp37m‑win32.whl
Then after download save that file to any folder and in command go to that folder do as -
pip install cx_Freeze‑5.1.1‑cp37‑cp37m‑win32.whl
I hope this will work for you.

Failed installing pycrypto with pip

I encountered a problem when I try to download a certain package:
C:\Python27\Scripts>pip install pycrypto
Collecting pycrypto
Using cached https://files.pythonhosted.org/packages/60/db/645aa9af249f059cc3a368b118de33889219e0362141e75d4eaf6f80f163/pycrypto-2.6.1.tar.gz
Installing collected packages: pycrypto
Running setup.py install for pycrypto ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools
, tokenize;__file__='c:\\users\\beheer~1\\appdata\\local\\temp\\pip-install-_luv
op\\pycrypto\\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\beheer~1\appdata\local\temp\pip-record-jct20j\install-record.
txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-2.7
creating build\lib.win32-2.7\Crypto
copying lib\Crypto\pct_warnings.py -> build\lib.win32-2.7\Crypto
copying lib\Crypto\__init__.py -> build\lib.win32-2.7\Crypto
creating build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\hashalgo.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\HMAC.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\MD2.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\MD4.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\MD5.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\RIPEMD.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\SHA.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\SHA224.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\SHA256.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\SHA384.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\SHA512.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\__init__.py -> build\lib.win32-2.7\Crypto\Hash
creating build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\AES.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\ARC2.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\ARC4.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\blockalgo.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\Blowfish.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\CAST.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\DES.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\DES3.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\PKCS1_OAEP.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\PKCS1_v1_5.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\XOR.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\__init__.py -> build\lib.win32-2.7\Crypto\Cipher
creating build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\asn1.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\Counter.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\number.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\py21compat.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\py3compat.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\randpool.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\RFC1751.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\winrandom.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\_number_new.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\__init__.py -> build\lib.win32-2.7\Crypto\Util
creating build\lib.win32-2.7\Crypto\Random
copying lib\Crypto\Random\random.py -> build\lib.win32-2.7\Crypto\Random
copying lib\Crypto\Random\_UserFriendlyRNG.py -> build\lib.win32-2.7\Crypto\
Random
copying lib\Crypto\Random\__init__.py -> build\lib.win32-2.7\Crypto\Random
creating build\lib.win32-2.7\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\FortunaAccumulator.py -> build\lib.win32-2
.7\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\FortunaGenerator.py -> build\lib.win32-2.7
\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\SHAd256.py -> build\lib.win32-2.7\Crypto\R
andom\Fortuna
copying lib\Crypto\Random\Fortuna\__init__.py -> build\lib.win32-2.7\Crypto\
Random\Fortuna
creating build\lib.win32-2.7\Crypto\Random\OSRNG
copying lib\Crypto\Random\OSRNG\fallback.py -> build\lib.win32-2.7\Crypto\Ra
ndom\OSRNG
copying lib\Crypto\Random\OSRNG\nt.py -> build\lib.win32-2.7\Crypto\Random\O
SRNG
copying lib\Crypto\Random\OSRNG\posix.py -> build\lib.win32-2.7\Crypto\Rando
m\OSRNG
copying lib\Crypto\Random\OSRNG\rng_base.py -> build\lib.win32-2.7\Crypto\Ra
ndom\OSRNG
copying lib\Crypto\Random\OSRNG\__init__.py -> build\lib.win32-2.7\Crypto\Ra
ndom\OSRNG
creating build\lib.win32-2.7\Crypto\SelfTest
copying lib\Crypto\SelfTest\st_common.py -> build\lib.win32-2.7\Crypto\SelfT
est
copying lib\Crypto\SelfTest\__init__.py -> build\lib.win32-2.7\Crypto\SelfTe
st
creating build\lib.win32-2.7\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\common.py -> build\lib.win32-2.7\Crypto\S
elfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_AES.py -> build\lib.win32-2.7\Crypto
\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_ARC2.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_ARC4.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_Blowfish.py -> build\lib.win32-2.7\C
rypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_CAST.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_DES.py -> build\lib.win32-2.7\Crypto
\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_DES3.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_pkcs1_15.py -> build\lib.win32-2.7\C
rypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_pkcs1_oaep.py -> build\lib.win32-2.7
\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_XOR.py -> build\lib.win32-2.7\Crypto
\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\__init__.py -> build\lib.win32-2.7\Crypto
\SelfTest\Cipher
creating build\lib.win32-2.7\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\common.py -> build\lib.win32-2.7\Crypto\Sel
fTest\Hash
copying lib\Crypto\SelfTest\Hash\test_HMAC.py -> build\lib.win32-2.7\Crypto\
SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_MD2.py -> build\lib.win32-2.7\Crypto\S
elfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_MD4.py -> build\lib.win32-2.7\Crypto\S
elfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_MD5.py -> build\lib.win32-2.7\Crypto\S
elfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_RIPEMD.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA.py -> build\lib.win32-2.7\Crypto\S
elfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA224.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA256.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA384.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA512.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\__init__.py -> build\lib.win32-2.7\Crypto\S
elfTest\Hash
creating build\lib.win32-2.7\Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\test_AllOrNothing.py -> build\lib.win32
-2.7\Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\test_chaffing.py -> build\lib.win32-2.7
\Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\test_KDF.py -> build\lib.win32-2.7\Cryp
to\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\test_rfc1751.py -> build\lib.win32-2.7\
Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\__init__.py -> build\lib.win32-2.7\Cryp
to\SelfTest\Protocol
creating build\lib.win32-2.7\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_DSA.py -> build\lib.win32-2.7\Cry
pto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_ElGamal.py -> build\lib.win32-2.7
\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_importKey.py -> build\lib.win32-2
.7\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_RSA.py -> build\lib.win32-2.7\Cry
pto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\__init__.py -> build\lib.win32-2.7\Cry
pto\SelfTest\PublicKey
creating build\lib.win32-2.7\Crypto\SelfTest\Random
copying lib\Crypto\SelfTest\Random\test_random.py -> build\lib.win32-2.7\Cry
pto\SelfTest\Random
copying lib\Crypto\SelfTest\Random\test_rpoolcompat.py -> build\lib.win32-2.
7\Crypto\SelfTest\Random
copying lib\Crypto\SelfTest\Random\test__UserFriendlyRNG.py -> build\lib.win
32-2.7\Crypto\SelfTest\Random
copying lib\Crypto\SelfTest\Random\__init__.py -> build\lib.win32-2.7\Crypto
\SelfTest\Random
creating build\lib.win32-2.7\Crypto\SelfTest\Random\Fortuna
copying lib\Crypto\SelfTest\Random\Fortuna\test_FortunaAccumulator.py -> bui
ld\lib.win32-2.7\Crypto\SelfTest\Random\Fortuna
copying lib\Crypto\SelfTest\Random\Fortuna\test_FortunaGenerator.py -> build
\lib.win32-2.7\Crypto\SelfTest\Random\Fortuna
copying lib\Crypto\SelfTest\Random\Fortuna\test_SHAd256.py -> build\lib.win3
2-2.7\Crypto\SelfTest\Random\Fortuna
copying lib\Crypto\SelfTest\Random\Fortuna\__init__.py -> build\lib.win32-2.
7\Crypto\SelfTest\Random\Fortuna
creating build\lib.win32-2.7\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_fallback.py -> build\lib.win32
-2.7\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_generic.py -> build\lib.win32-
2.7\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_nt.py -> build\lib.win32-2.7\C
rypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_posix.py -> build\lib.win32-2.
7\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_winrandom.py -> build\lib.win3
2-2.7\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\__init__.py -> build\lib.win32-2.7\
Crypto\SelfTest\Random\OSRNG
creating build\lib.win32-2.7\Crypto\SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_asn1.py -> build\lib.win32-2.7\Crypto\
SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_Counter.py -> build\lib.win32-2.7\Cryp
to\SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_number.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_winrandom.py -> build\lib.win32-2.7\Cr
ypto\SelfTest\Util
copying lib\Crypto\SelfTest\Util\__init__.py -> build\lib.win32-2.7\Crypto\S
elfTest\Util
creating build\lib.win32-2.7\Crypto\SelfTest\Signature
copying lib\Crypto\SelfTest\Signature\test_pkcs1_15.py -> build\lib.win32-2.
7\Crypto\SelfTest\Signature
copying lib\Crypto\SelfTest\Signature\test_pkcs1_pss.py -> build\lib.win32-2
.7\Crypto\SelfTest\Signature
copying lib\Crypto\SelfTest\Signature\__init__.py -> build\lib.win32-2.7\Cry
pto\SelfTest\Signature
creating build\lib.win32-2.7\Crypto\Protocol
copying lib\Crypto\Protocol\AllOrNothing.py -> build\lib.win32-2.7\Crypto\Pr
otocol
copying lib\Crypto\Protocol\Chaffing.py -> build\lib.win32-2.7\Crypto\Protoc
ol
copying lib\Crypto\Protocol\KDF.py -> build\lib.win32-2.7\Crypto\Protocol
copying lib\Crypto\Protocol\__init__.py -> build\lib.win32-2.7\Crypto\Protoc
ol
creating build\lib.win32-2.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\DSA.py -> build\lib.win32-2.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\ElGamal.py -> build\lib.win32-2.7\Crypto\Public
Key
copying lib\Crypto\PublicKey\pubkey.py -> build\lib.win32-2.7\Crypto\PublicK
ey
copying lib\Crypto\PublicKey\RSA.py -> build\lib.win32-2.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\_DSA.py -> build\lib.win32-2.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\_RSA.py -> build\lib.win32-2.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\_slowmath.py -> build\lib.win32-2.7\Crypto\Publ
icKey
copying lib\Crypto\PublicKey\__init__.py -> build\lib.win32-2.7\Crypto\Publi
cKey
creating build\lib.win32-2.7\Crypto\Signature
copying lib\Crypto\Signature\PKCS1_PSS.py -> build\lib.win32-2.7\Crypto\Sign
ature
copying lib\Crypto\Signature\PKCS1_v1_5.py -> build\lib.win32-2.7\Crypto\Sig
nature
copying lib\Crypto\Signature\__init__.py -> build\lib.win32-2.7\Crypto\Signa
ture
running build_ext
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastm
ath.
building 'Crypto.Random.OSRNG.winrandom' extension
error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpyt
hon27
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools,
tokenize;__file__='c:\
\users\\beheer~1\\appdata\\local\\temp\\pip-install-
_luvop\\pycrypto\\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\behee
r~1\appdata\local\temp\pip-record-jct20j\install-record.txt --single-
version-ext
ernally-managed --compile" failed with error code 1 in
c:\users\beheer~1\appdata
\local\temp\pip-install-_luvop\pycrypto\
I already tried this command:
pip install --upgrade setuptools
And this still didnt work.
The solution was simple
just
pip uninstall pycrypto
pip install pycryptodome
And every should just work fine, it worked for me!
In some cases it is a dependency issue. It can be solved as follows:
for python2 run the following command:
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
For python3 run
sudo apt-get install build-essential libssl-dev libffi-dev python3-dev
I fixed same problem in linux running sudo apt-get install pythonX.X-dev before installing pycrypto. Replace pythonX.X with your python version e.g. sudo apt-get install python3.6-dev
After so many try with errors, now i have one solution for pycrypto and splunklib
Code of my Docker file that need to update :
FROM python:3.8-slim
RUN mkdir /app
WORKDIR /app
COPY requirements.txt /app
RUN pip install --no-cache-dir -r requirements.txt
RUN apt-get update && apt-get install -y --no-install-recommends gcc build-
essential postgresql libpq-dev vim
COPY . /app
WORKDIR /app/api
EXPOSE 3000
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "3000", "--reload"]
requirements.txt have
...
pycryptodome==3.14.1
splunk-sdk==1.6.19
splunklib==1.0.0
....
below error was showing for me when try to run above docker file code
Building wheel for splunk-sdk (setup.py): started
#9 80.50 Building wheel for splunk-sdk (setup.py): finished with status 'done'
#9 80.51 Created wheel for splunk-sdk: filename=splunk_sdk-1.6.20-py3-none-any.whl
size=124053 sha256=ddce3663bb166c6732e18f1ed95187528c2a666b996eff7dfac00302cf9771d7
#9 80.51 Stored in directory: /tmp/pip-ephem-wheel-cache-
frl315nd/wheels/f7/a1/72/b2474c8ffe6b02fe24078e3413ed668fe6b85dfb17cd8e64c2
#9 80.51 Building wheel for pycrypto (setup.py): started
#9 92.72 Building wheel for pycrypto (setup.py): finished with status 'error'
#9 92.76 error: subprocess-exited-with-error
Running setup.py install for pycrypto: started
#9 106.8 Running setup.py install for pycrypto: finished with status 'error'
#9 106.9 error: subprocess-exited-with-error note: This error originates from a subprocess, and is likely not a problem with pip.
#9 106.9 error: legacy-install-failure
#9 106.9 Encountered error while trying to install package.
#9 106.9 pycrypto
**Solution ** - Now i am updating docker file with below code
FROM python:3.8-slim
RUN mkdir /app
WORKDIR /app
COPY requirements.txt /app
RUN apt-get update && apt-get install -y --no-install-recommends gcc build-essential postgresql libpq-dev vim
RUN apt-get install -y --no-install-recommends libssl-dev libffi-dev
RUN pip install --no-cache-dir -r requirements.txt
COPY . /app
WORKDIR /app/api
EXPOSE 3000
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "3000", "--reload"]
installing python3-devel (for python3) helped to solve my problem
details in
fatal error: Python.h: No such file or directory
There is no support whatsoever from the project. Specifically in windows. Pycrypto Issue Link.
For ubuntu these answers will work.
But I guess for windows you should switch to pycryptodome as it installs the packages with the same crypto name as pycrypto,
Create new environment for python project for using command conda create -n env_name python=3.6
you to write python version according to your requirements. after that you can clone your project in that environment. it will work.

Using lxml for Python - Windows 7 64-bit

When I try to install lxml, I get the following. I've tried downloading C++ redists and a whole bunch of other things I've found, but nothing works.
I've tried everything from the following link:
How to install lxml on Windows
I've got python version 3.5.1. I
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\daniel.bak>pip install setuptools
Requirement already satisfied (use --upgrade to upgrade): setuptools in c:\users\daniel.bak\appdata\local\programs\python\python35-32\lib\site-packages
C:\Users\daniel.bak>pip install lxml
Collecting lxml
Using cached lxml-3.6.0.tar.gz
Installing collected packages: lxml
Running setup.py install for lxml ... error
Complete output from command c:\users\daniel.bak\appdata\local\programs\python\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\daniel.bak\\AppData\\Local\\Temp\\pip-build-_d7bp49n\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replac
e('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\daniel.bak\AppData\Local\Temp\pip-4wmqb1li-record\install-record.txt --single-version-externally-managed --compile:
Building lxml version 3.6.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.5
creating build\lib.win32-3.5\lxml
copying src\lxml\builder.py -> build\lib.win32-3.5\lxml
copying src\lxml\cssselect.py -> build\lib.win32-3.5\lxml
copying src\lxml\doctestcompare.py -> build\lib.win32-3.5\lxml
copying src\lxml\ElementInclude.py -> build\lib.win32-3.5\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win32-3.5\lxml
copying src\lxml\sax.py -> build\lib.win32-3.5\lxml
copying src\lxml\usedoctest.py -> build\lib.win32-3.5\lxml
copying src\lxml\_elementpath.py -> build\lib.win32-3.5\lxml
copying src\lxml\__init__.py -> build\lib.win32-3.5\lxml
creating build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win32-3.5\lxml\includes
creating build\lib.win32-3.5\lxml\html
copying src\lxml\html\builder.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\clean.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\defs.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\diff.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win32-3.5\lxml\html
creating build\lib.win32-3.5\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win32-3.5\lxml\isoschematron
copying src\lxml\lxml.etree.h -> build\lib.win32-3.5\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win32-3.5\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\etreepublic.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\relaxng.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\schematron.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\tree.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\xmlerror.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\xmlparser.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\xmlschema.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\xpath.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\lxml-version.h -> build\lib.win32-3.5\lxml\includes
creating build\lib.win32-3.5\lxml\isoschematron\resources
creating build\lib.win32-3.5\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win32-3.5\lxml\isoschematron\resources\rng
creating build\lib.win32-3.5\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl
creating build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win32-3.5\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.5\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.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
error: Unable to find vcvarsall.bat
----------------------------------------
Command "c:\users\daniel.bak\appdata\local\programs\python\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\daniel.bak\\AppData\\Local\\Temp\\pip-build-_d7bp49n\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file_
_, 'exec'))" install --record C:\Users\daniel.bak\AppData\Local\Temp\pip-4wmqb1li-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\daniel.bak\AppData\Local\Temp\pip-build-_d7bp49n\lxml\
Installing the precompiled binaries gives me:
C:\Users\daniel.bak>pip install "C:\Users\daniel.bak\Downloads\lxml-3.6.0-cp35-cp35m-win_amd64.whl"
lxml-3.6.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
You can download precompiled binaries and install them with pip install
Here is the download link. cp27, cp34, cp35 indicate Python versions and win32 and win_amd64 32 and 64 bit packages.
I was having trouble installing lxml on my system as well along with urllib. I do not remember why but lxml was not available for python 3.5, urllib itself is not available but instead it is available as urllib.requests and another package that I do not remember. For me the best solution was to install anaconda instead. Anaconda has just so many libraries and it works greatly in place of python. It has the whole url library and a comprehension of several other libraries.

Categories