This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: python34.dll is not installed
Type: compile error Stage:
Components: Build, Library (Lib), Windows Versions: Python 3.4
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: Pat.Le.Cat, loewis, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2014-06-17 21:53 by Pat.Le.Cat, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
SnakesTest.cpp Pat.Le.Cat, 2014-06-22 08:48 Python3 example from your website
Messages (12)
msg220902 - (view) Author: Pat Le Cat (Pat.Le.Cat) Date: 2014-06-17 21:53
I use Python 3.4.1 x64 (binaries downloaded) under Windows 8.1 with mingw64 (GCC 4.9 using C++). All the other functions work fine.

Excerpt:
    Py_SetPath(L"python34.zip");
    wchar_t* pyPath = Py_GetPath();
    Py_Initialize();
msg221234 - (view) Author: Pat Le Cat (Pat.Le.Cat) Date: 2014-06-22 08:48
Okay I tried the exact same example code from your website on the MSVC-2013 (same OS) suite and got new errors with it and a strange warning.

>>Warning:
1>c:\python34\include\pymath.h(22): warning C4273: 'round' : inconsistent dll linkage
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\math.h(516) : see previous definition of 'round'

>>Runtime crash:
C:\Users\xxx\Documents\Visual Studio 2013\Projects\SnakesTest\x64\Release>SnakesTest.exe multiply multiply 3 2
Fatal Python error: Py_Initialize: unable to load the file system codec
ImportError: No module named 'encodings'

I linked with both the 'python3.lib' and the 'python34.lib' (what's the difference anyways?) with the same results.
It looks to me as if the DLL doesn't contain all the same symbols as in the include file, or have you done some obscure compressing with the DLL maybe? But the "inconsistent dll linkage" seems to be the leading hint here.


ADDENDUM: I forgot to mention that under mingw I do directly link to the python3.dll, since there is no python3.a libfile around and dlltool was unable to extract any symbols from the DLL.
msg221240 - (view) Author: Pat Le Cat (Pat.Le.Cat) Date: 2014-06-22 09:45
**Missing Python34.dll in installation**

Okay it's getting more interesting. I downloaded Python 3.4 windows x64 binary and extracted the DLLs and suddenly I discovered that release 3.4.1 is missing the Python34.dll !! :-O

Once I link against the python34.dll from mingw/gcc then it compiles fine :D (the 77kb from the python3.dll seemed too small anyhow ;) )

Now I have the similar error at runtime as with MSVC-2013:
C:\Development\xxx\Testo1\Snakes\Release>Snakes.exe multiply multiply 3 2
Fatal Python error: Py_Initialize: unable to load the file system codec
ImportError: No module named 'encodings'


Now the question remains what "unicode" module python is complaining about?!?
msg221245 - (view) Author: Pat Le Cat (Pat.Le.Cat) Date: 2014-06-22 10:42
Update on mingw: When I comment out the Py_SetPath() function call, then the code runs up to the 4th test print and then crashes again, possibly at: "Py_XDECREF(pArgs)". So apart from the 'encoding' module that cannot be found there is still a crash. I installed Python 3.4.1 again for this.
BTW: The multiply.py runs fine when called with "py -3" directly.

>>Output:
C:\Development\xxx\Testo1\Snakes\Release>Snakes.exe multiply multiply 3 2
Number of arguments 5
Will compute 3 times 2
Result:  6
***Test1***Test2***Test3Will compute 3 times 2
***Test4
msg221254 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2014-06-22 14:09
Pat Le Cat: Please focus on one issue at a time. I'm tempted to close this issue as "works for me", and let you start over reporting one single issue that we then try to resolve.

In any case, ignore python3.dll. It's meant for a different use case than yours.

As for your initial report: Please report the exact version of mingw64 that you have been using, and the exact command line that you were trying to use.
msg221257 - (view) Author: Pat Le Cat (Pat.Le.Cat) Date: 2014-06-22 15:00
Yes I'm sorry, this evolved as I investigated further. So the initial case has become this:

Bug:
Python 3.4 Windows installation contains python34.dll but does not install it. Both: python-3.4.1.amd64.msi and python-3.4.0.amd64.msi (maybe the 32bit too?)

Negligence:
Documentation should mention that to embed Python it is necessary to use python34.dll (at least under Windows) and that with MingW one can directly link to the DLL and doesn't need an .a file.
msg221258 - (view) Author: Pat Le Cat (Pat.Le.Cat) Date: 2014-06-22 15:06
Plus the MSVC-2013 compiler warning noted earlier of course:

>>Warning:
1>c:\python34\include\pymath.h(22): warning C4273: 'round' : inconsistent dll linkage
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\math.h(516) : see previous definition of 'round'
msg221264 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2014-06-22 15:55
Your report is difficult to believe, since it would mean that Python 3.4 cannot work at all, for anybody. We would have received hundreds of reports if this was actually true.

I just tried again, and it indeed correctly installed python34.dll:

C:\>dir c:\Windows\System32\python34.dll
 Datenträger in Laufwerk C: ist Packard Bell
 Volumeseriennummer: 7AFF-FF59

 Verzeichnis von c:\Windows\System32

18.05.2014  10:45         4.047.872 python34.dll
               1 Datei(en),      4.047.872 Bytes

Closing this as "works for me". You may reopen it if you insist that it didn't install python34.dll on your system. If you want to report a different issue, please open a new one. If you need help in your Python project, please contact one of the Python support forums, such as python-list@python.org.
msg221268 - (view) Author: Pat Le Cat (Pat.Le.Cat) Date: 2014-06-22 16:08
Ah it installs it in Windows/Sytem32 okay I had no clue, another undocumented behavior :)

Still it is missing in the DLLs folder. And you haven't explained the warning under MSVC. And the documentation should be enhanced as I suggested to be more clear.
msg221269 - (view) Author: Pat Le Cat (Pat.Le.Cat) Date: 2014-06-22 16:10
Well?
msg221273 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2014-06-22 16:38
The issue you have reported is that python34.dll is not being installed. I  closed this report as invalid (and will reclose it again now). That the DLL isn't installed into the DLLs folder is by design: it either installs into system32, or into the DLLs folder. It would be harmful to install it twice.

If you have another issue to report, please submit a new bug report. One issue at a time, please. When reporting a documentation bug, please also include in the report which documentation you have been looking at. Preferably propose a specific wording for a specific section you want to see changed.
msg221275 - (view) Author: Pat Le Cat (Pat.Le.Cat) Date: 2014-06-22 16:40
Cheesas you are really making it hard by design to report things to Python. Maybe a bit more common sense could help the project, or should I file a new bug-report for that too?  :-/
History
Date User Action Args
2022-04-11 14:58:05adminsetgithub: 65998
2014-06-22 16:40:45Pat.Le.Catsetresolution: works for me -> rejected
messages: + msg221275
2014-06-22 16:38:09loewissetstatus: open -> closed
resolution: works for me
messages: + msg221273
2014-06-22 16:10:23Pat.Le.Catsetstatus: closed -> open
resolution: works for me -> (no value)
messages: + msg221269
2014-06-22 16:08:19Pat.Le.Catsetmessages: + msg221268
2014-06-22 15:56:34loewissettitle: Py_SetPath() gives compile error: undefined reference to '__imp_Py_SetPath' -> python34.dll is not installed
2014-06-22 15:55:42loewissetstatus: open -> closed
resolution: works for me
messages: + msg221264
2014-06-22 15:06:08Pat.Le.Catsetmessages: + msg221258
2014-06-22 15:00:19Pat.Le.Catsetmessages: + msg221257
2014-06-22 14:09:33loewissetmessages: + msg221254
2014-06-22 13:48:09pitrousetnosy: + loewis, tim.golden, zach.ware, steve.dower
2014-06-22 10:42:02Pat.Le.Catsetmessages: + msg221245
2014-06-22 09:45:19Pat.Le.Catsetmessages: + msg221240
2014-06-22 08:48:26Pat.Le.Catsetfiles: + SnakesTest.cpp

messages: + msg221234
2014-06-17 21:53:58Pat.Le.Catcreate