lightly-ai / lightly-ai/lightly-train

Export PYTHOPATH inside docker container

Open
#248 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
1.7k
Forks
116
Avg merge
2d 21h
Merged PRs (30d)
6

Description

### 💡 Is your feature request related to a problem?

I am using your amazing lightly-train package inside your proposed docker container (0.11.0) since the proposed docker usage kind of restrics flexibility (for me):
1. starting a container and
2. using it via CLI

Problem: The python package from conda is used at the moment instead of the copied source. This results in an error because of a missing config file:

FileNotFoundError: [Errno 2] No such file or directory: '/opt/conda/lib/python3.11/site-packages/lightly_train/_models/dinov2_vit/dinov2_vit_src/configs/ssl_default_config.yaml'

### 🧰 Describe the solution you'd like

Adding the PYTHONPATH in your Dockerfile should fix it. It works for me when I build an image like that:

```
FROM lightly/train:latest
ENV PYTHONPATH=$PYTHONPATH:/home/lightly_train/src
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Dockerfile used to build lightly/train:latest and inspect how the copied source is made available to Python. Verify the container's import path and reproduce the reported missing-config-file error. Done means the container uses the copied source rather than the conda-installed package and the reported startup flow works.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
devops
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.