pycall.rb icon indicating copy to clipboard operation
pycall.rb copied to clipboard

Issues with Docker FROM ruby:2.7.1 and PyCall::PythonNotFound

Open mberrueta opened this issue 3 years ago • 0 comments

Hello there,

First, thanks for this great library!

I'm getting issues with a Docker image (locally PyCall works well)

FROM ruby:2.7.1

ENV PYTHON /usr/bin/python3
ENV LIBPYTHON /usr/lib/x86_64-linux-gnu/libpython3.7m.so.1
ENV PYTHONHOME /usr/lib/python3.7
ENV PYTHONPATH /usr/lib/python3.7

RUN apt-get update && apt-get upgrade -y && apt-get clean && apt-get install -y build-essential
RUN apt-get install -y curl python3.7 python3.7-dev python3.7-distutils
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1
RUN curl -s https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
  python get-pip.py --force-reinstall && \
  rm get-pip.py

ENV APP_HOME /app
RUN mkdir $APP_HOME
WORKDIR $APP_HOME

RUN gem install bundler:2.1.4
ADD Gemfile* $APP_HOME/
RUN bundle install

ENV PORT 3000
EXPOSE $PORT

ADD . $APP_HOME
RUN pip install --target . --requirement ./lib/scripts/requirements.txt
CMD rails server

getting PyCall::PythonNotFound and uninitialized constant PyCall::LibPython::Helpers

do you have an example of how to build it properly? or whats the error?

Ty in advance!!

mberrueta avatar Aug 28 '20 17:08 mberrueta