lemi57ssss
lemi57ssss

Reputation: 1380

PyPi package vmprof fails to install on a 64 bit Windows 7 machine

I'd appreciate some help with the diagnosis.

The error messages either point to the possibility that this package cannot be installed on a 64 bit machine or the wrong compiler is being selected.

Edit: The requirements for vmprof state that it will only run on x86 (32 bit). It's clear that the C compiler ought to be instructed into compiling the source into 32 bit. Does that point to a shortfall in the vmprof packaging which should be raised as a vmprof issue?
End edit.

Either way, I don't know how to solve that problem. I am running pip install vmprof from the command line.

warning C4311: This warning detects 64-bit pointer truncation issues.

warning C4312: This warning detects an attempt to assign a 32-bit value to a 64-bit pointer type

These two warnings lead me to wonder if PyPi cannot install vmprof into my 64 bit environment. However, if the presented error output is ordered by time, then it appears that Visual Studio was loaded after these warnings were generated. Could this point to the wrong compiler being used? I do have a large set of Microsoft Visual C++ YYYY Redistributable from 2005 onwards for 32 and 64 bits. (I'm reluctant to test the wrong compiler theory by uninstalling older versions in case that breaks something.)

PyPi says it tried to load Microsoft Visual Studio v14.0 which I believe to be the correct version for Python 3.5.

There are other SO questions relating to the warning, "manifest_maker: standard file '-c' not found" My setuptools is fully up to date. (v 25.0.0). vmprof is not available as a prebuilt binary from the link suggested. In any case, all of the binaries there are unsupported. Other SO questions on this warning pertain to Unix.

warning LNK4197: export 'PyInit__vmprof' specified multiple times; using first specification. This is the point at which the build finally seemed to go off the rails. I'm guessing the multiple specification of "export 'PyInit__vmprof'" is inside a command file supplied as part of vmprof.

error LNK2001: unresolved external symbol _PyThreadState_Current build\lib.win-amd64-3.5_vmprof.cp35-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals.

And here it crashed with a link error. The full pip install output follows.

Installing collected packages: requests, vmprof

  Running setup.py install for vmprof error

    Complete output from command d:\python35\python.exe -u -c "import setuptools, tokenize;__file__='D:\\Users\\Stephen\

\AppData\\Local\\Temp\\pip-build-dpjo8j82\\vmprof\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read

().replace('\r\n', '\n'), __file__, 'exec'))" install --record D:\Users\Stephen\AppData\Local\Temp\pip-kfygn2le-record\i

nstall-record.txt --single-version-externally-managed --compile:

    running install

    running build

    running build_py

    creating build

    creating build\lib.win-amd64-3.5

    creating build\lib.win-amd64-3.5\tests

    copying tests\cpuburn.py -> build\lib.win-amd64-3.5\tests

    copying tests\test_config.py -> build\lib.win-amd64-3.5\tests

    copying tests\test_reader.py -> build\lib.win-amd64-3.5\tests

    copying tests\test_run.py -> build\lib.win-amd64-3.5\tests

    copying tests\test_stats.py -> build\lib.win-amd64-3.5\tests

    copying tests\__init__.py -> build\lib.win-amd64-3.5\tests

    creating build\lib.win-amd64-3.5\vmprof

    copying vmprof\binary.py -> build\lib.win-amd64-3.5\vmprof

    copying vmprof\cli.py -> build\lib.win-amd64-3.5\vmprof

    copying vmprof\profiler.py -> build\lib.win-amd64-3.5\vmprof

    copying vmprof\reader.py -> build\lib.win-amd64-3.5\vmprof

    copying vmprof\show.py -> build\lib.win-amd64-3.5\vmprof

    copying vmprof\stats.py -> build\lib.win-amd64-3.5\vmprof

    copying vmprof\upload.py -> build\lib.win-amd64-3.5\vmprof

    copying vmprof\vmprofdemo.py -> build\lib.win-amd64-3.5\vmprof

    copying vmprof\__init__.py -> build\lib.win-amd64-3.5\vmprof

    copying vmprof\__main__.py -> build\lib.win-amd64-3.5\vmprof

    creating build\lib.win-amd64-3.5\vmprof\log

    copying vmprof\log\constants.py -> build\lib.win-amd64-3.5\vmprof\log

    copying vmprof\log\marks.py -> build\lib.win-amd64-3.5\vmprof\log

    copying vmprof\log\merge_point.py -> build\lib.win-amd64-3.5\vmprof\log

    copying vmprof\log\objects.py -> build\lib.win-amd64-3.5\vmprof\log

    copying vmprof\log\parser.py -> build\lib.win-amd64-3.5\vmprof\log

    copying vmprof\log\__init__.py -> build\lib.win-amd64-3.5\vmprof\log

    running egg_info

    writing entry points to vmprof.egg-info\entry_points.txt

    writing requirements to vmprof.egg-info\requires.txt

    writing dependency_links to vmprof.egg-info\dependency_links.txt

    writing top-level names to vmprof.egg-info\top_level.txt

    writing vmprof.egg-info\PKG-INFO

    warning: manifest_maker: standard file '-c' not found



    reading manifest file 'vmprof.egg-info\SOURCES.txt'

    reading manifest template 'MANIFEST.in'

    writing manifest file 'vmprof.egg-info\SOURCES.txt'

    running build_ext

    building '_vmprof' extension

    creating build\temp.win-amd64-3.5

    creating build\temp.win-amd64-3.5\Release

    creating build\temp.win-amd64-3.5\Release\src

    D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Id:

