Question

I'm attempting to install a python package into my virtualenv. Installation works, but some scripts have trouble knowing where to import modules. I've traced this to the interpreter paths in the script files. It turns out that the package is not consistently developed and diff of the source and target directories show the following variations in the interpreter paths:

-in source file
+after installed in virtualenv

-#! /usr/bin/env python
+#!/Users/fuu/project/bin/python

-#!/usr/bin/env python
+#!/Users/fuu/project/bin/python

-#! /usr/bin/env python
+#!/usr/bin/python

-#!/usr/bin/env python
+#!/usr/bin/python

-#!/usr/bin/python
+#!/usr/bin/python

I'm failing to understand the logic of these transformations. Sometimes the path gets converted properly, (two first examples), sometimes it does not, without apparent pattern as to why.

Was it helpful?

Solution

This problem was solved after setting interpreter paths in all of the source script files to:

#!/usr/bin/env python

After this was done, running the setup correctly set the path correctly in my virtualenv:

#!/Users/fuu/project/bin/python

I believe the erratic behavior was caused by the python installer becoming confused about the real path to be set.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top