[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2011-06-06 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Stefan Krah wrote:
> > 
> > Stefan Krah  added the comment:
> > 
> > Marc-Andre Lemburg  wrote:
>> >> Wouldn't it be better to have distutils tell the user about the
>> >> possible options, instead of guessing and then possibly compiling
>> >> extensions which later on don't import or import, but don't work
>> >> as expected ?
> > 
> > That would be an option, yes.
> > 
> > 
>> >> Regarding the latest patch: This is not the right approach, since
>> >> find_vcvarsall() is supposed to return the path to the vcvarsall.bat
>> >> file and not an architecture specific setup file. It is later
>> >> called with the arch identifier, which the arch specific setup files
>> >> don't check or use.
> > 
> > The patch does not change anything for Visual Studio Pro. In Visual Studio
> > Express (+SDK) vcvarsall.bat is broken, so the architecture specific setup
> > files have to be used (they also work with a superfluous parameter).

I guess what I wanted to say is that find_vcvarsall() should
return None for VC Express and code using it should then
revert to using a new find_vcvars() function, which takes the
architecture as parameter and returns the path to the correct
architecture setup file.

Hacking the support into find_vcvarsall() is not the right
approach. You have to add this support one level further up.

>> >> Also note that vcvarsall.bat can take these options:
>> >>
>> >>x86 (default), x64, amd64, x86_amd64, ia64, x86_ia64
>> >>
>> >> The x86_* options setup the cross compilers.
> > 
> > I think the patch covers all architecture specific files that are
> > present in the Visual Studio Express + SDK setup.

Right, but it doesn't cover the ones available in VS Pro (see
above), which it should for completeness.

> > Visual Studio Pro is protected from all changes by checking for
> > the presence of the file bin\amd64\vcvarsamd64.bat. This
> > could probably be done more elegantly by using some obscure
> > registry value.
> > 
> > 
> > 
> > As Thorsten mentioned, another option would be to copy bin\vcvars64.bat
> > to bin\amd64\vcvarsamd64.bat if the latter is not present.
> > 
> > This is harmless, but it is perhaps not really the business of Python
> > to mess with existing installs.

Not a good idea :-)

PS: Changing the title, since I keep getting the following error messages from 
the email interface:

There were problems handling your subject line argument list:
- not of form [arg=value,value,...;arg=value,value,...]

Subject was: "Re: [issue7511] msvc9compiler.py: ValueError: [u'path']"

--
title: msvc9compiler.py: ValueError: [u'path'] -> msvc9compiler.py: ValueError 
when trying to compile with VC Express

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2011-06-07 Thread Stefan Krah

Stefan Krah  added the comment:

Marc-Andre Lemburg  wrote:
> >> >> Regarding the latest patch: This is not the right approach, since
> >> >> find_vcvarsall() is supposed to return the path to the vcvarsall.bat
> >> >> file and not an architecture specific setup file. It is later
> >> >> called with the arch identifier, which the arch specific setup files
> >> >> don't check or use.
> > > 
> > > The patch does not change anything for Visual Studio Pro. In Visual Studio
> > > Express (+SDK) vcvarsall.bat is broken, so the architecture specific setup
> > > files have to be used (they also work with a superfluous parameter).
> 
> I guess what I wanted to say is that find_vcvarsall() should
> return None for VC Express and code using it should then
> revert to using a new find_vcvars() function, which takes the
> architecture as parameter and returns the path to the correct
> architecture setup file.
> 
> Hacking the support into find_vcvarsall() is not the right
> approach. You have to add this support one level further up.

I agree that it is nicer if find_vcvarsall() actually returns vcvarsall.
The next level though is query_vcvarsall(), so it would still be wrong
to query vcvars64 in that function.

So unless query_vcvarsall() is renamed to something neutral like set_vcvars(),
I'm not sure where to add the support. But I imagine that renaming is out of
the question.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2011-06-07 Thread R. David Murray

Changes by R. David Murray :


--
nosy:  -r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2011-06-11 Thread Éric Araujo

Éric Araujo  added the comment:

> Hmm, in http://bugs.python.org/issue7511#msg106420 Tarek appeared to
> be supportive of the patch.

I believe Martin has more knowledge about Windows.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2012-03-12 Thread Sean Reifschneider

Sean Reifschneider  added the comment:

Martin: They are looking for you to review this, in particular see:

http://bugs.python.org/issue7511#msg106420

--
assignee: tarek -> loewis
nosy: +jafo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2012-03-27 Thread Victor Lin

Victor Lin  added the comment:

My environment is Windows 7 64bits with VC++ 2008 Express and Python2.7.2.

I encountered same problem, I have tried all solution posted here, but non of 
them work.

Eventually, I add "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" 
to my PATH and it works.

It appears that the command 

"vcvarsall.bat" x86 & set

outputs different values depending on whether "C:\Program Files (x86)\Microsoft 
Visual Studio 9.0\VC\bin" in PATH.

