简体   繁体   中英

error : Microsoft Visual C++ 14.0 is required while installing pdftotext

I am trying to install the pdftotext library on a Miniconda environment.

After using pip install pdftotext , I am getting an error: Microsoft Visual C++ 14.0 is required

I already have Visual Studio Build Tools 2019 (16.11.8) installed but I still get the same error after restarting and trying the command again.

I tried to use the command conda install -c conda-forge poppler as described here

I also tried the following command: pip install --upgrade setuptools as described in that post

You can read the full log of the error here:

Collecting pdftotext



Using cached pdftotext-2.2.2.tar.gz (113 kB)

Building wheels for collected packages: pdftotext

  Building wheel for pdftotext (setup.py) ... error

  ERROR: Command errored out with exit status 1:



command: 'C:\Users\usr\Miniconda3\envs\pdfextract\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\usr\\AppData\\Local\\Temp\\pip-install-vbe_obvm\\pdftotext_0162282ade484d648572906b19b9e0e1\\setup.py'"'"'; __file__='"'"'C:\\Users\\usr\\AppData\\Local\\Temp\\pip-install-vbe_obvm\\pdftotext_0162282ade484d648572906b19b9e0e1\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\usr\AppData\Local\Temp\pip-wheel-ze6zlt7w'

       cwd: C:\Users\usr\AppData\Local\Temp\pip-install-vbe_obvm\pdftotext_0162282ade484d648572906b19b9e0e1\

  Complete output (11 lines):



 WARNING: pkg-config not found--guessing at poppler version.

           If the build fails, install pkg-config and try again.

  WARNING: pkg-config not found--guessing at poppler version.

           If the build fails, install pkg-config and try again.

  WARNING: pkg-config not found--guessing at poppler version.

           If the build fails, install pkg-config and try again.

  running bdist_wheel

  running build

  running build_ext

  building 'pdftotext' extension



error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/

  ----------------------------------------



ERROR: Failed building wheel for pdftotext

  Running setup.py clean for pdftotext

Failed to build pdftotext

Installing collected packages: pdftotext

Running setup.py install for pdftotext ... error

ERROR: Command errored out with exit status 1:

 command: 'C:\Users\usr\Miniconda3\envs\pdfextract\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\usr\\AppData\\Local\\Temp\\pip-install-vbe_obvm\\pdftotext_0162282ade484d648572906b19b9e0e1\\setup.py'"'"'; __file__='"'"'C:\\Users\\usr\\AppData\\Local\\Temp\\pip-install-vbe_obvm\\pdftotext_0162282ade484d648572906b19b9e0e1\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\usr\AppData\Local\Temp\pip-record-fxlcu60d\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\usr\Miniconda3\envs\pdfextract\Include\pdftotext'

     cwd: C:\Users\usr\AppData\Local\Temp\pip-install-vbe_obvm\pdftotext_0162282ade484d648572906b19b9e0e1\

Complete output (11 lines):

WARNING: pkg-config not found--guessing at poppler version.

         If the build fails, install pkg-config and try again.

WARNING: pkg-config not found--guessing at poppler version.

         If the build fails, install pkg-config and try again.

WARNING: pkg-config not found--guessing at poppler version.

         If the build fails, install pkg-config and try again.

running install

running build

running build_ext

building 'pdftotext' extension

error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/

----------------------------------------

ERROR: Command errored out with exit status 1: 'C:\Users\usr\Miniconda3\envs\pdfextract\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\usr\\AppData\\Local\\Temp\\pip-install-vbe_obvm\\pdftotext_0162282ade484d648572906b19b9e0e1\\setup.py'"'"'; __file__='"'"'C:\\Users\\usr\\AppData\\Local\\Temp\\pip-install-vbe_obvm\\pdftotext_0162282ade484d648572906b19b9e0e1\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\usr\AppData\Local\Temp\pip-record-fxlcu60d\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\usr\Miniconda3\envs\pdfextract\Include\pdftotext' Check the logs for full command output.

I'm open to any suggestion in order to fix this, any help is welcome !

Here is the solution that helped me

conda install -c conda-forge pdftotext

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM