Azure-sdk-for-python: Can't install azure-eventhub error

Created on 2 Dec 2019  路  13Comments  路  Source: Azure/azure-sdk-for-python

I'm attempting to install the azure-eventhub using 'pip install --pre azure-eventhub' and I get the following error when attempting to install.

CMake Error at CMakeLists.txt:5 (project):
  Generator

    Visual Studio 15 2017

  could not find any instance of Visual Studio.

pip-install-error.txt

Client Event Hubs customer-reported

All 13 comments

...and no... I don't want to install Visual Studio.

I'm having the same issue. But I have VS19 professional installed. Even tried install CMake and setting it in the PATH but still I'm not able to install azure-eventhub.

I didn't install Visual Studio but I did install the VS 2017 Build Tools. And I do have CMake installed and in the path. Still it won't install...

Thanks @msftkevin, @gurkang,
This error I believe is coming from a dependency library uamqp.
It looks like pip is attempting to build the library from source on install - hence why it is looking for a compiler like VS. I think this should only happen if pip was installing onto a platform that was not supported with a wheel, or pip was configured to always build from source.

These are the wheels for uamqp here:
https://pypi.org/project/uamqp/#files
If you download the wheel for your environment directly, and attempt to install does it still give you an error? (Just trying to narrow down potential causes).

I initially attempted to install the package (azure-eventhub) without the --pre option. Could that be the issue?

Thanks @msftkevin - I don't think so, as I think they depend on the same version of uamqp.
However uamqp does not yet have a pre-built wheel for Python 3.8 - can I confirm whether you're using Python 3.8?

@annatisch
I'm using Python 3.8.0 when trying to install azure-eventhub.

Hello @gurkang and @msftkevin ,

we released uamqp 1.2.4 which contains pre-built python3.8 wheels, please have a try.
https://pypi.org/project/uamqp/1.2.4/

Still having issues:

    Running setup.py install for uamqp ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\sesegu\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\SESEGU\\AppData\\Local\\Temp\\pip-install-2np7_mwh\\uamqp\\setup.py'"'"'; __file__='"'"'C:\\Users\\SESEGU\\AppData\\Local\\Temp\\pip-install-2np7_mwh\\uamqp\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\SESEGU\AppData\Local\Temp\pip-record-ktvyweiq\install-record.txt' --single-version-externally-managed --compile
         cwd: C:\Users\SESEGU\AppData\Local\Temp\pip-install-2np7_mwh\uamqp\
    Complete output (93 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.8
    creating build\lib.win32-3.8\uamqp
    copying uamqp\address.py -> build\lib.win32-3.8\uamqp
    copying uamqp\client.py -> build\lib.win32-3.8\uamqp
    copying uamqp\compat.py -> build\lib.win32-3.8\uamqp
    copying uamqp\connection.py -> build\lib.win32-3.8\uamqp
    copying uamqp\constants.py -> build\lib.win32-3.8\uamqp
    copying uamqp\errors.py -> build\lib.win32-3.8\uamqp
    copying uamqp\message.py -> build\lib.win32-3.8\uamqp
    copying uamqp\mgmt_operation.py -> build\lib.win32-3.8\uamqp
    copying uamqp\receiver.py -> build\lib.win32-3.8\uamqp
    copying uamqp\sender.py -> build\lib.win32-3.8\uamqp
    copying uamqp\session.py -> build\lib.win32-3.8\uamqp
    copying uamqp\types.py -> build\lib.win32-3.8\uamqp
    copying uamqp\utils.py -> build\lib.win32-3.8\uamqp
    copying uamqp\__init__.py -> build\lib.win32-3.8\uamqp
    creating build\lib.win32-3.8\uamqp\async_ops
    copying uamqp\async_ops\client_async.py -> build\lib.win32-3.8\uamqp\async_ops
    copying uamqp\async_ops\connection_async.py -> build\lib.win32-3.8\uamqp\async_ops
    copying uamqp\async_ops\mgmt_operation_async.py -> build\lib.win32-3.8\uamqp\async_ops
    copying uamqp\async_ops\receiver_async.py -> build\lib.win32-3.8\uamqp\async_ops
    copying uamqp\async_ops\sender_async.py -> build\lib.win32-3.8\uamqp\async_ops
    copying uamqp\async_ops\session_async.py -> build\lib.win32-3.8\uamqp\async_ops
    copying uamqp\async_ops\__init__.py -> build\lib.win32-3.8\uamqp\async_ops
    creating build\lib.win32-3.8\uamqp\authentication
    copying uamqp\authentication\cbs_auth.py -> build\lib.win32-3.8\uamqp\authentication
    copying uamqp\authentication\cbs_auth_async.py -> build\lib.win32-3.8\uamqp\authentication
    copying uamqp\authentication\common.py -> build\lib.win32-3.8\uamqp\authentication
    copying uamqp\authentication\__init__.py -> build\lib.win32-3.8\uamqp\authentication
    running egg_info
    writing uamqp.egg-info\PKG-INFO
    writing dependency_links to uamqp.egg-info\dependency_links.txt
    writing requirements to uamqp.egg-info\requires.txt
    writing top-level names to uamqp.egg-info\top_level.txt
    reading manifest file 'uamqp.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'uamqp.egg-info\SOURCES.txt'
    copying uamqp\c_uamqp.c -> build\lib.win32-3.8\uamqp
    running build_ext
    will build uamqp in build\temp.win32-3.8\Release/cmake
    Building with generator: Visual Studio 14 2015
    calling cmake C:\Users\SESEGU\AppData\Local\Temp\pip-install-2np7_mwh\uamqp/src/vendor/azure-uamqp-c/ -G "Visual Studio 14 2015" -Duse_openssl:bool=OFF -Duse_default_uuid:bool=ON  -Duse_builtin_httpapi:bool=ON  -Dskip_samples:bool=ON -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release
    -- Selecting Windows SDK version  to target Windows 10.0.17763.
    CMake Error at CMakeLists.txt:5 (project):
      Failed to run MSBuild command:

        MSBuild.exe

      to get the value of VCTargetsPath:

        The system cannot find the file specified



    -- Configuring incomplete, errors occurred!
    See also "C:/Users/SESEGU/AppData/Local/Temp/pip-install-2np7_mwh/uamqp/build/temp.win32-3.8/Release/cmake/CMakeFiles/CMakeOutput.log".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\SESEGU\AppData\Local\Temp\pip-install-2np7_mwh\uamqp\setup.py", line 292, in <module>
        setup(
      File "c:\users\sesegu\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "c:\users\sesegu\appdata\local\programs\python\python38-32\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "c:\users\sesegu\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "c:\users\sesegu\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "c:\users\sesegu\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "c:\users\sesegu\appdata\local\programs\python\python38-32\lib\distutils\command\install.py", line 545, in run
        self.run_command('build')
      File "c:\users\sesegu\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\users\sesegu\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "c:\users\sesegu\appdata\local\programs\python\python38-32\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "c:\users\sesegu\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\users\sesegu\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\SESEGU\AppData\Local\Temp\pip-install-2np7_mwh\uamqp\setup.py", line 167, in run
        self.build_cmake(ext)
      File "C:\Users\SESEGU\AppData\Local\Temp\pip-install-2np7_mwh\uamqp\setup.py", line 215, in build_cmake
        subprocess.check_call(joined_cmd, shell=True, universal_newlines=True, env=build_env)
      File "c:\users\sesegu\appdata\local\programs\python\python38-32\lib\subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command 'cmake C:\Users\SESEGU\AppData\Local\Temp\pip-install-2np7_mwh\uamqp/src/vendor/azure-uamqp-c/ -G "Visual Studio 14 2015" -Duse_openssl:bool=OFF -Duse_default_uuid:bool=ON  -Duse_builtin_httpapi:bool=ON  -Dskip_samples:bool=ON -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release' returned non-zero exit status 1.
    ----------------------------------------
  Rolling back uninstall of uamqp
  Moving to c:\users\sesegu\appdata\local\programs\python\python38-32\lib\site-packages\uamqp-1.2.4.dist-info\
   from C:\Users\SESEGU\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\~amqp-1.2.4.dist-info
  Moving to c:\users\sesegu\appdata\local\programs\python\python38-32\lib\site-packages\uamqp\
   from C:\Users\SESEGU\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\~amqp
ERROR: Command errored out with exit status 1: 'c:\users\sesegu\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\SESEGU\\AppData\\Local\\Temp\\pip-install-2np7_mwh\\uamqp\\setup.py'"'"'; __file__='"'"'C:\\Users\\SESEGU\\AppData\\Local\\Temp\\pip-install-2np7_mwh\\uamqp\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\SESEGU\AppData\Local\Temp\pip-record-ktvyweiq\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

Thanks @gurkang - could you try downloading and installing the 32bit Windows wheel for uamqp directly in a clean virtual environment? This will help us determine if there's an issue with the package itself, or whether something else is going wrong.
https://pypi.org/project/uamqp/#files

Hi @gurkang,

can you try manually running the command pip install uamqp to get the latest uamqp library installed from pypi?

The problem should be fixed as pre-built uamqp wheel for python3.8 platforms are released.
@gurkang Feel free to re-open it if not.

Thanks for working with Microsoft on GitHub! Tell us how you feel about your experience using the reactions on this comment.

Was this page helpful?
0 / 5 - 0 ratings