473,320 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Moving a package in cygwin

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

Dec 8 '05 #1
2 3183
63*******@sneakemail.com wrote:
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.

Unfortunately Cygwin and Windows are two quite different platforms.
While pure Python packages will transfer quite easily in the way you
have attempted, extension packages (compiled from C or C++) will not. In
order to make the same packages available under Cygwin you'll have to
build them from source or find Cygwin installers.

The problem is that the extension packages must be created using the
same compiler and libraries as (or at least a compiler and libraries
that are binary compatible with) the Python interpreter.

Since the Cygwin interpreter was built with Cygwin gcc + Cygwin
libraries and the Windows interpreter was built with Microsoft's Visual
Studio compiler and libraries there's very little chance of a non-source
migration of the Windows package to Cygwin.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Dec 9 '05 #2
Ok, thanks. I actually hadn't considered the build system, figuring
that function names, etc., would somehow magically be "exported" to
anyone wanting to use the .pyd library.

Michael

Dec 9 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: dw | last post by:
Pehaba, does anyone knows how to install MySQLdb on cygwin? - test device: MySQLdb 0.9.2.0 targz + cygwin 1.5.7-cr-0x9e + python 2.3.3 on cygwin + mysql 4.0.17 win32 - modified setup.py's...
3
by: Jeff Blaine | last post by:
Python 2.3.4 for Windows Just trying a simple test today. I clicked on an email message in Mozilla 1.7.3's mail reader. I selected 'Save As' and saved it as the default type. I opened the file...
0
by: Eric Myers | last post by:
Hello folks: (This message is also posted on the help forum at the pexpect sourceforge page, but all indentation in the code got stripped away when I submitted the post.) For some time I've...
9
by: Mayer | last post by:
Hello: I'm running python under cygwin and need to find the drive letter. Cygwin has a way of calling my drives by a name relative to the Cygwin directory, so I get things like /home/user rather...
16
by: Kenneth McDonald | last post by:
For unfortunate reasons, I'm considering switching back to Win XP (from OS X) as my "main" system. Windows has so many annoyances that I can only compare it to driving in the Bay Area at rush hour...
1
by: Bill Harris | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I had been running 7.x under cygwin (about 2 versions behind the latest cygwin has), but cygserver stopped running on my last cygwin update, and it...
4
by: reachsamdurai | last post by:
Hello, Can you please let me know the procedure to reach db2 command prompt from a cygwin window (hence without using Start-> Run -> db2cmd method). I'm planning to write shell scripts which...
7
by: =?Utf-8?B?TW9iaWxlTWFu?= | last post by:
Hello everyone: I am looking for everyone's thoughts on moving large amounts (actually, not very large, but large enough that I'm throwing exceptions using the default configurations). We're...
1
by: Gheorghe Postelnicu | last post by:
Hi, I have Python 2.5 installed on WinXP and I am trying to install a new package. I ran the setup.py build and I get the following message: C:\packages\reedsolomon-0.1>setup.py build running...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.