question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Install into a virtual environment or using pyenv?

See original GitHub issue

First off, I’m trying to install this on a Mac so I’m having to jump through four thousand different hoops to even get that working. So far I have been unsuccessful.

I think that part of the problem is that I am trying to install into a virtual environment, specifically one using pyenv. The problem with this seems to be that all of the Mac installation scripts seem to assume your python binary is located at python3.5 if you are using python version 3.5, or that your python was installed by homebrew. Is there any support for a different type of Python installation? I don’t know of a professional Python developer that doesn’t use virtual environments but I guess there must be some as I seem to be the first one reporting this issue.

  • OS and version used: macOS 10.13.15

  • Python runtime used: 3.5.5

Console output after running a modified build.sh. The modifications were mostly just setting the correct python executable and version numbers in the script, and also removing the last few lines that try to run the example code

~/Desktop/azure-iot-sdk-python/c/cmake/iotsdk_mac ~/Desktop/azure-iot-sdk-python
-- The C compiler identification is AppleClang 9.1.0.9020039
-- The CXX compiler identification is AppleClang 9.1.0.9020039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- IoT Client SDK Version = 1.2.5
-- Provisioning client OFF
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for include file stdbool.h
-- Looking for include file stdbool.h - found
-- target architecture: x86_64
-- Performing Test CXX_FLAG_CXX11
-- Performing Test CXX_FLAG_CXX11 - Success
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'libcurl'
--   Found libcurl, version 7.49.1
-- Found CURL: curl  
-- target architecture: x86_64
-- target architecture: x86_64
-- target architecture: x86_64
-- target architecture: x86_64
-- iothub architecture: x86_64
CMake Warning at /usr/local/Cellar/cmake/3.10.2/share/cmake/Modules/FindBoost.cmake:801 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.10.2/share/cmake/Modules/FindBoost.cmake:907 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/Cellar/cmake/3.10.2/share/cmake/Modules/FindBoost.cmake:1542 (_Boost_MISSING_DEPENDENCIES)
  /Users/matt/Desktop/azure-iot-sdk-python/device/iothub_client_python/CMakeLists.txt:42 (find_package)


CMake Warning at /usr/local/Cellar/cmake/3.10.2/share/cmake/Modules/FindBoost.cmake:1610 (message):
  No header defined for python35; skipping header check
Call Stack (most recent call first):
  /Users/matt/Desktop/azure-iot-sdk-python/device/iothub_client_python/CMakeLists.txt:42 (find_package)


-- Could NOT find Boost
CMake Error at /Users/matt/Desktop/azure-iot-sdk-python/device/iothub_client_python/CMakeLists.txt:44 (string):
  string sub-command REPLACE requires at least four arguments.


-- Found PythonLibs: /Users/matt/.pyenv/versions/3.5.4/lib/libpython3.5m.dylib (found suitable version "3.5.4", minimum required is "3.5") 
CMake Warning at /usr/local/Cellar/cmake/3.10.2/share/cmake/Modules/FindBoost.cmake:801 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.10.2/share/cmake/Modules/FindBoost.cmake:907 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/Cellar/cmake/3.10.2/share/cmake/Modules/FindBoost.cmake:1542 (_Boost_MISSING_DEPENDENCIES)
  /Users/matt/Desktop/azure-iot-sdk-python/service/CMakeLists.txt:42 (find_package)


CMake Warning at /usr/local/Cellar/cmake/3.10.2/share/cmake/Modules/FindBoost.cmake:1610 (message):
  No header defined for python35; skipping header check
Call Stack (most recent call first):
  /Users/matt/Desktop/azure-iot-sdk-python/service/CMakeLists.txt:42 (find_package)


-- Could NOT find Boost
CMake Error at /Users/matt/Desktop/azure-iot-sdk-python/service/CMakeLists.txt:44 (string):
  string sub-command REPLACE requires at least four arguments.


-- Configuring incomplete, errors occurred!
See also "/Users/matt/Desktop/azure-iot-sdk-python/c/cmake/iotsdk_mac/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found.  Stop.
Test project /Users/matt/Desktop/azure-iot-sdk-python/c/cmake/iotsdk_mac
No tests were found!!!
~/Desktop/azure-iot-sdk-python
copy iothub_client library to samples folder
cp: /Users/matt/Desktop/azure-iot-sdk-python/c/cmake/iotsdk_mac/python/src/iothub_client.dylib: No such file or directory
copy iothub_client_mock library to tests folder
cp: /Users/matt/Desktop/azure-iot-sdk-python/c/cmake/iotsdk_mac/python/test/iothub_client_mock.dylib: No such file or directory
cp: /Users/matt/Desktop/azure-iot-sdk-python/c/cmake/iotsdk_mac/python/src/iothub_client.dylib: No such file or directory
cp: /Users/matt/Desktop/azure-iot-sdk-python/c/cmake/iotsdk_mac/python_service_client/src/iothub_service_client.dylib: No such file or directory
copy iothub_service_client library to samples folder
cp: /Users/matt/Desktop/azure-iot-sdk-python/c/cmake/iotsdk_mac/python_service_client/src/iothub_service_client.dylib: No such file or directory
copy iothub_service_client_mock library to tests folder
cp: /Users/matt/Desktop/azure-iot-sdk-python/c/cmake/iotsdk_mac/python_service_client/tests/iothub_service_client_mock.dylib: No such file or directory
cp: /Users/matt/Desktop/azure-iot-sdk-python/c/cmake/iotsdk_mac/python_service_client/src/iothub_service_client.dylib: No such file or directory
cp: /Users/matt/Desktop/azure-iot-sdk-python/c/cmake/iotsdk_mac/python/src/iothub_client.dylib: No such file or directory
copy provisioning_device_client library to samples folder
cp: /Users/matt/Desktop/azure-iot-sdk-python/c/cmake/iotsdk_mac/provisioning_device_client_python/src/provisioning_device_client.dylib: No such file or directory
copy provisioning_device_client_mock library to tests folder
cp: /Users/matt/Desktop/azure-iot-sdk-python/c/cmake/iotsdk_mac/provisioning_device_client_python/tests/provisioning_device_client_mock.dylib: No such file or directory
cp: /Users/matt/Desktop/azure-iot-sdk-python/c/cmake/iotsdk_mac/provisioning_device_client_python/src/provisioning_device_client.dylib: No such file or directory

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mattdodgecommented, Jul 13, 2018

