Migrated issue, originally created by Nonprofit Metrics
Upon installing Alembic into a Python Virtualenv, where a space exists in the python path, the "alembic" shell command fails with the message "bad interpreter: No such file or directory". I'm using alembic 1.0.1, just installed from pip.
It appears the error is from the shebang line in the script (...bin/alembic), which for me reads:
#!"/Users/me/Directory With Spaces/myvirtualenv/bin/python2.7"
No way of escaping the path or spaces works at all. The way I got it to work is to replace the shebang line with:
#!/bin/sh
'''exec' "/Users/me/Directory With Spaces/myvirtualenv/bin/python2.7" "$0" "$@"
' '''
This is the way celery and others solve the problem.
I couldn't figure out where setup.py generated the shell "bin/alembic" file, or else I would've submitted a pull request.
Thanks!
该提问来源于开源项目:sqlalchemy/alembic