nanobox-io / nanobox-engine-python

Engine for running Python apps on Nanobox
https://nanobox.io
MIT License
12 stars 13 forks source link

bad interpreter: No such file or directory #16

Closed jason-riddle closed 8 years ago

jason-riddle commented 8 years ago

Getting the following error message when trying to run pip.

bash: /code/env/bin/pip: /opt/code/env/bin/python2.7: bad interpreter: No such file or directory

My Boxfile looks like the following

env:
  ENVIRONMENT: dev

build:
  engine: python
  python_runtime: python27
  nodejs_runtime: nodejs-4.2

I took a look in /code/env/bin/pip and it looks like this

#!/opt/code/env/bin/python2.7

should be this?

#!/code/env/bin/python2.7
tylerflint commented 8 years ago

I think you're right. Thanks for the heads up!

tylerflint commented 8 years ago

@notxarb I think we may have an issue here: https://github.com/nanobox-io/nanobox-engine-python/blob/master/lib/python/general.sh#L66

The nos_code_dir resolves to /opt/code.

I wonder if we should put the code_dir right at /code in the build container to deal with these issues.

tylerflint commented 8 years ago

hmm, /code is where the live dir is... we may need to change this around to avoid situations like this.

Looking at it now, I'm wondering if code dir should be /code and the live dir should just be /live.

Thoughts?

tylerflint commented 8 years ago

here's the reference in the build container I'm referring to:

https://github.com/nanobox-io/nanobox-docker-build/blob/master/hookit/lib/engine.rb#L10 and https://github.com/nanobox-io/nanobox-docker-build/blob/master/hookit/lib/engine.rb#L17

Though... the nos_code_dir is actually referring to the staging_dir in the build container. So to rephrase, we may need to consider making the staging_dir /code and the live_dir /live. I'm sure python is just the first runtime to exploit this issue.

Just some thought... the directories were considered before 'nanobox dev' mode was conceptualized. So it probably deserves a change.

Any objections?

tylerflint commented 8 years ago

This issue has been fixed with https://github.com/nanobox-io/nanobox-docker-build/issues/30.

@jason-riddle You can do the following to get the fix:

nanobox update-images
nanobox dev --rebuild

Let me know if you run into any issues.

Thanks!