Ok, I’m getting really close with this. Here are some steps that I’ve run to make progres

  1. Activate your virtualenv/pyenv
  2. Download boost source
  3. Edit the tools/build/example/user-config.jam file, make the last line look more like this. The key is to tell it to look in python3.5m if you are using python 3 or higher, not python3.5. Again, YMMV with this line
using python : 3.5 : /Users/matt/.pyenv/shims/python : /Users/matt/.pyenv/versions/3.5.4/include/python3.5m : /usr/lib ;
  1. I still had to symlink python3.5m to python3.5 in the include directory, couldn’t figure out where boost was pointing to that
ln -s ~/.pyenv/versions/3.5.4/include/python3.5m ~/.pyenv/versions/3.5.4/include/python3.5
  1. Install boost
./bootstrap.sh --with-python=`which python` --with-python-version=3.5 --with-python-root=`python-config --prefix`
./b2
  1. Now, time to get the Azure SDK installed. Do not run the setup.sh script - that just installs boost which we’ve already done. I’m running a slightly modified build.sh from your branch @pierreca, basically with hard-coded Python directories. If I can actually get it to work I’ll try to clean it up and make a PR

Right now I’m about 88% through the build process, it fails here:

[ 83%] Built target iothub_client_mqtt_transport
[ 83%] Built target prov_auth_client
[ 84%] Building C object provisioning_service_client/CMakeFiles/provisioning_service_client.dir/src/provisioning_service_client.c.o
[ 84%] Building C object iothub_service_client/CMakeFiles/iothub_service_client.dir/src/iothub_devicemethod.c.o
[ 85%] Building C object iothub_service_client/CMakeFiles/iothub_service_client.dir/src/iothub_devicetwin.c.o
[ 85%] Building C object iothub_service_client/CMakeFiles/iothub_service_client.dir/src/iothub_messaging.c.o
[ 86%] Building C object iothub_service_client/CMakeFiles/iothub_service_client.dir/src/iothub_messaging_ll.c.o
[ 86%] Building C object iothub_service_client/CMakeFiles/iothub_service_client.dir/src/iothub_registrymanager.c.o
[ 87%] Building C object iothub_service_client/CMakeFiles/iothub_service_client.dir/src/iothub_sc_version.c.o
[ 87%] Building C object iothub_service_client/CMakeFiles/iothub_service_client.dir/src/iothub_service_client_auth.c.o
[ 88%] Building C object iothub_service_client/CMakeFiles/iothub_service_client.dir/__/iothub_client/src/iothub_message.c.o
[ 88%] Linking C static library libprovisioning_service_client.a
[ 88%] Built target provisioning_service_client
[ 88%] Linking C static library libiothub_service_client.a
[ 88%] Built target iothub_service_client
make[1]: *** [python_service_client/tests/CMakeFiles/iothub_service_client_mock.dir/all] Error 2
make: *** [all] Error 2

One thing I’ve noticed though is that I keep encountering cmake cache issues. I’ve run cmake probably 1,000 times at this point with different combinations. @pierreca do you know of a way to “clean” the cache? I’ve been removing CMakeCache.txt files but that doesn’t seem to clear it 100%.

These posts/questions/gists were helpful in me figuring this out, hopefully these steps can help someone else as well:

0reactions
az-iot-builder-01commented, Dec 18, 2019

@mattdodge, @harmv, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating virtual environments with Pyenv
Install Pyenv. On my Mac, I install pyenv & its sister project pyenv-virtualenv with Homebrew: · Install Python using Pyenv · Create day-to-day ......
Read more >
Managing virtual environments with pyenv
pyenv is an extension to virtualenv that adds a few more benefits: possibility to install several Python interpret version next to each ...
Read more >
How to use properly Pyenv and venv? - Stack Overflow
Every virtual environment "lives" in its own folder. All packages you install will go there, especially if every environment will have a ...
Read more >
a pyenv plugin to manage virtualenv (a.k.a. python ... - GitHub
macOS users can install pyenv-virtualenv with the Homebrew package manager. This will give you access to the pyenv-virtualenv command. If you have pyenv...
Read more >
Using pyenv and pyenv-virtualenv to install Python and create ...
Using pyenv and pyenv-virtualenv to install Python and create a virtual environment on MacOS · Make sure you have the required packages installed....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found