Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Red hat Linux env - unable to execute 'gcc': No such file or directory #91

Closed
prasadgsk opened this issue Oct 6, 2021 · 4 comments
Closed

Comments

@prasadgsk
Copy link

prasadgsk commented Oct 6, 2021

Installed anaconda3 in linux and trying to install pdftotext via Dockerfile (with python version 3.6.8) and getting this error

ran this command as stated in https://pypi.org/project/pdftotext/

Fedora, Red Hat, and friends

sudo yum install gcc-c++ pkgconfig poppler-cpp-devel python3-devel

Complete output (15 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
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -B /opt/conda/envs/azure36/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPOPPLER_CPP_AT_LEAST_0_30_0=1 -DPOPPLER_CPP_AT_LEAST_0_58_0=1 -DPOPPLER_CPP_AT_LEAST_0_88_0=1 -I/opt/conda/envs/python36/include/python3.6m -c pdftotext.cpp -o build/temp.linux-x86_64-3.6/pdftotext.o -Wall
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1

I already went though #23, not sure how to fix it.
Please let me know how to fix this error.

@jalan
Copy link
Owner

jalan commented Oct 6, 2021

I'm not sure what you're trying to do here. You say you installed gcc and then it looks like you don't have gcc? If you want to install this lib in a RHEL 7 system for example, here's the minimum:

# yum -y install gcc-c++ pkgconfig poppler-cpp-devel python3-devel
# pip3 install pdftotext

You also mentioned a dockerfile, so here's one. I don't have access to RHEL, so it's using CentOS, but it should be basically the same. I just tested that this works:

FROM centos:7
RUN yum -y install gcc-c++ pkgconfig poppler-cpp-devel python3-devel
RUN pip3 install pdftotext

If none of that helps, please say what RHEL version you are using and list the commands that you are issuing, along with their output.

@prasadgsk
Copy link
Author

I didn't have this in my Dockerfile, will add this and try it.

RUN yum -y install gcc-c++ pkgconfig poppler-cpp-devel python3-devel

Thank you

@jalan
Copy link
Owner

jalan commented Oct 7, 2021

Nothing for me to fix here. Closing

@jalan jalan closed this as completed Oct 7, 2021
@prasadgsk
Copy link
Author

prasadgsk commented Oct 11, 2021

Actually we don't need RHEL image.
Found that pdftotext has issues with pip install - giving errors related to gcc and poppler.

This worked perfectly fine - conda install -c conda-forge pdftotext
FYI - with this, no need to install those dependencies gcc, poppler etc.

I followed this (very good) article and was able to test it fine.
just continuumio/miniconda3 image is enough to build your python build image and then run image uses this build image to run your code.

https://pythonspeed.com/articles/conda-docker-image-size/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants