Python Portability--Not very portable?

W

W. eWatson

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.
 
M

Martin v. Loewis

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
 
M

Michael Torrie

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?
 
M

Martin v. Loewis

Am 07.08.2010 23:01, schrieb Michael Torrie:
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
 
W

W. eWatson

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.
 
W

W. eWatson

Am 07.08.2010 23:01, schrieb Michael Torrie:

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?
 
M

Martin v. Loewis

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
 
W

W. eWatson

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.


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
 
T

Thomas Jollans

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?
 
D

David Cournapeau

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
 
W

W. eWatson

On 8/8/2010 4:08 AM, David Cournapeau wrote:
....
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
Believe me I had no intent of expanding this thread beyond looking for a
straight and simple insight to Python distribution (portability,
whatever) and how to get my partner squared away. The general issue
seems to drifted off on its own accord. I find generally that once I've
had to post five times on a topic, and haven't gotten a satisfactory
answer, I'm not going to get one.

Yes, you are quite correct about numpy, but for reasons which I have no
plans to explain, I want my partner on the same version of numpy as
myself. I now have the answer I need, and I do not care one more wit
about a one character change.

I'm done here.
 
M

Martin v. Loewis

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, it should be there. Perhaps it was installed by a different user,
and will only show up when that user goes into CP?

Do you recall what procedure you have used for installation?
Well, this is interesting. I just
noticed Martin v. Loewis on the Python 2.5 entry. That's you, right?

Correct. I keep building the installers, but was asked to put Python
Software Foundation into the creator field of the MSI file.
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


There is no way this can be attributed to an addition of a single character.

In your partner's version of numpy.testing, there is no name NumpyTest.
That sounds alright - in my version of numpy, there is no
numpy.testing.NumpyTest, either. However, the line in
special\__init__.py, on my system, reads

from numpy.testing import Tester

So it looks like that the scipy version and the numpy version don't
match.

Regards,
Martin
 
A

alex23

W. eWatson said:
I now have the answer I need, and I do not care one more wit
about a one character change.

I'm done here.

That's a fantastic response to give to people who were actually
willing to sacrifice their time to help you with your problems. I'm
always stunned at those who come here in ignorance somehow "knowing"
what the correct answer they wanted is, even when it runs counter to
responses from far more experienced people.

Good luck continuing to get help here with that attitude.
 
L

Lawrence D'Oliveiro

Believe me I had no intent of expanding this thread beyond looking for a
straight and simple insight to Python distribution (portability,
whatever) and how to get my partner squared away. The general issue
seems to drifted off on its own accord.

“Drifted off†bullshit. A whole lot of responders have wasted a whole lot of
time trying to get to the bottom of your “one-character changeâ€, and now you
try to pretend it wasn’t the issue at all.
 
G

geremy condra

“Drifted off” bullshit. A whole lot of responders have wasted a whole lot of
time trying to get to the bottom of your “one-character change”, and now you
try to pretend it wasn’t the issue at all.

To be fair, it wasn't, little though he knew it.

Geremy Condra
 
R

rantingrick

I'm done here.

Well thats just great, now how will we ever know what the one char
change was. Hmm.

Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
-a
TypeError: bad operand type for unary -: 'str'

Go figure!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top