Bug #146

avatar

windows port needs pywin32

Added by Robert Lujo 156 days ago. Updated 41 days ago.

Status:Duplicate Start:02/23/2010
Priority:High Due date:
Assigned to:avatarJeff Forcier % Done:

0%

Category:Packaging
Target version:-

Description

On the page: http://docs.fabfile.org/0.9.0/installation.html you list dependencies. I did installation on win32 with easy_install.

But when I start fab, this error I get:

File “build\bdist.win32\egg\fabric\state.py”, line 74, in _get_system_username ImportError: No module named win32api

The library needed is http://sourceforge.net/projects/pywin32/, and references in fabric/paramiko I found are:

fabric/state.py

def _get_system_username():
    ...
    import win32api
    import win32security
    import win32profile
    return win32api.GetUserName()


def _rc_path():
    ...
    from win32com.shell.shell import SHGetSpecialFolderPath
    from win32com.shell.shellcon import CSIDL_PROFILE
    return "%s/%s" % (
        SHGetSpecialFolderPath(0,CSIDL_PROFILE),
        rc_file
    )

paramiko\win_pageant.py

also uses win32 package

My suggestions:

  • please write down the dependency in http://docs.fabfile.org/0.9.0/installation.html
  • put dependency in easy_install – only check if exists will do, in the case if pulling/installing it from PyPi is not possible (most probably)
  • if possible – can you remove this dependency – it would be more convenient to use standard Python (2.5+) ctypes library (http://docs.python.org/library/ctypes.html, http://python.net/crew/theller/ctypes/). Personally I don’t like how Pywin32 installation (saves something to system32, to registry, 4 directories in site_packages, start menu …).

Related issues

duplicates Bug #123 ImportError in _get_system_username on cyqwin without win32api installed Done 12/17/2009

History

Updated by Ali-Akber Saifee 130 days ago

avatar

I have a changeset in my fork ( http://github.com/alisaifee/fabric ) that can sufficiently clear the dependency on pywin32 for atleast, paths.

1) http://github.com/alisaifee/fabric/commit/e5ac14feb6343901c45f406786e8e522f1a5a380

diffstat:

  •  from win32com.shell.shell import SHGetSpecialFolderPath
    
  •  from win32com.shell.shellcon import CSIDL_PROFILE
    
  •  return "%s/%s" % (
    
  •      SHGetSpecialFolderPath(0,CSIDL_PROFILE),
    
  •      rc_file
    
  •  )
    
  •  return "%s/%s" % (os.environ['USERPROFILE'], rc_file)
    

Updated by Jeff Forcier 129 days ago

avatar
  • Status changed from New to Assigned
  • Target version set to 0.9.3

Updated by Jeff Forcier 41 days ago

avatar
  • Status changed from Assigned to Duplicate

This looks to be the same issue as #123, actually.

Updated by Jeff Forcier 41 days ago

avatar

(Note for anyone too lazy to click over to #123 — this has just been addressed by removing the cygwin test. Landed in all branches.)

Updated by Jeff Forcier 41 days ago

avatar
  • Target version deleted (0.9.3)

Also available in: Atom