Moving a package in cygwin

63q2o4i02 at sneakemail.com 63q2o4i02 at sneakemail.com
Thu Dec 8 17:15:53 EST 2005


Hi,

I'm using python 2.4 and windows XP.

I have two packages in the windows version of python in site-packages.
They are PyVisa and ctypes, and both live in
c:\python24\lib\site-packages

I'd like to move these to the cygwin version of python on the same
system.  I tried copying the PyVisa and ctypes directorices (including
other miscellaneous "junk" like .pyd files associated with ctypes) to
c:\cygwin\lib\python24\site-packages\, but that didn't do the trick.
It appears site-packages *is* in my path.  Aside from the pyvisa and
ctypes directories, site-packages also contains: _ctypes.pyd,
_ctypes_test.pyd, visa.py, visa.pyc, visa.pyo.  For the windows
version, this appears to be enough.  For cygwin, however, it's not.

This is what I get under cygwin:

$ python
Python 2.4.1 (#1, May 27 2005, 18:02:40)
[GCC 3.3.3 (cygwin special)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import visa
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/visa.py", line 1, in ?
    from pyvisa.visa import *
  File "/usr/lib/python2.4/site-packages/pyvisa/__init__.py", line 27,
in ?
    import vpp43
  File "/usr/lib/python2.4/site-packages/pyvisa/vpp43.py", line 41, in
?
    from vpp43_types import *
  File "/usr/lib/python2.4/site-packages/pyvisa/vpp43_types.py", line
38, in ?
    import ctypes as _ctypes
  File "C:\Python24\Lib\site-packages\ctypes\__init__.py", line 13, in
?
    from _ctypes import Union, Structure, Array
ImportError: No module named _ctypes
>>>

The .pyd files are the only files with "_ctypes" in the name.  There
are no references to pyvisa or ctypes in the c:\python24\lib directory.

All the documentation points to adding an arbitrary path via modifying
site.py, sys.path, or other tricks, or installing fresh.  I tried
installing ctypes with source (python setup.py build...) but that lead
to compile problems which I won't go into here.

It seems like moving an already-working package should be easy.  Is
there anything I'm missing?  Seems like it should be a one-liner
someplace.

thanks
Michael




More information about the Python-list mailing list