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

Installing custom Python libraries into xlang-code-interpreter #130

Open
RaoulDrake opened this issue Apr 27, 2024 · 2 comments
Open

Installing custom Python libraries into xlang-code-interpreter #130

RaoulDrake opened this issue Apr 27, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@RaoulDrake
Copy link

Hi there, I would love to use the xlang-code-interpreter but need to install additional non-public custom Python libraries into it, so that my custom agent can use them. I have tried to achieve this by myself, but have not succeeded so far (and with my rather limited knowledge of Docker, I am not sure if it is possible at all with just the image).

I know you have mentioned in previous issues that it wasn't your plan to release it back then. Any chance this has changed and you could release or share the repo? Or do you have any suggestions on how I could achieve my goal of installing additional non-public custom Python libraries into it? Any help would be much appreciated. Many thanks in advance, and kind regards.

P.S.: I have also posted this question in a related issue (#72 (comment)), but since that one is closed, I am posting it here as a new issue as well. If anyone happens to read it twice, sorry for that.

@Timothyxxx Timothyxxx added enhancement New feature or request question Further information is requested labels Apr 29, 2024
@BlankCheng
Copy link
Contributor

Hi, it is valid to pull the image first, and build a new image wrapper with a new DockerFile that installs the Python libs you need, with no need to access the original docker's source code. Actually, our image is built upon the kaggle python docker. Hope it might help!

@RaoulDrake
Copy link
Author

Hi @BlankCheng, thanks for the quick feedback!
I had tried this, using (roughly) the following Dockerfile (I had to disable the proxies temporarily because pip was not able to download dependencies otherwise):

FROM xlanglab/xlang-code-interpreter-python
WORKDIR /app
COPY third_party ./third_party
ENV http_proxy_tmp=$http_proxy
ENV https_proxy_tmp=$https_proxy
ENV http_proxy=""
ENV https_proxy=""
RUN set -eux; \
    cd third_party;\
    cd my_custom_lib_1;\
    pip install -e .;\
    cd ..;\
    cd my_custom_lib_2;\
    pip install -e .;\
    cd ..;\
    cd ..;
ENV http_proxy=$http_proxy_tmp
ENV https_proxy=$https_proxy_tmp

When I build this, my libraries show up as installed when I run pip list in the container. However, when the agent tries to use the libraries, I get a module not found error. Any idea why this might happen or what I am doing wrong? Many thanks in advance and kind regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants