Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python Portability--Not very portable?

Reply
Thread Tools

Python Portability--Not very portable?

 
 
W. eWatson
Guest
Posts: n/a
 
      08-07-2010
On 8/6/2010 2:23 AM, Lawrence D'Oliveiro wrote:
> In message<i3fpos$p7u$(E-Mail Removed)-september.org>, W. eWatson wrote:
>
>> I made a one character change to it and sent him the new py file. He can't
>> execute it.

>
> What exactly was the problem?
>

I put a minus sign in front of a variable. I had him use the shell to
check his version numpy, which he just provided. version -- 1.4.0. As I
think I mentioned above, he's probably not using the same numpy version
that I use 1.2.0. Don't ask for an explanation of why I want him on
1.2.0. I think that pretty much wraps up the problem. He needs to
get back to 1.2.0.

Presumably I have him somehow delete the numpy site-package, the numpy
1.2.0 package? Just drill his way dow from the .../lib/site_packages?
Then install 1.2.0. He's missed the boat on that before by not following
instructions.


 
Reply With Quote
 
 
 
 
Martin v. Loewis
Guest
Posts: n/a
 
      08-07-2010
> As an example, my inexperienced Python partner 30 miles away has gotten
> out of step somehow. I think by installing a different version of numpy
> than I use. I gave him a program we both use months ago, and he had no
> trouble. (We both use IDLE on 2.5). I made a one character change to it
> and sent him the new py file. He can't execute it. I doubt he has
> changed anything in the intervening period.


You'll find that many people will be very skeptical wrt. this story:
this kind of thing really isn't supposed to happen, and it's difficult
to believe that it failed just because of the one-character change.

You already said that that the change was adding a minus sign somewhere.
Can you now kindly also report what then the problem was that your
partner encountered (specific error message would be appreciated).

> A further example. Months ago I decided to see if I could compile a
> program to avoid such problems as above. I planned to satisfy that need,
> and see if I could distribute some simple programs to non-Python
> friends. I pretty well understand the idea,and got it working with a
> small program. It seemed like a lot of manual labor to do it.


It's a lot of manual labor only the first time. When you package the
next version of the same software, manual labor should be minimal.

Regards,
Martin
 
Reply With Quote
 
 
 
 
Michael Torrie
Guest
Posts: n/a
 
      08-07-2010
On 08/07/2010 01:17 PM, W. eWatson wrote:
> Presumably I have him somehow delete the numpy site-package, the numpy
> 1.2.0 package? Just drill his way dow from the .../lib/site_packages?
> Then install 1.2.0. He's missed the boat on that before by not following
> instructions.


Wait. I'm confused. Aren't you distributing your python app as an
executable, with the interpreter and all the libraries bundled?
 
Reply With Quote
 
Martin v. Loewis
Guest
Posts: n/a
 
      08-07-2010
Am 07.08.2010 23:01, schrieb Michael Torrie:
> On 08/07/2010 01:17 PM, W. eWatson wrote:
>> Presumably I have him somehow delete the numpy site-package, the numpy
>> 1.2.0 package? Just drill his way dow from the .../lib/site_packages?
>> Then install 1.2.0. He's missed the boat on that before by not following
>> instructions.

>
> Wait. I'm confused. Aren't you distributing your python app as an
> executable, with the interpreter and all the libraries bundled?


No, he was really mentioning two distinct scenarios. In the one
discussed above, the remote machine had all stuff manually installed,
and somehow got the actual Python program copied into it.

Regards,
Martin
 
Reply With Quote
 
W. eWatson
Guest
Posts: n/a
 
      08-07-2010
On 8/7/2010 2:01 PM, Michael Torrie wrote:
> On 08/07/2010 01:17 PM, W. eWatson wrote:
>> Presumably I have him somehow delete the numpy site-package, the numpy
>> 1.2.0 package? Just drill his way dow from the .../lib/site_packages?
>> Then install 1.2.0. He's missed the boat on that before by not following
>> instructions.

>
> Wait. I'm confused. Aren't you distributing your python app as an
> executable, with the interpreter and all the libraries bundled?

Not at all. There is no exe. The py source program is all that goes out.
It is expected that the recipients have the same versions of modules,
numpy, etc, and IDLE. All under Windows. There's not a single person (of
about 50) that gets person who is likely to have changed the Python
environment. None of them know Python. When the sponsor decides to
change the app we all use, then we update Python and modules as
required. User's execute the programs with IDLE, or a double click of
the py file.
 
Reply With Quote
 
W. eWatson
Guest
Posts: n/a
 
      08-07-2010
On 8/7/2010 2:26 PM, Martin v. Loewis wrote:
> Am 07.08.2010 23:01, schrieb Michael Torrie:
>> On 08/07/2010 01:17 PM, W. eWatson wrote:
>>> Presumably I have him somehow delete the numpy site-package, the numpy
>>> 1.2.0 package? Just drill his way dow from the .../lib/site_packages?
>>> Then install 1.2.0. He's missed the boat on that before by not following
>>> instructions.

>>
>> Wait. I'm confused. Aren't you distributing your python app as an
>> executable, with the interpreter and all the libraries bundled?

>
> No, he was really mentioning two distinct scenarios. In the one
> discussed above, the remote machine had all stuff manually installed,
> and somehow got the actual Python program copied into it.
>
> Regards,
> Martin

To add to the msg I just sent to M. Torrie. We are given the msi
programs for Python, PIL,matplotlib, and numpy. The question of how to
uninstall and re-install a different version remains. The answer is?
 
Reply With Quote
 
Martin v. Loewis
Guest
Posts: n/a
 
      08-07-2010
> To add to the msg I just sent to M. Torrie. We are given the msi
> programs for Python, PIL,matplotlib, and numpy. The question of how to
> uninstall and re-install a different version remains.


I'd claim that this is not the real question. The real question is,
instead: "What specific error did you get when adding a single minus
sign to the program?"

Please try answering that question also.

> The answer is?


I'm not sure I understand the question. What do you mean by "given"?
Perhaps "already downloaded locally"?

If so, the obvious answer is "Go to Add-Remove-Programs. Uninstall.
Then double-click the MSI files." If that is not a good answer:
why not?

If you want that automated: write a batch file, invoking "msiexec"
as necessary.

Regards,
Martin


 
Reply With Quote
 
W. eWatson
Guest
Posts: n/a
 
      08-08-2010
On 8/7/2010 4:45 PM, Martin v. Loewis wrote:
>> To add to the msg I just sent to M. Torrie. We are given the msi
>> programs for Python, PIL,matplotlib, and numpy. The question of how to
>> uninstall and re-install a different version remains.

>
> I'd claim that this is not the real question. The real question is,
> instead: "What specific error did you get when adding a single minus
> sign to the program?"
>
> Please try answering that question also.
>
>> The answer is?

>
> I'm not sure I understand the question. What do you mean by "given"?
> Perhaps "already downloaded locally"?
>
> If so, the obvious answer is "Go to Add-Remove-Programs. Uninstall.
> Then double-click the MSI files." If that is not a good answer:
> why not?
>
> If you want that automated: write a batch file, invoking "msiexec"
> as necessary.
>
> Regards,
> Martin
>
>

Given. We either download them from various specified sites or newbies
get a CD when they receive hardware that is used by the sponsor's programs.

Add-Remove would be a very good answer, except for one thing. Understand
that I'm in Win7 so CP takes on a different form. On Control Panel
Add-Remove, I can find exactly two Python files: Python 2.5, and
python-Numpy-1.2.0. No scipy anything. Well, this is interesting. I just
noticed Martin v. Loewis on the Python 2.5 entry. That's you, right?

msiexec. Don't need it automated now, but it might be worthwhile, at
some future point.

I think I posted the errors my partner got above. Let me look. Yes,
here's the copy.
He gets

Traceback (most recent call last):
File "C:\Documents and
Settings\HP_Administrator.DavesDesktop\Desktop\NC-FireballReport20100729.py",
line 40, in <module>
from scipy import stats as stats # scoreatpercentile
File "C:\Python25\lib\site-packages\scipy\stats\__init__.py", line 7,
in <module>
from stats import *
File "C:\Python25\lib\site-packages\scipy\stats\stats.py", line 191,
in <module>
import scipy.special as special
File "C:\Python25\lib\site-packages\scipy\special\__init__.py", line
22, in <module>
from numpy.testing import NumpyTest
ImportError: cannot import name NumpyTest

Here are the first few lines of code.

import sys, os, glob
import string
from numpy import *
from datetime import datetime, timedelta
import time
from scipy import stats as stats # scoreatpercentile
 
Reply With Quote
 
Thomas Jollans
Guest
Posts: n/a
 
      08-08-2010
On 08/08/2010 03:10 AM, W. eWatson wrote:
> I think I posted the errors my partner got above. Let me look. Yes,
> here's the copy.
> He gets
>
> Traceback (most recent call last):
> File "C:\Documents and
> Settings\HP_Administrator.DavesDesktop\Desktop\NC-FireballReport20100729.py",
> line 40, in <module>
> from scipy import stats as stats # scoreatpercentile
> File "C:\Python25\lib\site-packages\scipy\stats\__init__.py", line 7,
> in <module>
> from stats import *
> File "C:\Python25\lib\site-packages\scipy\stats\stats.py", line 191,
> in <module>
> import scipy.special as special
> File "C:\Python25\lib\site-packages\scipy\special\__init__.py", line
> 22, in <module>
> from numpy.testing import NumpyTest
> ImportError: cannot import name NumpyTest
>


Is this error actually caused by the "one char change"? If you undo your
"one char change", does the error disappear?



> Here are the first few lines of code.
>
> import sys, os, glob
> import string
> from numpy import *
> from datetime import datetime, timedelta
> import time
> from scipy import stats as stats # scoreatpercentile


 
Reply With Quote
 
David Cournapeau
Guest
Posts: n/a
 
      08-08-2010
On Sun, Aug 8, 2010 at 10:10 AM, W. eWatson <(E-Mail Removed)> wrote:
> On 8/7/2010 4:45 PM, Martin v. Loewis wrote:
>>>
>>> To add to the msg I just sent to M. Torrie. We are given the msi
>>> programs for Python, PIL,matplotlib, and numpy. The question of how to
>>> uninstall and re-install a different version remains.

>>
>> I'd claim that this is not the real question. The real question is,
>> instead: "What specific error did you get when adding a single minus
>> sign to the program?"
>>
>> Please try answering that question also.
>>
>>> The answer is?

>>
>> I'm not sure I understand the question. What do you mean by "given"?
>> Perhaps "already downloaded locally"?
>>
>> If so, the obvious answer is "Go to Add-Remove-Programs. Uninstall.
>> Then double-click the MSI files." If that is not a good answer:
>> why not?
>>
>> If you want that automated: write a batch file, invoking "msiexec"
>> as necessary.
>>
>> Regards,
>> Martin
>>
>>

> Given. We either download them from various specified sites or newbies get a
> CD when they receive hardware that is used by the sponsor's programs.
>
> Add-Remove would be a very good answer, except for one thing. Understand
> that I'm in Win7 so CP takes on a different form. On Control Panel
> Add-Remove, I can find exactly two Python files: Python 2.5, and
> python-Numpy-1.2.0. No scipy anything. Well, this is interesting. I just
> noticed Martin v. Loewis on the Python 2.5 entry. That's you, right?


You are conflating so many issues at the same time, it is very
difficult to follow what you are doing.

Concerning the numpy error: you installed a version of scipy which
requires a more recent version of numpy than the one you have. More
concretely, NumpyTest has disappeared since 1.3.0. Unless you have a
good reason not to, I strongly suggest to just use the last released
versions of numpy and scipy (1.4.1 and 0.8.0 respectively).

Note also that Enthought Python Distribution exists to exactly avoid
those issues - they do the packaging hard word so that you don't have
to.

But none of this has anything to do with one character change or portability,

cheers,

David
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Very very very basic question Peter C Programming 14 02-14-2005 09:46 AM
very very very long integer shanx__=|;- C Programming 19 10-19-2004 03:55 PM
very very very long integer Abhishek Jha C Programming 4 10-17-2004 08:19 AM
Quick Book file access very very very slow Thomas Reed Computer Support 7 04-09-2004 08:09 PM
very Very VERY dumb Question About The new Set( ) 's Raymond Arthur St. Marie II of III Python 4 07-27-2003 12:09 AM



Advertisments