Installation problems on Windows 7

12 views
Skip to first unread message

Sylvain Viollon

unread,
Oct 18, 2013, 5:22:25 AM10/18/13
to fans...@googlegroups.com
Hello,

I have a customer trying to install fanstatic on Windows 7. He gets into
a problem with the package which:

Getting distribution for 'fanstatic==1.0a4'.
warning: no previously-included files found matching '.installed.cfg'
Got fanstatic 1.0a4.
Getting distribution for 'which==1.1.0'.
warning: no previously-included files found matching '*~'
warning: no files found matching '*.txt' under directory 'test'
error: Setup script exited with error: SandboxViolation: open('C:\\programs\\python\\python273\\which.exe', 'wb') {}

Did anyone already experienced this problem and knows how
to prevent it ?

Regards,

Sylvain,


--
Sylvain Viollon -- Infrae
t +31 10 243 7051 -- http://infrae.com
Hoevestraat 10 3033GC Rotterdam -- The Netherlands



ivan.b...@gmail.com

unread,
Nov 6, 2013, 12:58:21 AM11/6/13
to fans...@googlegroups.com, syl...@infrae.com
Apparently, fanstatic's compiler.py depends on an unmaintained library "which". I believe that with the introduction of shutil.which in Python 3.3 it should stop depending on "which" and maybe roll its own (as did Django and Twisted).

There were multiple StackOverflow answers on this:
http://stackoverflow.com/questions/5226958/which-equivalent-function-in-python
http://stackoverflow.com/questions/2629472/python-analog-of-unix-which
http://stackoverflow.com/questions/775351/os-path-exists-for-files-in-your-path

There should be code in compiler.py similar to this:

try:
    from shutil import which
except:
    def which(program):
        import os

        def is_exe(fpath):
            return os.path.isfile(fpath) and os.access(fpath, os.X_OK)

        fpath, fname = os.path.split(program)
        if fpath:
            if is_exe(program):
                return program
        else:
            for path in os.environ["PATH"].split(os.pathsep):
                path = path.strip('"')
                exe_file = os.path.join(path, program)
                if is_exe(exe_file):
                    return exe_file

        return None

Cheers,
Ivan Bulanov
Reply all
Reply to author
Forward
0 new messages