--
nosy: +Victor.Lin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2012-03-28 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Victor, can you apply this patch and report that it works. In particular, if it 
does *not* work, can you please report the exact way of failing? (if you can, 
please also try to investigate why it fails).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2012-03-28 Thread Victor Lin

Victor Lin  added the comment:

Oddly, can't reproduce the problem anymore. I try to install win7 on virtual 
machine, but it works as well. I think the issue might caused by something 
else... not sure, so strange :S

Will look into detail once I encounter this issue again.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2012-04-11 Thread Yap Sok Ann

Yap Sok Ann  added the comment:

On 64-bit Windows with Visual Studio 2008 Professional, I also need to apply 
vcvars4.diff to avoid getting the ValueError. Is this something to be expected?

--
nosy: +sayap

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2012-04-20 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy:  -mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2012-05-18 Thread Piotr Dobrogost

Piotr Dobrogost  added the comment:

Just bumped into this issue when installing gevent 1.0b2 on Vista 64bit using 
pip. I think it would be worth to mention that although I'm not quite new to 
Python and in the past I already investigated issue with distutils not finding 
vcvarsall.bat (http://stackoverflow.com/a/5122521/95735), I didn't remember 
about DISTUTILS_USE_SDK environment variable. What I'm trying to say is that 
there are probably more people like me, having Visual Studio 2008 Express + 
Windows SDK installed but not knowing distutils. After seeing that Windows SDK 
installs 64bit compiler into VC\bin folder of Visual Studio's installation I 
thought that Python would pick it up automatically the same way it does with 
non Express versions of Visual Studio.

--
nosy: +piotr.dobrogost

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2012-10-26 Thread Daniel Oźminkowski

Daniel Oźminkowski added the comment:

Python 2.7.3
WinXP Professional 2002 + SP3
Visual Studio C++ Express 2008

I bumped into this error trying to install fabric. One of the installation 
steps is compiling pycrypto.
After looking into C:\Program Files\Microsoft Visual Studio 
9.0\VC\bin\vcvars32.bat I saw:
"%VS90COMNTOOLS%vsvars32.bat"

so I run:
set VS90COMNTOOLS=C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools 
directly before pip install fabric and it compiled successfully. Still need to 
see if it works.

--
nosy: +Daniel.Ozminkowski

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2013-02-24 Thread Takayuki SHIMIZUKAWA

Takayuki SHIMIZUKAWA added the comment:

FYI. I was able to build both 32bit/64bit.

Python 2.7.3 (32bit)
WinXP Professional SP3 (x86)
Visual Studio C++ Express 2008 SP1
Microsoft Windows SDK 2008

invoke Windows SDK's `CMD Shell` and do following:

C:\tmp> setenv /x64 /release
C:\tmp> set libpath=dummy
C:\tmp> python setup.py build --plat-name=win-amd64 build_ext 
--library_dirs=C:\Python27\libs-amd64

details is here: 
http://www.freia.jp/taka/blog/python-win32-binary-building-and-x64-cross-compiling-on-32bit-platform/index.html

--
nosy: +shimizukawa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2013-03-22 Thread Steve Dower

Steve Dower added the comment:

This becomes more of an issue since VC++ 2008 Express is no longer available 
for download (unless you're an MSDN subscriber), though the compiler itself is 
still available as part of 
http://www.microsoft.com/en-us/download/details.aspx?id=3138 (for VC9)

I'll admit I haven't read all the discussion on other issues that relates to 
this, but I see no reason why the following maps couldn't be tried if 
vcvarsall.bat is not found. This would at least handle more cases and as far as 
I can tell is the only realistic option.

VCVARS_TO_WINSDK_BAT = {
'x86' : 'bin\\vcvars32.bat',
'amd64' : 'bin\\vcvars64.bat',
'x86_amd64' : 'bin\\vcvarsx86_amd64.bat',
'x86_ia64' : 'bin\\vcvarsx86_ia64.bat',
}

VCVARS_TO_VS_BAT = {
'x86' : 'bin\\vcvars32.bat',
'amd64' : 'bin\\amd64\\vcvars64.bat',
'x86_amd64' : 'bin\\x86_amd64\\vcvarsx86_amd64.bat',
'x86_ia64' : 'bin\\x86_ia64\\vcvarsx86_ia64.bat',
}

I have no idea why, but the SDK installs the batch files into different 
locations. VCVARS_TO_VS_BAT should be unnecessary, since vcvarsall.bat should 
always exist in this case, but I see no harm in having more fallback options.

All of these scripts (at least for VC9, VC10 and VC11) will ignore extra 
arguments.

--
nosy: +steve.dower

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2013-03-22 Thread Steve Dower

Steve Dower added the comment:

('ignore extra arguments' meaning they could be returned from find_vcvarsall() 
and nobody will notice. Though it doesn't bother me if the fallback is handled 
at a higher level.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2013-03-22 Thread Steve Dower

Steve Dower added the comment:

I've dug deeper into VC10 and things are even worse there - without VS 
installed I don't think there's any way for distutils to work without 
completely replacing query_vcvarsall() (or msvc9compiler, for that matter).

I'm willing to write such a replacement, assuming I can get permission from my 
management. But I'd rather not do it if someone else is already working on it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2013-03-23 Thread Takayuki SHIMIZUKAWA

Takayuki SHIMIZUKAWA added the comment:

Hi Steve,

> This becomes more of an issue since VC++ 2008 Express is no longer available 
> for download (unless you're an MSDN subscriber)

Here: http://www.microsoft.com/en-us/download/details.aspx?id=13276

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2013-03-23 Thread Steve Dower

Steve Dower added the comment:

>> This becomes more of an issue since VC++ 2008 Express is no longer available 
>> for download (unless you're an MSDN subscriber)
>
> Here: http://www.microsoft.com/en-us/download/details.aspx?id=13276

That's just the service pack and it won't install unless you already have VS 
installed. There is no way (other than being an MSDN subscriber) to get VS 2008 
at this point - I've checked.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2013-03-23 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 23.03.2013 16:39, Steve Dower wrote:
> 
> Steve Dower added the comment:
> 
>>> This becomes more of an issue since VC++ 2008 Express is no longer 
>>> available for download (unless you're an MSDN subscriber)
>>
>> Here: http://www.microsoft.com/en-us/download/details.aspx?id=13276
> 
> That's just the service pack and it won't install unless you already have VS 
> installed. There is no way (other than being an MSDN subscriber) to get VS 
> 2008 at this point - I've checked.

There is, but you have to know what to look for :-)

http://download.microsoft.com/download/E/8/E/E8EEB394-7F42-4963-A2D8-29559B738298/VS2008ExpressWithSP1ENUX1504728.iso

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2013-03-23 Thread Steve Dower

Steve Dower added the comment:

>> That's just the service pack and it won't install unless you already have VS 
>> installed. There is no way (other than being an MSDN subscriber) to get VS 
>> 2008 at this point - I've checked.
>
> There is, but you have to know what to look for :-)

Fair enough, but I can't (as a Microsoft employee) endorse that link or 
guarantee that it won't go away :)

I still think it's worth fixing distutils to look in the right places for VC, 
since there are multiple ways of installing it that all include different batch 
files.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2013-03-23 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 23.03.2013 22:33, Steve Dower wrote:
> 
> Steve Dower added the comment:
> 
>>> That's just the service pack and it won't install unless you already have 
>>> VS installed. There is no way (other than being an MSDN subscriber) to get 
>>> VS 2008 at this point - I've checked.
>>
>> There is, but you have to know what to look for :-)
> 
> Fair enough, but I can't (as a Microsoft employee) endorse that link or 
> guarantee that it won't go away :)
> 
> I still think it's worth fixing distutils to look in the right places for VC, 
> since there are multiple ways of installing it that all include different 
> batch files.

Sure, no question about that. Adding support for more MS VC versions
is always a plus :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2013-04-09 Thread Steve Dower

Steve Dower added the comment:

I've added a patch that replaces query_vcvarsall() with an implementation that 
does not try and use the batch file. Instead, the functionality of the batch 
file (effectively, reading the base path from the registry and appending 
constants) is reproduced in Python code.

(There is a second patch for 2.7, since winreg/_winreg is different between the 
two.)

There is no reason to expect that the installation layout of VC9 and VC10 will 
change at this stage, though future updates may be required for new versions 
(though I've already added the mapping for VC11 - not that we're building 
Python with that one yet).

I have left find_vcvarsall() in there, even though it is no longer used, in 
case other tools are monkeypatching to work around the existing issue.

--
Added file: http://bugs.python.org/file29754/msvccompiler9_33.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2013-04-09 Thread Steve Dower

Steve Dower added the comment:

Adding patch for 2.7.

--
Added file: http://bugs.python.org/file29755/msvccompiler9_27.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2013-07-03 Thread Frankie Jhou

Frankie Jhou added the comment:

Microsoft using Visual Studio 2012 (VC 11.0) now,
Errors happened again. 
I just want to install Cython.

Error: Unable to find vcvarsall.bat
ValueError: [u'path', u'include', u'lib']
NameError: name 'KEY_BASE' is not defined
KeyError: '9.0'
error: command 'cl.exe' failed: No such file or directory

--
nosy: +Frankie.Jhou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2013-07-08 Thread Steve Dower

Steve Dower added the comment:

I must have missed something when I merged files to create the diffs. In any 
case, you'll still require VC9 or VC10 to be able to build something compatible 
with a CPython release (though maybe that doesn't matter for Cython? I don't 
know).

When I get a chance I'll fix up the changes and then ping Python-Dev about 
getting a review.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com