473,387 Members | 1,603 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,387 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 3190
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.