Failed installing pycrypto with pip - python

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.

Related

Pip Command Errored out with exit status 1 [duplicate]

This question already has answers here:
How to solve "error: Microsoft Visual C++ 14.0 or greater is required" when installing Python packages?
(9 answers)
Pip error even Microsoft Visual C++ 14.0 is installed
(4 answers)
Error while installing lxml through pip: Microsoft Visual C++ 14.0 is required
(8 answers)
Closed 2 years ago.
Can someone help me figure out what's the issue with this Pip install?
I am trying to install a friends code from Pip and use a password but I get this error during installation.
ERROR: Command errored out with exit status 1:
command: 'c:\program files\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\joeyb\\AppData\\Local\\Temp\\pip-install-dfw83vrd\\pycrypto_ae3a65b71de1411fb7e3c760e80c05c5\\setup.py'"'"'; __file__='"'"'C:\\Users\\joeyb\\AppData\\Local\\Temp\\pip-install-dfw83vrd\\pycrypto_ae3a65b71de1411fb7e3c760e80c05c5\\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\joeyb\AppData\Local\Temp\pip-record-tscitvfo\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\joeyb\AppData\Roaming\Python\Python38\Include\pycrypto'
cwd: C:\Users\joeyb\AppData\Local\Temp\pip-install-dfw83vrd\pycrypto_ae3a65b71de1411fb7e3c760e80c05c5\
Complete output (153 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\Crypto
copying lib\Crypto\pct_warnings.py -> build\lib.win-amd64-3.8\Crypto
copying lib\Crypto\__init__.py -> build\lib.win-amd64-3.8\Crypto
creating build\lib.win-amd64-3.8\Crypto\Hash
copying lib\Crypto\Hash\hashalgo.py -> build\lib.win-amd64-3.8\Crypto\Hash
copying lib\Crypto\Hash\HMAC.py -> build\lib.win-amd64-3.8\Crypto\Hash
copying lib\Crypto\Hash\MD2.py -> build\lib.win-amd64-3.8\Crypto\Hash
copying lib\Crypto\Hash\MD4.py -> build\lib.win-amd64-3.8\Crypto\Hash
copying lib\Crypto\Hash\MD5.py -> build\lib.win-amd64-3.8\Crypto\Hash
copying lib\Crypto\Hash\RIPEMD.py -> build\lib.win-amd64-3.8\Crypto\Hash
copying lib\Crypto\Hash\SHA.py -> build\lib.win-amd64-3.8\Crypto\Hash
copying lib\Crypto\Hash\SHA224.py -> build\lib.win-amd64-3.8\Crypto\Hash
copying lib\Crypto\Hash\SHA256.py -> build\lib.win-amd64-3.8\Crypto\Hash
copying lib\Crypto\Hash\SHA384.py -> build\lib.win-amd64-3.8\Crypto\Hash
copying lib\Crypto\Hash\SHA512.py -> build\lib.win-amd64-3.8\Crypto\Hash
copying lib\Crypto\Hash\__init__.py -> build\lib.win-amd64-3.8\Crypto\Hash
creating build\lib.win-amd64-3.8\Crypto\Cipher
copying lib\Crypto\Cipher\AES.py -> build\lib.win-amd64-3.8\Crypto\Cipher
copying lib\Crypto\Cipher\ARC2.py -> build\lib.win-amd64-3.8\Crypto\Cipher
copying lib\Crypto\Cipher\ARC4.py -> build\lib.win-amd64-3.8\Crypto\Cipher
copying lib\Crypto\Cipher\blockalgo.py -> build\lib.win-amd64-3.8\Crypto\Cipher
copying lib\Crypto\Cipher\Blowfish.py -> build\lib.win-amd64-3.8\Crypto\Cipher
copying lib\Crypto\Cipher\CAST.py -> build\lib.win-amd64-3.8\Crypto\Cipher
copying lib\Crypto\Cipher\DES.py -> build\lib.win-amd64-3.8\Crypto\Cipher
copying lib\Crypto\Cipher\DES3.py -> build\lib.win-amd64-3.8\Crypto\Cipher
copying lib\Crypto\Cipher\PKCS1_OAEP.py -> build\lib.win-amd64-3.8\Crypto\Cipher
copying lib\Crypto\Cipher\PKCS1_v1_5.py -> build\lib.win-amd64-3.8\Crypto\Cipher
copying lib\Crypto\Cipher\XOR.py -> build\lib.win-amd64-3.8\Crypto\Cipher
copying lib\Crypto\Cipher\__init__.py -> build\lib.win-amd64-3.8\Crypto\Cipher
creating build\lib.win-amd64-3.8\Crypto\Util
copying lib\Crypto\Util\asn1.py -> build\lib.win-amd64-3.8\Crypto\Util
copying lib\Crypto\Util\Counter.py -> build\lib.win-amd64-3.8\Crypto\Util
copying lib\Crypto\Util\number.py -> build\lib.win-amd64-3.8\Crypto\Util
copying lib\Crypto\Util\py3compat.py -> build\lib.win-amd64-3.8\Crypto\Util
copying lib\Crypto\Util\randpool.py -> build\lib.win-amd64-3.8\Crypto\Util
copying lib\Crypto\Util\RFC1751.py -> build\lib.win-amd64-3.8\Crypto\Util
copying lib\Crypto\Util\winrandom.py -> build\lib.win-amd64-3.8\Crypto\Util
copying lib\Crypto\Util\_number_new.py -> build\lib.win-amd64-3.8\Crypto\Util
copying lib\Crypto\Util\__init__.py -> build\lib.win-amd64-3.8\Crypto\Util
creating build\lib.win-amd64-3.8\Crypto\Random
copying lib\Crypto\Random\random.py -> build\lib.win-amd64-3.8\Crypto\Random
copying lib\Crypto\Random\_UserFriendlyRNG.py -> build\lib.win-amd64-3.8\Crypto\Random
copying lib\Crypto\Random\__init__.py -> build\lib.win-amd64-3.8\Crypto\Random
creating build\lib.win-amd64-3.8\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\FortunaAccumulator.py -> build\lib.win-amd64-3.8\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\FortunaGenerator.py -> build\lib.win-amd64-3.8\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\SHAd256.py -> build\lib.win-amd64-3.8\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\__init__.py -> build\lib.win-amd64-3.8\Crypto\Random\Fortuna
creating build\lib.win-amd64-3.8\Crypto\Random\OSRNG
copying lib\Crypto\Random\OSRNG\fallback.py -> build\lib.win-amd64-3.8\Crypto\Random\OSRNG
copying lib\Crypto\Random\OSRNG\nt.py -> build\lib.win-amd64-3.8\Crypto\Random\OSRNG
copying lib\Crypto\Random\OSRNG\posix.py -> build\lib.win-amd64-3.8\Crypto\Random\OSRNG
copying lib\Crypto\Random\OSRNG\rng_base.py -> build\lib.win-amd64-3.8\Crypto\Random\OSRNG
copying lib\Crypto\Random\OSRNG\__init__.py -> build\lib.win-amd64-3.8\Crypto\Random\OSRNG
creating build\lib.win-amd64-3.8\Crypto\SelfTest
copying lib\Crypto\SelfTest\st_common.py -> build\lib.win-amd64-3.8\Crypto\SelfTest
copying lib\Crypto\SelfTest\__init__.py -> build\lib.win-amd64-3.8\Crypto\SelfTest
creating build\lib.win-amd64-3.8\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\common.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_AES.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_ARC2.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_ARC4.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_Blowfish.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_CAST.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_DES.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_DES3.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_pkcs1_15.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_pkcs1_oaep.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_XOR.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\__init__.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Cipher
creating build\lib.win-amd64-3.8\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\common.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_HMAC.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_MD2.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_MD4.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_MD5.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_RIPEMD.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA224.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA256.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA384.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA512.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\__init__.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Hash
creating build\lib.win-amd64-3.8\Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\test_AllOrNothing.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\test_chaffing.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\test_KDF.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\test_rfc1751.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\__init__.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Protocol
creating build\lib.win-amd64-3.8\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_DSA.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_ElGamal.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_importKey.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_RSA.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\__init__.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\PublicKey
creating build\lib.win-amd64-3.8\Crypto\SelfTest\Random
copying lib\Crypto\SelfTest\Random\test_random.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Random
copying lib\Crypto\SelfTest\Random\test_rpoolcompat.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Random
copying lib\Crypto\SelfTest\Random\test__UserFriendlyRNG.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Random
copying lib\Crypto\SelfTest\Random\__init__.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Random
creating build\lib.win-amd64-3.8\Crypto\SelfTest\Random\Fortuna
copying lib\Crypto\SelfTest\Random\Fortuna\test_FortunaAccumulator.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Random\Fortuna
copying lib\Crypto\SelfTest\Random\Fortuna\test_FortunaGenerator.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Random\Fortuna
copying lib\Crypto\SelfTest\Random\Fortuna\test_SHAd256.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Random\Fortuna
copying lib\Crypto\SelfTest\Random\Fortuna\__init__.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Random\Fortuna
creating build\lib.win-amd64-3.8\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_fallback.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_generic.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_nt.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_posix.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_winrandom.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\__init__.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Random\OSRNG
creating build\lib.win-amd64-3.8\Crypto\SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_asn1.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_Counter.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_number.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_winrandom.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Util
copying lib\Crypto\SelfTest\Util\__init__.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Util
creating build\lib.win-amd64-3.8\Crypto\SelfTest\Signature
copying lib\Crypto\SelfTest\Signature\test_pkcs1_15.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Signature
copying lib\Crypto\SelfTest\Signature\test_pkcs1_pss.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Signature
copying lib\Crypto\SelfTest\Signature\__init__.py -> build\lib.win-amd64-3.8\Crypto\SelfTest\Signature
creating build\lib.win-amd64-3.8\Crypto\Protocol
copying lib\Crypto\Protocol\AllOrNothing.py -> build\lib.win-amd64-3.8\Crypto\Protocol
copying lib\Crypto\Protocol\Chaffing.py -> build\lib.win-amd64-3.8\Crypto\Protocol
copying lib\Crypto\Protocol\KDF.py -> build\lib.win-amd64-3.8\Crypto\Protocol
copying lib\Crypto\Protocol\__init__.py -> build\lib.win-amd64-3.8\Crypto\Protocol
creating build\lib.win-amd64-3.8\Crypto\PublicKey
copying lib\Crypto\PublicKey\DSA.py -> build\lib.win-amd64-3.8\Crypto\PublicKey
copying lib\Crypto\PublicKey\ElGamal.py -> build\lib.win-amd64-3.8\Crypto\PublicKey
copying lib\Crypto\PublicKey\pubkey.py -> build\lib.win-amd64-3.8\Crypto\PublicKey
copying lib\Crypto\PublicKey\RSA.py -> build\lib.win-amd64-3.8\Crypto\PublicKey
copying lib\Crypto\PublicKey\_DSA.py -> build\lib.win-amd64-3.8\Crypto\PublicKey
copying lib\Crypto\PublicKey\_RSA.py -> build\lib.win-amd64-3.8\Crypto\PublicKey
copying lib\Crypto\PublicKey\_slowmath.py -> build\lib.win-amd64-3.8\Crypto\PublicKey
copying lib\Crypto\PublicKey\__init__.py -> build\lib.win-amd64-3.8\Crypto\PublicKey
creating build\lib.win-amd64-3.8\Crypto\Signature
copying lib\Crypto\Signature\PKCS1_PSS.py -> build\lib.win-amd64-3.8\Crypto\Signature
copying lib\Crypto\Signature\PKCS1_v1_5.py -> build\lib.win-amd64-3.8\Crypto\Signature
copying lib\Crypto\Signature\__init__.py -> build\lib.win-amd64-3.8\Crypto\Signature
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
running build_ext
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Random.OSRNG.winrandom' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\program files\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\joeyb\\AppData\\Local\\Temp\\pip-install-dfw83vrd\\pycrypto_ae3a65b71de1411fb7e3c760e80c05c5\\setup.py'"'"'; __file__='"'"'C:\\Users\\joeyb\\AppData\\Local\\Temp\\pip-install-dfw83vrd\\pycrypto_ae3a65b71de1411fb7e3c760e80c05c5\\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\joeyb\AppData\Local\Temp\pip-record-tscitvfo\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\joeyb\AppData\Roaming\Python\Python38\Include\pycrypto' Check the logs for full command output.
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
So, you need to install Microsoft Visual C++ 14.0 and pip already gived a URL where you can do it.

Is there a way I can install pillow on my windows machine?

I tried installing the pillow library but I got this message
(venv) C:\Users\Timo\PycharmProjects\jumia>pip install pillow
Collecting pillow
Using cached https://files.pythonhosted.org/packages/3e/02/b09732ca4b14405ff159c470a612979acfc6e8645dc32f83ea0129709f7a/Pillow-7.2.0.tar.gz
Installing collected packages: pillow
Running setup.py install for pillow ... error
Complete output from command C:\Users\Timo\PycharmProjects\jumia\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Timo\AppData\Local\Temp\pip-install-gr4big0c\pillow\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\Timo\AppData\Local\Temp\pip-record-yl39rrsa\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\Timo\PycharmProjects\jumia\venv\include\site\python3.8\pillow:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\PIL
copying src\PIL\BdfFontFile.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\BlpImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\BmpImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\BufrStubImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ContainerIO.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\CurImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\DcxImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\DdsImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\EpsImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ExifTags.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\features.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\FitsStubImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\FliImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\FontFile.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\FpxImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\FtexImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\GbrImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\GdImageFile.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\GifImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\GimpGradientFile.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\GimpPaletteFile.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\GribStubImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\Hdf5StubImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\IcnsImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\IcoImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\Image.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageChops.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageCms.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageColor.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageDraw.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageDraw2.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageEnhance.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageFile.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageFilter.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageFont.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageGrab.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageMath.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageMode.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageMorph.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageOps.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImagePalette.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImagePath.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageQt.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageSequence.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageShow.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageStat.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageTk.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageTransform.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImageWin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\ImtImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\IptcImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\Jpeg2KImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\JpegImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\JpegPresets.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\McIdasImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\MicImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\MpegImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\MpoImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\MspImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\PaletteFile.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\PalmImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\PcdImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\PcfFontFile.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\PcxImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\PdfImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\PdfParser.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\PixarImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\PngImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\PpmImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\PsdImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\PSDraw.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\PyAccess.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\SgiImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\SpiderImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\SunImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\TarIO.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\TgaImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\TiffImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\TiffTags.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\WalImageFile.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\WebPImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\WmfImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\XbmImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\XpmImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL\XVThumbImagePlugin.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL_binary.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL_tkinter_finder.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL_util.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL_version.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL_init_.py -> build\lib.win-amd64-3.8\PIL
copying src\PIL_main_.py -> build\lib.win-amd64-3.8\PIL
running egg_info
writing src\Pillow.egg-info\PKG-INFO
writing dependency_links to src\Pillow.egg-info\dependency_links.txt
writing top-level names to src\Pillow.egg-info\top_level.txt
reading manifest file 'src\Pillow.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '.c'
warning: no files found matching '.h'
warning: no files found matching '.sh'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching 'codecov.yml'
warning: no previously-included files matching '.git' found anywhere in distribution
warning: no previously-included files matching '.pyc' found anywhere in distribution
warning: no previously-included files matching '.so' found anywhere in distribution
no previously-included directories found matching '.ci'
writing manifest file 'src\Pillow.egg-info\SOURCES.txt'
running build_ext
The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
Traceback (most recent call last):
File "C:\Users\Timo\AppData\Local\Temp\pip-install-gr4big0c\pillow\setup.py", line 864, in <module>
setup(
File "C:\Users\Timo\PycharmProjects\jumia\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\__init__.py", line 145, in setup
File "C:\Program Files\Python38\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Program Files\Python38\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Program Files\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Timo\PycharmProjects\jumia\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\command\install.py", line 61, in run
File "C:\Program Files\Python38\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Program Files\Python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files\Python38\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Program Files\Python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files\Python38\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:\Users\Timo\AppData\Local\Temp\pip-install-gr4big0c\pillow\setup.py", line 694, in build_extensions
raise RequiredDependencyException(f)
__main__.RequiredDependencyException: zlib
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Timo\AppData\Local\Temp\pip-install-gr4big0c\pillow\setup.py", line 918, in <module>
raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:
The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
----------------------------------------
Command "C:\Users\Timo\PycharmProjects\jumia\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Timo\AppData\Local\Temp\pip-install-gr4big0c\pillow\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\Timo\AppData\Local\Temp\pip-record-yl39rrsa\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\Timo\PycharmProjects\jumia\venv\include\site\python3.8\pillow" failed with error code 1 in C:\Users\Timo\AppData\Local\Temp\pip-install-gr4big0c\pillow\
Try installing it like this:
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow
For install pillow:
pip install pillow
For Upgrade pillow:
python3 -m pip install --upgrade Pillow
For upgrade pip:
python3 -m pip install --upgrade pip
I found something on Reddit here
Quazaka 3 points · 7 months ago
I solved the problem. in order to install Pillow a newer version of pip is needed. The installation of python 3.8 only include pip version 19.0.x where pip version 19.3.x is needed. In order to upgrade pip run the following command in the venv (terminal in PyCharm)
python -m pip install -U --force-reinstall pip

Trying to pip install mysqlclient but getting error

I am new to python. I am trying to set up the environment to build a picture sharing app. The setup was going well until I had to install mysqlclient which is one of the requirements according to the tutorial I was using.
The error I get in the windows Powershell is this:
--compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying _mysql_exceptions.py -> build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.7\MySQLdb
creating build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.7\MySQLdb\constants
running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
I already have Microsoft Visual C++ 14.0 installed in my machine
I even tried upgrading setup tools like suggested in another post but with no luck
I have python 3.7 installed
Try this
pip install --only-binary :all: mysqlclient
Hope it helped.

Issues with Python pandas: read_html and python3-lxml installation

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! :-)

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