\python35\include -Id:\python35\include "-ID:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-ID:\Program

 Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-ID:\Program Files (x86)\Windows Kits\8.1\include\shared" "-ID:

\Program Files (x86)\Windows Kits\8.1\include\um" "-ID:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tcsrc/_vmpr

of.c /Fobuild\temp.win-amd64-3.5\Release\src/_vmprof.obj

    _vmprof.c

    d:\users\stephen\appdata\local\temp\pip-build-dpjo8j82\vmprof\src\vmprof_common.h(67): warning C4311: 'type cast': p

ointer truncation from 'PyCodeObject *' to 'unsigned long'

    d:\users\stephen\appdata\local\temp\pip-build-dpjo8j82\vmprof\src\vmprof_common.h(67): warning C4312: 'type cast': c

onversion from 'unsigned long' to 'void *' of greater size

    d:\users\stephen\appdata\local\temp\pip-build-dpjo8j82\vmprof\src\vmprof_common.h(96): warning C4267: '=': conversio

n from 'size_t' to 'char', possible loss of data

    d:\users\stephen\appdata\local\temp\pip-build-dpjo8j82\vmprof\src\vmprof_main_win32.h(31): warning C4267: 'function'

: conversion from 'size_t' to 'unsigned int', possible loss of data

    d:\users\stephen\appdata\local\temp\pip-build-dpjo8j82\vmprof\src\vmprof_main_win32.h(48): warning C4267: 'initializ

ing': conversion from 'size_t' to 'int', possible loss of data

    d:\users\stephen\appdata\local\temp\pip-build-dpjo8j82\vmprof\src\vmprof_main_win32.h(72): warning C4312: 'type cast

': conversion from 'DWORD' to 'void *' of greater size

    src/_vmprof.c(42): warning C4311: 'type cast': pointer truncation from 'PyCodeObject *' to 'unsigned long'

    src/_vmprof.c(42): warning C4312: 'type cast': conversion from 'unsigned long' to 'void *' of greater size

    src/_vmprof.c(69): warning C4311: 'type cast': pointer truncation from 'PyCodeObject *' to 'unsigned long'

    D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MA

NIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:d:\python35\libs /LIBPATH:d:\python35\PCbuild\amd64 "/LIBPATH:D:\Program File

s (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:D:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucr

t\x64" "/LIBPATH:D:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" /EXPORT:PyInit__vmprof build\temp.win-amd64

-3.5\Release\src/_vmprof.obj /OUT:build\lib.win-amd64-3.5\_vmprof.cp35-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.5\Re

lease\src\_vmprof.cp35-win_amd64.lib

    _vmprof.obj : warning LNK4197: pip specified multiple times; using first specification

       Creating library build\temp.win-amd64-3.5\Release\src\_vmprof.cp35-win_amd64.lib and object build\temp.win-amd64-

3.5\Release\src\_vmprof.cp35-win_amd64.exp

    _vmprof.obj : error LNK2001: unresolved external symbol _PyThreadState_Current

    build\lib.win-amd64-3.5\_vmprof.cp35-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals

    error: command 'D:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exi

t status 1120

Upvotes: 0

Views: 428

Answers (2)

divenex
divenex

Reputation: 17218

Finally, vmprof from v0.4 officially supports 64bit Windows

See the closed GitHub Issue

Upvotes: 0

lemi57ssss
lemi57ssss

Reputation: 1380

This is an issue on vmprof's github repository which is unfixed at 8/23/2016.

Upvotes: 2

Related Questions