frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Python can't find caffe when started with "docker exec"

I have a running container with python and pycaffe in it. If I use docker exec to enter via a bash, I can the run a python script that imports the caffe module. But it fails when using this command:

docker exec -ti dts bash -c "python /root/init_random_weights.py"
mroos@synapse:scratch$ docker exec -ti dts bash -c "python /root/init_random_weights.py"
Hello
Traceback (most recent call last):
  File "/root/init_random_weights.py", line 4, in <module>
    import caffe
ImportError: No module named caffe

Why isn't python finding caffe when called in this manner? My .bashrc on the running container adds caffe to PYTHONPATH:

export PYTHONPATH=/usr/local/caffe/python:

What am I misunderstanding here?

Comments

Sign In or Register to comment.