[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

python b.python 8 works on XP but not on Vista?

Isaac Gouy

3/6/2010 11:53:00 PM

At the command prompt:

python b.py 8
works fine on both XP and Vista

python b.python 8
works on XP (and Linux)

but on Vista

python b.python 8

ImportError: No module named b

?
8 Answers

Chris Rebert

3/7/2010 12:03:00 AM

0

On Sat, Mar 6, 2010 at 3:53 PM, Isaac Gouy <igouy2@yahoo.com> wrote:
> At the command prompt:
>
>   python b.py 8
> works fine on both XP and Vista
>
>   python b.python 8
> works on XP (and Linux)
>
> but on Vista
>
>   python b.python 8
>
> ImportError: No module named b
>
> ?

Code please. Also, .python is not a standard extension for Python
files, so why are you using it anyway?

Cheers,
Chris
--
http://blog.re...

Isaac Gouy

3/7/2010 12:43:00 AM

0

On Mar 6, 4:02 pm, Chris Rebert <c...@rebertia.com> wrote:
> On Sat, Mar 6, 2010 at 3:53 PM, Isaac Gouy <igo...@yahoo.com> wrote:
> > At the command prompt:
>
> >   python b.py 8
> > works fine on both XP and Vista
>
> >   python b.python 8
> > works on XP (and Linux)
>
> > but on Vista
>
> >   python b.python 8
>
> > ImportError: No module named b
>
> > ?
>
> Code please.


It's the same code in both cases, I simply renamed "b.python" as
"b.py" as a test.


> Also, .python is not a standard extension for Python
> files, so why are you using it anyway?

Because it's useful for what I'm doing.

Given python 2.6.4 has no problem with a non-standard extension on MS
XP and Linux - why does python 2.6.4 have this problem with a non-
standard extension on MS Vista?


Chris Rebert

3/7/2010 12:54:00 AM

0

On Sat, Mar 6, 2010 at 4:42 PM, Isaac Gouy <igouy2@yahoo.com> wrote:
> On Mar 6, 4:02 pm, Chris Rebert <c...@rebertia.com> wrote:
>> On Sat, Mar 6, 2010 at 3:53 PM, Isaac Gouy <igo...@yahoo.com> wrote:
>> > At the command prompt:
>>
>> >   python b.py 8
>> > works fine on both XP and Vista
>>
>> >   python b.python 8
>> > works on XP (and Linux)
>>
>> > but on Vista
>>
>> >   python b.python 8
>>
>> > ImportError: No module named b
>>
>> > ?
>>
>> Code please.
>
>
> It's the same code in both cases, I simply renamed "b.python" as
> "b.py" as a test.

The code in b.py matters. I /suspect/ it's importing itself somehow
(probably indirectly), and Python doesn't look for ".python" files
when importing, so it fails with an ImportError. But since you haven't
shown the code, I can only guess.

For that matter, the full exception Traceback would be more helpful
than the code; please include it as well.

Cheers,
Chris
--
http://blog.re...

Isaac Gouy

3/7/2010 1:24:00 AM

0

On Mar 6, 4:53 pm, Chris Rebert <c...@rebertia.com> wrote:
> On Sat, Mar 6, 2010 at 4:42 PM, Isaac Gouy <igo...@yahoo.com> wrote:
> > On Mar 6, 4:02 pm, Chris Rebert <c...@rebertia.com> wrote:
> >> On Sat, Mar 6, 2010 at 3:53 PM, Isaac Gouy <igo...@yahoo.com> wrote:
> >> > At the command prompt:
>
> >> >   python b.py 8
> >> > works fine on both XP and Vista
>
> >> >   python b.python 8
> >> > works on XP (and Linux)
>
> >> > but on Vista
>
> >> >   python b.python 8
>
> >> > ImportError: No module named b
>
> >> > ?
>
> >> Code please.
>
> > It's the same code in both cases, I simply renamed "b.python" as
> > "b.py" as a test.
>
> The code in b.py matters. I /suspect/ it's importing itself somehow
> (probably indirectly), and Python doesn't look for ".python" files
> when importing, so it fails with an ImportError. But since you haven't
> shown the code, I can only guess.

Yes the code in b.py matters.

Why it matters is that there was another difference between XP and
Vista - the XP machine was single core but the Vista machine was multi
core - and the code behaves differently in each case.

Thanks.

ssteinerX@gmail.com

3/7/2010 2:10:00 AM

0


On Mar 6, 2010, at 8:23 PM, Isaac Gouy wrote:

> On Mar 6, 4:53 pm, Chris Rebert <c...@rebertia.com> wrote:
>> On Sat, Mar 6, 2010 at 4:42 PM, Isaac Gouy <igo...@yahoo.com> wrote:
>>> On Mar 6, 4:02 pm, Chris Rebert <c...@rebertia.com> wrote:
>>>> On Sat, Mar 6, 2010 at 3:53 PM, Isaac Gouy <igo...@yahoo.com> wrote:
>>>>> At the command prompt:
>>
>>>>> python b.py 8
>>>>> works fine on both XP and Vista
>>
>>>>> python b.python 8
>>>>> works on XP (and Linux)
>>
>>>>> but on Vista
>>
>>>>> python b.python 8
>>
>>>>> ImportError: No module named b
>>
>>>>> ?
>>
>>>> Code please.
>>
>>> It's the same code in both cases, I simply renamed "b.python" as
>>> "b.py" as a test.
>>
>> The code in b.py matters. I /suspect/ it's importing itself somehow
>> (probably indirectly), and Python doesn't look for ".python" files
>> when importing, so it fails with an ImportError. But since you haven't
>> shown the code, I can only guess.
>
> Yes the code in b.py matters.
>
> Why it matters is that there was another difference between XP and
> Vista - the XP machine was single core but the Vista machine was multi
> core - and the code behaves differently in each case.

Yes, and the XP machine's case was blue, therefore case color is important, too.

S

Steven D'Aprano

3/7/2010 2:50:00 AM

0

On Sat, 06 Mar 2010 21:10:02 -0500, ssteinerX@gmail.com wrote:

> On Mar 6, 2010, at 8:23 PM, Isaac Gouy wrote:
>
>> On Mar 6, 4:53 pm, Chris Rebert <c...@rebertia.com> wrote:
>>> On Sat, Mar 6, 2010 at 4:42 PM, Isaac Gouy <igo...@yahoo.com> wrote:
>>>> On Mar 6, 4:02 pm, Chris Rebert <c...@rebertia.com> wrote:
>>>>> On Sat, Mar 6, 2010 at 3:53 PM, Isaac Gouy <igo...@yahoo.com> wrote:
>>>>>> At the command prompt:
>>>
>>>>>> python b.py 8
>>>>>> works fine on both XP and Vista
>>>
>>>>>> python b.python 8
>>>>>> works on XP (and Linux)
>>>
>>>>>> but on Vista
>>>
>>>>>> python b.python 8
>>>
>>>>>> ImportError: No module named b
>>>
>>>>>> ?
>>>
>>>>> Code please.
>>>
>>>> It's the same code in both cases, I simply renamed "b.python" as
>>>> "b.py" as a test.
>>>
>>> The code in b.py matters. I /suspect/ it's importing itself somehow
>>> (probably indirectly), and Python doesn't look for ".python" files
>>> when importing, so it fails with an ImportError. But since you haven't
>>> shown the code, I can only guess.
>>
>> Yes the code in b.py matters.
>>
>> Why it matters is that there was another difference between XP and
>> Vista - the XP machine was single core but the Vista machine was multi
>> core - and the code behaves differently in each case.
>
> Yes, and the XP machine's case was blue, therefore case color is
> important, too.


Don't forget that the XP machine was on the left hand side of the desk,
and the Vista machine on the right. I suspect Isaac needs to physically
move the Vista machine to the left side, and it will work perfectly.

Either that, or stop pissing around and show us the actual stack trace so
we can actually help. Isaac, stop *guessing* what the problem is.

If you have to guess, try to make your guesses realistic. It's not likely
anything to do with the CPU. If anything, Python's search path is
different on your Vista and XP machines.




--
Steven

Isaac Gouy

3/7/2010 3:05:00 AM

0

On Mar 6, 6:50 pm, Steven D'Aprano <st...@REMOVE-THIS-
cybersource.com.au> wrote:
> On Sat, 06 Mar 2010 21:10:02 -0500, sstein...@gmail.com wrote:
> > On Mar 6, 2010, at 8:23 PM, Isaac Gouy wrote:
>
> >> On Mar 6, 4:53 pm, Chris Rebert <c...@rebertia.com> wrote:
> >>> On Sat, Mar 6, 2010 at 4:42 PM, Isaac Gouy <igo...@yahoo.com> wrote:
> >>>> On Mar 6, 4:02 pm, Chris Rebert <c...@rebertia.com> wrote:
> >>>>> On Sat, Mar 6, 2010 at 3:53 PM, Isaac Gouy <igo...@yahoo.com> wrote:
> >>>>>> At the command prompt:
>
> >>>>>>   python b.py 8
> >>>>>> works fine on both XP and Vista
>
> >>>>>>   python b.python 8
> >>>>>> works on XP (and Linux)
>
> >>>>>> but on Vista
>
> >>>>>>   python b.python 8
>
> >>>>>> ImportError: No module named b
>
> >>>>>> ?
>
> >>>>> Code please.
>
> >>>> It's the same code in both cases, I simply renamed "b.python" as
> >>>> "b.py" as a test.
>
> >>> The code in b.py matters. I /suspect/ it's importing itself somehow
> >>> (probably indirectly), and Python doesn't look for ".python" files
> >>> when importing, so it fails with an ImportError. But since you haven't
> >>> shown the code, I can only guess.
>
> >> Yes the code in b.py matters.
>
> >> Why it matters is that there was another difference between XP and
> >> Vista - the XP machine was single core but the Vista machine was multi
> >> core - and the code behaves differently in each case.
>
> > Yes, and the XP machine's case was blue, therefore case color is
> > important, too.
>
> Don't forget that the XP machine was on the left hand side of the desk,
> and the Vista machine on the right. I suspect Isaac needs to physically
> move the Vista machine to the left side, and it will work perfectly.
>
> Either that, or stop pissing around and show us the actual stack trace so
> we can actually help. Isaac, stop *guessing* what the problem is.
>
> If you have to guess, try to make your guesses realistic. It's not likely
> anything to do with the CPU. If anything, Python's search path is
> different on your Vista and XP machines.
>
> --
> Steven


That was "Thanks." as in problem solved.

When the code switches on multiprocessing.cpu_count() - single core vs
multicore matters.

Steven D'Aprano

3/7/2010 4:23:00 AM

0

On Sat, 06 Mar 2010 19:04:56 -0800, Isaac Gouy wrote:

> That was "Thanks." as in problem solved.
>
> When the code switches on multiprocessing.cpu_count() - single core vs
> multicore matters.

I'm glad you solved your problem. Out of curiosity, what was the fault?
Not the condition that leads to the fault, but the actual fault?

My guess is that it was a difference in sys.path, leading to the b module
not being found. Am I close?


--
Steven