error LNK2001: unresolved external symbol PyInit_init
Here is an issue when trying to install wheezy.template (it uses cythonize) into environment with cython. Host: windows 7 64bit Python version: 3.4.1 32 bit wheezy.template version: 0.1.151 When installing either from pip3 or downloading the source with python3 setup.py install c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild /EXPORT: PyInit_init build\temp.win32-3.4\Release\src\wheezy\template__init.obj /O UT:build\lib.win32-3.4\wheezy\template__init.pyd /IMPLIB:build\temp.win32-3.4 \Release\src\wheezy\template__init.lib /MANIFESTFILE:build\temp.win32-3.4\Rel ease\src\wheezy\template__init.pyd.manifest LINK : error LNK2001: unresolved external symbol PyInit_init build\temp.win32-3.4\Release\src\wheezy\template__init__.lib : fatal error LNK1120: 1 unresolved externals error: command 'c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe' failed with exit status 1120 Some details are here: https://bitbucket.org/akorn/wheezy.template/issue/10/installation-on-windows... Thanks. Andriy Kornatskyy
To build a Python extension for Win64 you must define the symbol MS_WIN64, typically -DMS_WIN64. Sturla Andriy Kornatskyy <andriy.kornatskyy@live.com> wrote:
Here is an issue when trying to install wheezy.template (it uses cythonize) into environment with cython.
Host: windows 7 64bit Python version: 3.4.1 32 bit wheezy.template version: 0.1.151
When installing either from pip3 or downloading the source with python3 setup.py install
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild /EXPORT: PyInit_init build\temp.win32-3.4\Release\src\wheezy\template__init.obj /O UT:build\lib.win32-3.4\wheezy\template__init.pyd /IMPLIB:build\temp.win32-3.4 \Release\src\wheezy\template__init.lib /MANIFESTFILE:build\temp.win32-3.4\Rel ease\src\wheezy\template__init.pyd.manifest LINK : error LNK2001: unresolved external symbol PyInit_init build\temp.win32-3.4\Release\src\wheezy\template__init__.lib : fatal error LNK1120: 1 unresolved externals error: command 'c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe' failed with exit status 1120
Some details are here: https://bitbucket.org/akorn/wheezy.template/issue/10/installation-on-windows...
Thanks.
Andriy Kornatskyy
On 20 August 2014 20:25, Sturla Molden <sturla.molden@gmail.com> wrote:
To build a Python extension for Win64 you must define the symbol MS_WIN64, typically -DMS_WIN64.
Sturla, isn't this supposed to be handled in pyconfig.h (at least when using MSVC) ? I see these lines in PC/pyconfig.h (from Python sources): /* MSVC defines _WINxx to differentiate the windows platform types Note that for compatibility reasons _WIN32 is defined on Win32 *and* on Win64. For the same reasons, in Python, MS_WIN32 is defined on Win32 *and* Win64. Win32 only code must therefore be guarded as follows: #if defined(MS_WIN32) && !defined(MS_WIN64) Some modules are disabled on Itanium processors, therefore we have MS_WINI64 set for those targets, otherwise MS_WINX64 */ #ifdef _WIN64 #define MS_WIN64 #endif -- Lisandro Dalcin --------------- CIMEC (UNL/CONICET) Predio CONICET-Santa Fe Colectora RN 168 Km 472, Paraje El Pozo 3000 Santa Fe, Argentina Tel: +54-342-4511594 (ext 1016) Tel/Fax: +54-342-4511169
On 21/08/14 13:30, Lisandro Dalcin wrote:
Sturla, isn't this supposed to be handled in pyconfig.h (at least when using MSVC) ? I see these lines in PC/pyconfig.h (from Python sources):
Yes, it is supposed to, but the error message suggest it was not and the compile line does not have it. Sturla
On 14 August 2014 08:20, Andriy Kornatskyy <andriy.kornatskyy@live.com> wrote:
When installing either from pip3 or downloading the source with python3 setup.py install
Could you please show us the full output of "python3 setup.py build" ? -- Lisandro Dalcin ============ Research Scientist Computer, Electrical and Mathematical Sciences & Engineering (CEMSE) Numerical Porous Media Center (NumPor) King Abdullah University of Science and Technology (KAUST) http://numpor.kaust.edu.sa/ 4700 King Abdullah University of Science and Technology al-Khawarizmi Bldg (Bldg 1), Office # 4332 Thuwal 23955-6900, Kingdom of Saudi Arabia http://www.kaust.edu.sa Office Phone: +966 12 808-0459
Here is a link to complete output with python3.4: https://bitbucket.org/akorn/wheezy.template/issue/10/installation-on-windows... Thanks. Andriy Kornatskyy On Aug 24, 2014, at 11:57 AM, Lisandro Dalcin <dalcinl@gmail.com> wrote:
On 14 August 2014 08:20, Andriy Kornatskyy <andriy.kornatskyy@live.com> wrote:
When installing either from pip3 or downloading the source with python3 setup.py install
Could you please show us the full output of "python3 setup.py build" ?
-- Lisandro Dalcin ============ Research Scientist Computer, Electrical and Mathematical Sciences & Engineering (CEMSE) Numerical Porous Media Center (NumPor) King Abdullah University of Science and Technology (KAUST) http://numpor.kaust.edu.sa/
4700 King Abdullah University of Science and Technology al-Khawarizmi Bldg (Bldg 1), Office # 4332 Thuwal 23955-6900, Kingdom of Saudi Arabia http://www.kaust.edu.sa
Office Phone: +966 12 808-0459 _______________________________________________ cython-devel mailing list cython-devel@python.org https://mail.python.org/mailman/listinfo/cython-devel
64-bit Python cannot be used to build 32-bit extensions. Yes, you can build extensions for 32-bit Python on 64-bit Windows, but not with 64-bit Python. Sturla Andriy Kornatskyy <andriy.kornatskyy@live.com> wrote:
Here is a link to complete output with python3.4:
https://bitbucket.org/akorn/wheezy.template/issue/10/installation-on-windows...
Thanks.
Andriy Kornatskyy
On Aug 24, 2014, at 11:57 AM, Lisandro Dalcin <dalcinl@gmail.com> wrote:
On 14 August 2014 08:20, Andriy Kornatskyy <andriy.kornatskyy@live.com> wrote:
When installing either from pip3 or downloading the source with python3 setup.py install
Could you please show us the full output of "python3 setup.py build" ?
-- Lisandro Dalcin ============ Research Scientist Computer, Electrical and Mathematical Sciences & Engineering (CEMSE) Numerical Porous Media Center (NumPor) King Abdullah University of Science and Technology (KAUST) http://numpor.kaust.edu.sa/
4700 King Abdullah University of Science and Technology al-Khawarizmi Bldg (Bldg 1), Office # 4332 Thuwal 23955-6900, Kingdom of Saudi Arabia http://www.kaust.edu.sa
Office Phone: +966 12 808-0459 _______________________________________________ cython-devel mailing list cython-devel@python.org https://mail.python.org/mailman/listinfo/cython-devel
Sturla, Per further details: https://bitbucket.org/akorn/wheezy.template/issue/10/installation-on-windows... It is python 32 bit on 64 bit machine. Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (In tel)] on win32 Thanks. Andriy Kornatskyy On Aug 27, 2014, at 11:47 AM, Sturla Molden <sturla.molden@gmail.com> wrote:
64-bit Python cannot be used to build 32-bit extensions. Yes, you can build extensions for 32-bit Python on 64-bit Windows, but not with 64-bit Python.
Sturla
Andriy Kornatskyy <andriy.kornatskyy@live.com> wrote:
Here is a link to complete output with python3.4:
https://bitbucket.org/akorn/wheezy.template/issue/10/installation-on-windows...
Thanks.
Andriy Kornatskyy
On Aug 24, 2014, at 11:57 AM, Lisandro Dalcin <dalcinl@gmail.com> wrote:
On 14 August 2014 08:20, Andriy Kornatskyy <andriy.kornatskyy@live.com> wrote:
When installing either from pip3 or downloading the source with python3 setup.py install
Could you please show us the full output of "python3 setup.py build" ?
-- Lisandro Dalcin ============ Research Scientist Computer, Electrical and Mathematical Sciences & Engineering (CEMSE) Numerical Porous Media Center (NumPor) King Abdullah University of Science and Technology (KAUST) http://numpor.kaust.edu.sa/
4700 King Abdullah University of Science and Technology al-Khawarizmi Bldg (Bldg 1), Office # 4332 Thuwal 23955-6900, Kingdom of Saudi Arabia http://www.kaust.edu.sa
Office Phone: +966 12 808-0459 _______________________________________________ cython-devel mailing list cython-devel@python.org https://mail.python.org/mailman/listinfo/cython-devel
_______________________________________________ cython-devel mailing list cython-devel@python.org https://mail.python.org/mailman/listinfo/cython-devel
Andriy Kornatskyy schrieb am 27.08.2014 um 07:08:
Here is a link to complete output with python3.4: https://bitbucket.org/akorn/wheezy.template/issue/10/installation-on-windows...
What Lisandro meant with "complete" is "from entering the build command to the point where it fails". Stefan
Stefan, Hmm… you have a complete build log from the entering the build command up to the point where it fails which you can still find here: https://bitbucket.org/akorn/wheezy.template/issue/10/installation-on-windows... Or am I missing something? Thanks. Andriy Kornatskyy On Aug 28, 2014, at 10:29 AM, Stefan Behnel <stefan_ml@behnel.de> wrote:
Andriy Kornatskyy schrieb am 27.08.2014 um 07:08:
Here is a link to complete output with python3.4: https://bitbucket.org/akorn/wheezy.template/issue/10/installation-on-windows...
What Lisandro meant with "complete" is "from entering the build command to the point where it fails".
Stefan
_______________________________________________ cython-devel mailing list cython-devel@python.org https://mail.python.org/mailman/listinfo/cython-devel
Andriy Kornatskyy schrieb am 28.08.2014 um 10:08:
Hmm… you have a complete build log from the entering the build command up to the point where it fails which you can still find here:
https://bitbucket.org/akorn/wheezy.template/issue/10/installation-on-windows...
Sorry, where? All I see is the command and then the linker command, no Cython build call, no C compiler build call, no distutils output. Stefan
Stefan, That is an output of build: python setup.py build. There is nothing else produced unless you tell how to make it more verbose to provide you what you expect to see. How else you want this to be built? Thanks. Andriy Kornatskyy On Aug 28, 2014, at 1:46 PM, Stefan Behnel <stefan_ml@behnel.de> wrote:
Andriy Kornatskyy schrieb am 28.08.2014 um 10:08:
Hmm… you have a complete build log from the entering the build command up to the point where it fails which you can still find here:
https://bitbucket.org/akorn/wheezy.template/issue/10/installation-on-windows...
Sorry, where? All I see is the command and then the linker command, no Cython build call, no C compiler build call, no distutils output.
Stefan
_______________________________________________ cython-devel mailing list cython-devel@python.org https://mail.python.org/mailman/listinfo/cython-devel
Lisandro Dalcin schrieb am 24.08.2014 um 10:57:
On 14 August 2014 08:20, Andriy Kornatskyy wrote:
When installing either from pip3 or downloading the source with python3 setup.py install
Could you please show us the full output of "python3 setup.py build" ?
It's here: http://pastebin.com/vZb2gAvL The other modules build fine, only the package script fails to link. The problem is the "/EXPORT:PyInit___init__" flag, whereas the real name of the module init function is (or should be) "PyInit_template", which is the name of the package. Does anyone have a good idea how to fix this? Looks like a distutils issue. I don't think package compilation was originally envisioned as something extension module authors would want to do. Does the "cythonize_script_package" test work on MSWindows? It does the same thing. Stefan
participants (4)
-
Andriy Kornatskyy -
Lisandro Dalcin -
Stefan Behnel -
Sturla Molden