Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS Support #2

Closed
2 tasks done
TylerGubala opened this issue Apr 28, 2018 · 87 comments
Closed
2 tasks done

MacOS Support #2

TylerGubala opened this issue Apr 28, 2018 · 87 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@TylerGubala
Copy link
Owner

TylerGubala commented Apr 28, 2018

Right now MacOS has not even been tested... not even sure if it works.

To Do:

  • Manual Build Process
  • Automated Build Process
@compmonks
Copy link

Hello TylerGubala,
I am trying to install your module trhough pip on Mac Os and here is the error log it returns:

(py35) My-MacBook-Pro:~ user$ pip install bpy==1.2.1
Collecting bpy==1.2.1
  Using cached https://files.pythonhosted.org/packages/5d/03/9896a05aac246d3a46b1a49c1eb796a51ecc4e0ae30e9e7c5d52cbc52662/bpy-1.2.1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/rx/jrwl4r0954j64xckyxrr7crw0000gn/T/pip-install-0_3jvd1e/bpy/setup.py", line 88
        self.announce(f"Cloning Blender source from {BLENDER_GIT_REPO_URL}...",
                                                                             ^
    SyntaxError: invalid syntax
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/rx/jrwl4r0954j64xckyxrr7crw0000gn/T/pip-install-0_3jvd1e/bpy/

It is run with python 3.5 and mac os High sierra 10.13.5
Hope it helps

@TylerGubala
Copy link
Owner Author

TylerGubala commented Jul 19, 2018

Thanks, that does definately help; and I am sorry because I run a more recent version of Python (3.6.5).

I actually didn't realize f-string interpolation (what I believe the interpriter is complaining about there) was such a recent addition to Python (3.6 era).

If you replace the "f-strings" (strings that look like f"Hello, {user_name}!") with their string.format equivalent, it should stop complaining about invalid syntax for those lines..

I will make the modifications to the code when I am back at my home; currently I am busy with travel work. I'll make some modifications this weekend.

Thanks for your patience.

@TylerGubala TylerGubala added enhancement New feature or request help wanted Extra attention is needed labels Jul 28, 2018
@TylerGubala
Copy link
Owner Author

TylerGubala commented Aug 2, 2018

Just so you are aware, I didn't just forget about your issue, though what you've listed here isn't so much a MacOS support issue as it is a Python version < 3.6 support issue.

#11

I've opened a new issue related to that, because I seem to have stumbled upon a nice little repo that will clean up the fstrings nicely for users who don't want to upgrade to >=3.6, called future-fstrings.

If using that technology doesn't remedy the issue, I'll just use string.format()

In either case I'm going to start supplying bdist_wheels next week after I finish out a work trip, but I'll still need help generating those on the MacOS side of things. Keep you posted!

@TylerGubala
Copy link
Owner Author

Provided you install future-fstrings as a developer dependancy, you should not recieve the syntax error once I merge the fix fstrings branch.

@TylerGubala
Copy link
Owner Author

I just merged the Fix fstrings branch, feel free to test out the new version when you have the time, provided you have installed the latest version of future-fstrings

@loukotal
Copy link

Hi Tyler!
I am currently trying to install your library on MacOS (High Sierra version 10.13.5).

Firstly, I had to install future-fstrings even though I am running python 3.6.6.
Next, when running pip install bpy I get these errors:
screen shot 2018-09-19 at 13 31 47
screen shot 2018-09-19 at 13 32 21

Any advice or pointers on how to proceed would be helpful.

Thank you!

@TylerGubala
Copy link
Owner Author

TylerGubala commented Sep 19, 2018

@loukotal Looks like I need to add a line to checkout the MacOS svn repo. I'll have to add that to the list of requirements for Mac users, but unfortunately, being that I don't have a Mac, and since Travis doesn't officially support MacOS with Python, it's a little difficult for me to pin down the build process there.

Could you download svn (not sure if that comes with "X Code development tools" or not), enter a terminal and cd /Users/lukasloukota/.blenderpy/blender then make update?

Please note this is an exerpt from the official "Building Blender - MacOS" wiki page from the Blender foundation:

https://wiki.blender.org/wiki/Building_Blender/Mac

Regarding the need to install future-fstrings despite being on Python 3.6... yes I suppose that makes sense! It is looking for future-fstrings for the encoding codec. Since I have not been able to get the builds for Mac (I don't have a mac to build on, and have lots more research to do on travis before feeling comfortable with it), you had to perform the installation with the Python build script sources. Were there a bdist_wheel available for Mac from pypi you wouldn't have needed the future-fstrings installation. I'll try to make this cleaner when I have the time, and thank you for your patience!

@loukotal
Copy link

loukotal commented Sep 24, 2018

Sorry for the late reply. Thank you for your answer.

I am now again trying to pin down the problem. I ran make update as per your advice. I tried running pip install bpy after it and now I'm getting this error.
screen shot 2018-09-24 at 11 33 15

So I setup a virtualenv with python3.7 - using pyenv - to try to resolve the error Python executable missing: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m
and that didn't help either.

I tried to access /private/var/folders/c4/q75b9qkx7_51f49jzsc92d480000gn/T/pip-install-vhepdop2/bpy/build/temp.macosx-10.13-x86_64-3.7/CMakeFiles/CMakeOutput.log but there is no such file (or pip-install-vhepdop2 folder).

I can provide more information if needed.
Thank you!

PS: Sorry for taking up your time, this is still very new to me.

@TylerGubala
Copy link
Owner Author

TylerGubala commented Sep 25, 2018 via email

@TylerGubala TylerGubala self-assigned this Oct 7, 2018
@gandarez
Copy link

Having the same issue when trying to install bpy using pip for macOS Mojave.

@TylerGubala
Copy link
Owner Author

TylerGubala commented Aug 23, 2019

@gandarez Is there a gist or something that you can post? I bought a used Mac at Christmas just to test compatibility but it's bricked or something. I would like to just do the steps listed here and integrate that into my code but like above, the Mac I got doesn't work and I'm too unfamiliar to waste days and days playing with Travis CI to try and guess how it should work.

Can anyone help in this regard?

@gandarez
Copy link

@TylerGubala that's the error when executing pip install bpy in my Mac.
Screen Shot 2019-08-22 at 21 52 05

@TylerGubala
Copy link
Owner Author

@gandarez Sorry, but Python 2.7 is not supported at this time. Maybe you can try Python 3.6 and see how that works for you?

@gandarez
Copy link

My fault sorry. Should I install future_fstrings?
Screen Shot 2019-08-22 at 22 04 41

@TylerGubala
Copy link
Owner Author

TylerGubala commented Aug 23, 2019

Yes, you have to install Python version 3.6 and future-fstrings in order to start looking into this deeper.

3.7 may be workable once we figure out what the errors are in the build but 3.6 would be a better place to start since I have Windows builds for 3.6 working to compare.

Thanks much in advance!

@gandarez
Copy link

After installing future-fstrings and python 3.6.5 it got stucked at building wheel
Screen Shot 2019-08-24 at 12 11 05

Is there any way of getting the log of the process?

@gandarez
Copy link

After a while got this error:

ERROR: Command errored out with exit status 1:
   command: /usr/local/opt/python/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-855rkhbu/bpy/setup.py'"'"'; __file__='"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-855rkhbu/bpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-wheel-cfhj34pb --python-tag cp36
       cwd: /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-855rkhbu/bpy/
  Complete output (10 lines):
  running bdist_wheel
  running build
  running build_ext
  Preparing the build environment
  Cloning Blender source from git://git.blender.org/blender.git
  Updating Blender git submodules
  Configuring cmake project
  cmake -H/Users/gandarez/.blenderpy/blender -Bbuild/temp.macosx-10.13-x86_64-3.6 -DWITH_PLAYER=OFF -DWITH_PYTHON_INSTALL=OFF -DWITH_PYTHON_MODULE=ON
  unable to execute 'cmake': No such file or directory
  error: command 'cmake' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for bpy
  Running setup.py clean for bpy
Failed to build bpy
Installing collected packages: bpy
  Running setup.py install for bpy ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-855rkhbu/bpy/setup.py'"'"'; __file__='"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-855rkhbu/bpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-record-6jvo_9h7/install-record.txt --single-version-externally-managed --compile
         cwd: /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-855rkhbu/bpy/
    Complete output (10 lines):
    running install
    running build
    running build_ext
    Preparing the build environment
    Cloning Blender source from git://git.blender.org/blender.git
    Updating Blender git submodules
    Configuring cmake project
    cmake -H/Users/gandarez/.blenderpy/blender -Bbuild/temp.macosx-10.13-x86_64-3.6 -DWITH_PLAYER=OFF -DWITH_PYTHON_INSTALL=OFF -DWITH_PYTHON_MODULE=ON
    unable to execute 'cmake': No such file or directory
    error: command 'cmake' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-855rkhbu/bpy/setup.py'"'"'; __file__='"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-855rkhbu/bpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-record-6jvo_9h7/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

@gandarez
Copy link

After have installed cmakevia brew got this error:

ERROR: Command errored out with exit status 1:
   command: /usr/local/opt/python/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-54dz105s/bpy/setup.py'"'"'; __file__='"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-54dz105s/bpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-wheel-zkk_o5jf --python-tag cp36
       cwd: /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-54dz105s/bpy/
  Complete output (44 lines):
  running bdist_wheel
  running build
  running build_ext
  Preparing the build environment
  Cloning Blender source from git://git.blender.org/blender.git
  Updating Blender git submodules
  Configuring cmake project
  cmake -H/Users/gandarez/.blenderpy/blender -Bbuild/temp.macosx-10.13-x86_64-3.6 -DWITH_PLAYER=OFF -DWITH_PYTHON_INSTALL=OFF -DWITH_PYTHON_MODULE=ON
  -- The C compiler identification is AppleClang 10.0.1.10010046
  -- The CXX compiler identification is AppleClang 10.0.1.10010046
  -- 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
  2019-08-24 12:22:33.489 xcodebuild[96288:3669940] [MT] PluginLoading: Required plug-in compatibility UUID B89EAABF-783E-4EBF-80D4-A9EAC69F77F2 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/WakaTime.xcplugin' not present in DVTPlugInCompatibilityUUIDs
  2019-08-24 12:22:33.489 xcodebuild[96288:3669940] [MT] PluginLoading: Required plug-in compatibility UUID B89EAABF-783E-4EBF-80D4-A9EAC69F77F2 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
  -- Detected OS X 10.14 and Xcode 10. at /Applications/Xcode.app
  -- OSX_SYSROOT_PREFIX: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
  -- WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling WITH_DRACO for now
  -- Performing Test SUPPORT_SSE_BUILD
  -- Performing Test SUPPORT_SSE_BUILD - Success
  -- SSE Support: detected.
  -- Performing Test SUPPORT_SSE2_BUILD
  -- Performing Test SUPPORT_SSE2_BUILD - Success
  -- SSE2 Support: detected.
  -- Found Git: /usr/bin/git (found version "2.20.1 (Apple Git-117)")
  CMake Error at build_files/cmake/platform/platform_apple.cmake:38 (message):
    Mac OSX requires pre-compiled libs at:
    '/Users/gandarez/.blenderpy/blender/../lib/darwin'
  Call Stack (most recent call first):
    CMakeLists.txt:906 (include)


  -- Configuring incomplete, errors occurred!
  See also "/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-54dz105s/bpy/build/temp.macosx-10.13-x86_64-3.6/CMakeFiles/CMakeOutput.log".
  error: command 'cmake' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for bpy
  Running setup.py clean for bpy
Failed to build bpy
Installing collected packages: bpy
  Running setup.py install for bpy ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-54dz105s/bpy/setup.py'"'"'; __file__='"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-54dz105s/bpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-record-3qxx4j0e/install-record.txt --single-version-externally-managed --compile
         cwd: /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-54dz105s/bpy/
    Complete output (44 lines):
    running install
    running build
    running build_ext
    Preparing the build environment
    Cloning Blender source from git://git.blender.org/blender.git
    Updating Blender git submodules
    Configuring cmake project
    cmake -H/Users/gandarez/.blenderpy/blender -Bbuild/temp.macosx-10.13-x86_64-3.6 -DWITH_PLAYER=OFF -DWITH_PYTHON_INSTALL=OFF -DWITH_PYTHON_MODULE=ON
    -- The C compiler identification is AppleClang 10.0.1.10010046
    -- The CXX compiler identification is AppleClang 10.0.1.10010046
    -- 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
    2019-08-24 12:22:41.016 xcodebuild[96579:3670683] [MT] PluginLoading: Required plug-in compatibility UUID B89EAABF-783E-4EBF-80D4-A9EAC69F77F2 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/WakaTime.xcplugin' not present in DVTPlugInCompatibilityUUIDs
    2019-08-24 12:22:41.016 xcodebuild[96579:3670683] [MT] PluginLoading: Required plug-in compatibility UUID B89EAABF-783E-4EBF-80D4-A9EAC69F77F2 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
    -- Detected OS X 10.14 and Xcode 10. at /Applications/Xcode.app
    -- OSX_SYSROOT_PREFIX: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
    -- WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling WITH_DRACO for now
    -- Performing Test SUPPORT_SSE_BUILD
    -- Performing Test SUPPORT_SSE_BUILD - Success
    -- SSE Support: detected.
    -- Performing Test SUPPORT_SSE2_BUILD
    -- Performing Test SUPPORT_SSE2_BUILD - Success
    -- SSE2 Support: detected.
    -- Found Git: /usr/bin/git (found version "2.20.1 (Apple Git-117)")
    CMake Error at build_files/cmake/platform/platform_apple.cmake:38 (message):
      Mac OSX requires pre-compiled libs at:
      '/Users/gandarez/.blenderpy/blender/../lib/darwin'
    Call Stack (most recent call first):
      CMakeLists.txt:906 (include)


    -- Configuring incomplete, errors occurred!
    See also "/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-54dz105s/bpy/build/temp.macosx-10.13-x86_64-3.6/CMakeFiles/CMakeOutput.log".
    error: command 'cmake' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-54dz105s/bpy/setup.py'"'"'; __file__='"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-54dz105s/bpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-record-3qxx4j0e/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

@gandarez
Copy link

I had to run make update at /Users/gandarez/.blenderpy/blender and after I got this error:

ERROR: Command errored out with exit status 1:
   command: /usr/local/opt/python/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-tcseb2yd/bpy/setup.py'"'"'; __file__='"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-tcseb2yd/bpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-wheel-jj1ro_wr --python-tag cp36
       cwd: /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-tcseb2yd/bpy/
  Complete output (45 lines):
  running bdist_wheel
  running build
  running build_ext
  Preparing the build environment
  Cloning Blender source from git://git.blender.org/blender.git
  Updating Blender git submodules
  Configuring cmake project
  cmake -H/Users/gandarez/.blenderpy/blender -Bbuild/temp.macosx-10.13-x86_64-3.6 -DWITH_PLAYER=OFF -DWITH_PYTHON_INSTALL=OFF -DWITH_PYTHON_MODULE=ON
  -- The C compiler identification is AppleClang 10.0.1.10010046
  -- The CXX compiler identification is AppleClang 10.0.1.10010046
  -- 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
  2019-08-25 18:50:08.670 xcodebuild[99406:3712024] [MT] PluginLoading: Required plug-in compatibility UUID B89EAABF-783E-4EBF-80D4-A9EAC69F77F2 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/WakaTime.xcplugin' not present in DVTPlugInCompatibilityUUIDs
  2019-08-25 18:50:08.672 xcodebuild[99406:3712024] [MT] PluginLoading: Required plug-in compatibility UUID B89EAABF-783E-4EBF-80D4-A9EAC69F77F2 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
  -- Detected OS X 10.14 and Xcode 10. at /Applications/Xcode.app
  -- OSX_SYSROOT_PREFIX: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
  -- WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling WITH_DRACO for now
  -- Performing Test SUPPORT_SSE_BUILD
  -- Performing Test SUPPORT_SSE_BUILD - Success
  -- SSE Support: detected.
  -- Performing Test SUPPORT_SSE2_BUILD
  -- Performing Test SUPPORT_SSE2_BUILD - Success
  -- SSE2 Support: detected.
  -- Found Git: /usr/bin/git (found version "2.20.1 (Apple Git-117)")
  -- Found OpenAL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenAL.framework
  CMake Error at build_files/cmake/platform/platform_apple.cmake:117 (message):
    Python executable missing:
    /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m
  Call Stack (most recent call first):
    CMakeLists.txt:906 (include)


  -- Configuring incomplete, errors occurred!
  See also "/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-tcseb2yd/bpy/build/temp.macosx-10.13-x86_64-3.6/CMakeFiles/CMakeOutput.log".
  error: command 'cmake' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for bpy
  Running setup.py clean for bpy
Failed to build bpy
Installing collected packages: bpy
  Running setup.py install for bpy ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-tcseb2yd/bpy/setup.py'"'"'; __file__='"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-tcseb2yd/bpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-record-6bpjmd0d/install-record.txt --single-version-externally-managed --compile
         cwd: /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-tcseb2yd/bpy/
    Complete output (45 lines):
    running install
    running build
    running build_ext
    Preparing the build environment
    Cloning Blender source from git://git.blender.org/blender.git
    Updating Blender git submodules
    Configuring cmake project
    cmake -H/Users/gandarez/.blenderpy/blender -Bbuild/temp.macosx-10.13-x86_64-3.6 -DWITH_PLAYER=OFF -DWITH_PYTHON_INSTALL=OFF -DWITH_PYTHON_MODULE=ON
    -- The C compiler identification is AppleClang 10.0.1.10010046
    -- The CXX compiler identification is AppleClang 10.0.1.10010046
    -- 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
    2019-08-25 18:50:16.384 xcodebuild[99682:3712807] [MT] PluginLoading: Required plug-in compatibility UUID B89EAABF-783E-4EBF-80D4-A9EAC69F77F2 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/WakaTime.xcplugin' not present in DVTPlugInCompatibilityUUIDs
    2019-08-25 18:50:16.384 xcodebuild[99682:3712807] [MT] PluginLoading: Required plug-in compatibility UUID B89EAABF-783E-4EBF-80D4-A9EAC69F77F2 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
    -- Detected OS X 10.14 and Xcode 10. at /Applications/Xcode.app
    -- OSX_SYSROOT_PREFIX: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
    -- WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling WITH_DRACO for now
    -- Performing Test SUPPORT_SSE_BUILD
    -- Performing Test SUPPORT_SSE_BUILD - Success
    -- SSE Support: detected.
    -- Performing Test SUPPORT_SSE2_BUILD
    -- Performing Test SUPPORT_SSE2_BUILD - Success
    -- SSE2 Support: detected.
    -- Found Git: /usr/bin/git (found version "2.20.1 (Apple Git-117)")
    -- Found OpenAL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenAL.framework
    CMake Error at build_files/cmake/platform/platform_apple.cmake:117 (message):
      Python executable missing:
      /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m
    Call Stack (most recent call first):
      CMakeLists.txt:906 (include)


    -- Configuring incomplete, errors occurred!
    See also "/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-tcseb2yd/bpy/build/temp.macosx-10.13-x86_64-3.6/CMakeFiles/CMakeOutput.log".
    error: command 'cmake' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-tcseb2yd/bpy/setup.py'"'"'; __file__='"'"'/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-tcseb2yd/bpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-record-6bpjmd0d/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

@TylerGubala
Copy link
Owner Author

Your Python executable cannot be found.

Python executable missing:
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m

Do you have Python installed correctly on Mac? Unfortunately I have no knowledge of how to do this.

@gandarez
Copy link

Yes I have and that folder is for shipped Mac products. I'm trying to figure out how to install python 3.6/3.7 in that folder. Python 2.7/3.x is installed via homebrew already.
Screen Shot 2019-08-25 at 19 07 01

@gandarez
Copy link

I changed to use pip3 and start getting this error:

Collecting bpy
  Using cached https://files.pythonhosted.org/packages/18/40/f8166da0a9c7f33bd0a942e9b86e83bd9ab07d85aabff6ffb7e0b939c3cf/bpy-1.2.3.tar.gz
Installing collected packages: bpy
  Running setup.py install for bpy ... error
    Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-dhz2i1dz/bpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-record-03q8k3fo/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    Preparing the build environment
    Cloning Blender source from git://git.blender.org/blender.git
    Updating Blender git submodules
    Configuring cmake project
    cmake -H/Users/gandarez/.blenderpy/blender -Bbuild/temp.macosx-10.9-x86_64-3.7 -DWITH_PLAYER=OFF -DWITH_PYTHON_INSTALL=OFF -DWITH_PYTHON_MODULE=ON
    -- The C compiler identification is AppleClang 10.0.1.10010046
    -- The CXX compiler identification is AppleClang 10.0.1.10010046
    -- 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
    2019-08-25 19:19:07.882 xcodebuild[4926:3739740] [MT] PluginLoading: Required plug-in compatibility UUID B89EAABF-783E-4EBF-80D4-A9EAC69F77F2 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/WakaTime.xcplugin' not present in DVTPlugInCompatibilityUUIDs
    2019-08-25 19:19:07.883 xcodebuild[4926:3739740] [MT] PluginLoading: Required plug-in compatibility UUID B89EAABF-783E-4EBF-80D4-A9EAC69F77F2 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
    -- Detected OS X 10.14 and Xcode 10. at /Applications/Xcode.app
    -- OSX_SYSROOT_PREFIX: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
    -- Setting deployment target to 10.11, lower versions are not supported
    -- WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling WITH_DRACO for now
    -- Performing Test SUPPORT_SSE_BUILD
    -- Performing Test SUPPORT_SSE_BUILD - Success
    -- SSE Support: detected.
    -- Performing Test SUPPORT_SSE2_BUILD
    -- Performing Test SUPPORT_SSE2_BUILD - Success
    -- SSE2 Support: detected.
    -- Found Git: /usr/bin/git (found version "2.20.1 (Apple Git-117)")
    -- Found OpenAL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenAL.framework
    -- Using /Users/gandarez/.blenderpy/blender/../lib/darwin/openmp for OpenMP
    -- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework
    -- Performing Test C_WARN_ALL
    -- Performing Test C_WARN_ALL - Success
    -- Performing Test C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION
    -- Performing Test C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION - Success
    -- Performing Test C_WARN_ERROR_RETURN_TYPE
    -- Performing Test C_WARN_ERROR_RETURN_TYPE - Success
    -- Performing Test C_WARN_NO_AUTOLOGICAL_COMPARE
    -- Performing Test C_WARN_NO_AUTOLOGICAL_COMPARE - Success
    -- Performing Test C_WARN_NO_UNKNOWN_PRAGMAS
    -- Performing Test C_WARN_NO_UNKNOWN_PRAGMAS - Success
    -- Performing Test C_WARN_NO_CHAR_SUBSCRIPTS
    -- Performing Test C_WARN_NO_CHAR_SUBSCRIPTS - Success
    -- Performing Test C_WARN_STRICT_PROTOTYPES
    -- Performing Test C_WARN_STRICT_PROTOTYPES - Success
    -- Performing Test C_WARN_MISSING_PROTOTYPES
    -- Performing Test C_WARN_MISSING_PROTOTYPES - Success
    -- Performing Test C_WARN_UNUSED_PARAMETER
    -- Performing Test C_WARN_UNUSED_PARAMETER - Success
    -- Performing Test CXX_WARN_ALL
    -- Performing Test CXX_WARN_ALL - Success
    -- Performing Test CXX_WARN_NO_AUTOLOGICAL_COMPARE
    -- Performing Test CXX_WARN_NO_AUTOLOGICAL_COMPARE - Success
    -- Performing Test CXX_WARN_NO_UNKNOWN_PRAGMAS
    -- Performing Test CXX_WARN_NO_UNKNOWN_PRAGMAS - Success
    -- Performing Test CXX_WARN_NO_CHAR_SUBSCRIPTS
    -- Performing Test CXX_WARN_NO_CHAR_SUBSCRIPTS - Success
    -- Performing Test CXX_WARN_NO_OVERLOADED_VIRTUAL
    -- Performing Test CXX_WARN_NO_OVERLOADED_VIRTUAL - Success
    -- Performing Test CXX_WARN_NO_SIGN_COMPARE
    -- Performing Test CXX_WARN_NO_SIGN_COMPARE - Success
    -- Performing Test CXX_WARN_NO_INVALID_OFFSETOF
    -- Performing Test CXX_WARN_NO_INVALID_OFFSETOF - Success
    -- Performing Test C_WARN_NO_UNUSED_PARAMETER
    -- Performing Test C_WARN_NO_UNUSED_PARAMETER - Success
    -- Performing Test C_WARN_NO_UNUSED_MACROS
    -- Performing Test C_WARN_NO_UNUSED_MACROS - Success
    -- Performing Test C_WARN_NO_MISSING_VARIABLE_DECLARATIONS
    -- Performing Test C_WARN_NO_MISSING_VARIABLE_DECLARATIONS - Success
    -- Performing Test C_WARN_NO_INCOMPAT_PTR_DISCARD_QUAL
    -- Performing Test C_WARN_NO_INCOMPAT_PTR_DISCARD_QUAL - Success
    -- Performing Test C_WARN_NO_UNUSED_FUNCTION
    -- Performing Test C_WARN_NO_UNUSED_FUNCTION - Success
    -- Performing Test C_WARN_NO_INT_TO_VOID_POINTER_CAST
    -- Performing Test C_WARN_NO_INT_TO_VOID_POINTER_CAST - Success
    -- Performing Test C_WARN_NO_MISSING_PROTOTYPES
    -- Performing Test C_WARN_NO_MISSING_PROTOTYPES - Success
    -- Performing Test C_WARN_NO_DUPLICATE_ENUM
    -- Performing Test C_WARN_NO_DUPLICATE_ENUM - Success
    -- Performing Test C_WARN_NO_UNDEF
    -- Performing Test C_WARN_NO_UNDEF - Success
    -- Performing Test C_WARN_NO_MISSING_NORETURN
    -- Performing Test C_WARN_NO_MISSING_NORETURN - Success
    -- Performing Test CXX_WARN_NO_UNUSED_PRIVATE_FIELD
    -- Performing Test CXX_WARN_NO_UNUSED_PRIVATE_FIELD - Success
    -- Performing Test CXX_WARN_NO_CXX11_NARROWING
    -- Performing Test CXX_WARN_NO_CXX11_NARROWING - Success
    -- Performing Test CXX_WARN_NO_NON_VIRTUAL_DTOR
    -- Performing Test CXX_WARN_NO_NON_VIRTUAL_DTOR - Success
    -- Performing Test CXX_WARN_NO_UNUSED_MACROS
    -- Performing Test CXX_WARN_NO_UNUSED_MACROS - Success
    -- Performing Test CXX_WARN_NO_REORDER
    -- Performing Test CXX_WARN_NO_REORDER - Success
    -- Performing Test CXX_WARN_NO_COMMENT
    -- Performing Test CXX_WARN_NO_COMMENT - Success
    -- Performing Test CXX_WARN_NO_UNUSED_TYPEDEFS
    -- Performing Test CXX_WARN_NO_UNUSED_TYPEDEFS - Success
    -- Performing Test CXX_HAS_SSE
    -- Performing Test CXX_HAS_SSE - Success
    -- Performing Test CXX_HAS_AVX
    -- Performing Test CXX_HAS_AVX - Success
    -- Performing Test CXX_HAS_AVX2
    -- Performing Test CXX_HAS_AVX2 - Success
    ERROR: File Not Found. (-43)  on file: /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-dhz2i1dz/bpy/build/temp.macosx-10.9-x86_64-3.7/bin/Blender.app
    -- Disabling render tests because tests folder does not exist at /Users/gandarez/.blenderpy/blender/../lib/tests
    -- C Compiler:   "AppleClang"
    -- C++ Compiler: "AppleClang"

    Blender Configuration
    =====================

      Build Options:
      - WITH_BULLET                 ON
      - WITH_IK_SOLVER              ON
      - WITH_IK_ITASC               ON
      - WITH_OPENCOLLADA            ON
      - WITH_FFTW3                  ON
      - WITH_INTERNATIONAL          ON
      - WITH_INPUT_NDOF             ON
      - WITH_CYCLES                 ON
      - WITH_FREESTYLE              ON
      - WITH_OPENCOLORIO            ON
      - WITH_OPENIMAGEDENOISE       OFF
      - WITH_OPENVDB                OFF
      - WITH_ALEMBIC                OFF

      Compiler Options:
      - WITH_BUILDINFO              ON
      - WITH_OPENMP                 ON
      - WITH_RAYOPTIMIZATION        ON

      System Options:
      - WITH_INSTALL_PORTABLE
      - WITH_X11_ALPHA              OFF
      - WITH_X11_XF86VMODE          OFF
      - WITH_X11_XFIXES             OFF
      - WITH_X11_XINPUT             OFF
      - WITH_MEM_JEMALLOC           ON
      - WITH_MEM_VALGRIND           OFF
      - WITH_SYSTEM_GLEW            OFF

      Image Formats:
      - WITH_OPENIMAGEIO            ON
      - WITH_IMAGE_CINEON           ON
      - WITH_IMAGE_DDS              ON
      - WITH_IMAGE_HDR              ON
      - WITH_IMAGE_OPENEXR          ON
      - WITH_IMAGE_OPENJPEG         ON
      - WITH_IMAGE_TIFF             ON

      Audio:
      - WITH_OPENAL                 ON
      - WITH_SDL                    ON
      - WITH_SDL_DYNLOAD
      - WITH_JACK                   OFF
      - WITH_JACK_DYNLOAD
      - WITH_CODEC_AVI              ON
      - WITH_CODEC_FFMPEG           ON
      - WITH_CODEC_SNDFILE          OFF

      Compression:
      - WITH_LZMA                   ON
      - WITH_LZO                    ON

      Python:
      - WITH_PYTHON_INSTALL         OFF
      - WITH_PYTHON_INSTALL_NUMPY
      - WITH_PYTHON_MODULE          ON
      - WITH_PYTHON_SAFETY          OFF
      - WITH_PYTHON_FRAMEWORK       OFF

      Modifiers:
      - WITH_MOD_REMESH             ON
      - WITH_MOD_FLUID              ON
      - WITH_MOD_OCEANSIM           OFF

      OpenGL:
      - WITH_GLEW_ES                OFF
      - WITH_GL_EGL                 OFF
      - WITH_GL_PROFILE_ES20        OFF


    -- Configuring done
    -- Generating done
    CMake Warning:
      Manually-specified variables were not used by the project:

        WITH_PLAYER


    -- Build files have been written to: /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-dhz2i1dz/bpy/build/temp.macosx-10.9-x86_64-3.7
    Building binaries
    cmake --build build/temp.macosx-10.9-x86_64-3.7 --target INSTALL --config Release
    make: *** No rule to make target `INSTALL'.  Stop.
    error: command 'cmake' failed with exit status 2

    ----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-dhz2i1dz/bpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-record-03q8k3fo/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/tf/w4gth5n97n3_g2b4q47ttyk80000gn/T/pip-install-dhz2i1dz/bpy/

@gandarez
Copy link

I don't know if the error is related to blender itself but I opened a ticket there https://developer.blender.org/T69157

@Heyam777
Copy link

Do you know why is that?

@TylerGubala
Copy link
Owner Author

@Heyam777 it looks like it's related to your Xcode installation.

Try reading through the below and let me know what you find. But anyways it's related to your XCode, not the script itself.

meteor/meteor#7905 (comment)

@Heyam777
Copy link

App Store was telling me that I have not enough space to install Xcode so I downloaded the software from the apple developer page.

@Heyam777
Copy link

Cool -- I changed the directory and everything. I will test it in a couple of days :D Thanks!

@a0s
Copy link

a0s commented Jan 6, 2020

Wrote how to build bpy with virtualenv (without system Python framework) https://github.com/a0s/blender/pull/1

@TylerGubala
Copy link
Owner Author

@a0s I think I'm missing something because I can't think of a scenario where I would have virtualenv and not the Python framework (I always use the Python bundled venv).

Giving people more options to build and use for their use case is always good though; do you mind if I add that to blenderpy's wiki?

@a0s
Copy link

a0s commented Jan 7, 2020

@TylerGubala I'm not sure that I can bring my PR to Blender's master branch, so adding this link to the wiki would be nice.

@Rolandisimo
Copy link

Rolandisimo commented Feb 11, 2020

I tried running your commands @TylerGubala, but got this after all:

-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/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: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
CMake Error at build_files/cmake/platform/platform_apple_xcode.cmake:73 (string):
  string begin index: 6 is out of range 0 - 0
Call Stack (most recent call first):
  CMakeLists.txt:564 (include)


-- Detected OS X  and Xcode  at /Library/Developer/CommandLineTools
CMake Error at build_files/cmake/platform/platform_apple_xcode.cmake:79 (if):
  if given arguments:

    "VERSION_LESS" "4.3"

  Unknown arguments specified
Call Stack (most recent call first):
  CMakeLists.txt:564 (include)


-- Configuring incomplete, errors occurred!
See also "/Users/rolands/.blenderpy/master/build_bpy_darwin_custom/CMakeFiles/CMakeOutput.log".
make: *** No rule to make target `install'.  Stop.

I have installed XCode from AppStore, installed CMake. Even installed future-fstrings, etc that you mentioned somewhere else.

Log file:
CMakeOutput.log

[UPDATE]
Doing this xcode fix allowed me to launch make command. It's building bpy I assume. Will update asap when its done.

@TylerGubala
Copy link
Owner Author

[UPDATE]
Doing this xcode fix allowed me to launch make command. It's building bpy I assume. Will update asap when its done.

I have never had that issue; can you please elaborate on what exactly causes it? My understanding is that this happens with some "light" installations with XCode, and that maybe a lot of people would run into this, but ultimately I can't reproduce it on my own (albeit outdated) hardware without knowing what the repro steps are.

@Rolandisimo
Copy link

Rolandisimo commented Feb 12, 2020

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance error was fixed by running sudo xcode-select -s /Applications/Xcode.app/Contents/Developer after installing the full XCode from AppStore.

However, now it seems it has built everything, but I don't understand the copying steps to allow me to do python3 -c "import bpy". In fact, I can't find such file in the built folders. In some of your steps you have some Python.Framework folder which seems confusing because 1) I don't have such folder and 2) that's not even close to where I have python. I assume it's meant to be /usr/bin/python3?


UPDATE

Following the steps in the macos install guide (and in this thread):

-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- 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
-- Detected OS X 10.15 and Xcode 11. at /Applications/Xcode.app
-- OSX_SYSROOT_PREFIX: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
CMake Warning at CMakeLists.txt:580 (message):
  WITH_OPENAL requires WITH_AUDASPACE which is disabled


CMake Warning at CMakeLists.txt:584 (message):
  WITH_JACK requires WITH_AUDASPACE which is disabled


-- WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling WITH_DRACO for now
-- Performing Test SUPPORT_SSE_BUILD
-- Performing Test SUPPORT_SSE_BUILD - Success
-- SSE Support: detected.
-- Performing Test SUPPORT_SSE2_BUILD
-- Performing Test SUPPORT_SSE2_BUILD - Success
-- SSE2 Support: detected.
-- Found Git: /usr/bin/git (found version "2.21.1 (Apple Git-122.3)")
CMake Error at build_files/cmake/platform/platform_apple.cmake:124 (message):
  Python executable missing:
  /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m
Call Stack (most recent call first):
  CMakeLists.txt:804 (include)


-- Configuring incomplete, errors occurred!
See also "/Users/rolands/.blenderpy/master/build_bpy_darwin_custom/CMakeFiles/CMakeOutput.log".
make: *** No rule to make target `install'.  Stop.
cp: bin/bpy.so: No such file or directory
cp: bin/2.82: No such file or directory

UPDATE 2

I ended up copying my folder /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/ to Library/Framework and renaming to Python.framework (Tried specifying -DPYTHON_INCLUDE_DIR=, but without success) and setting WITH_AUDASPACE=ON. Install process is now on the way.


UPDATE 3
Failed again at 49% install.
Tried tinkering with cmake commands like PYTHON_INCLUDE_DIR(S), PYTHON_LIBRARY to no avail.

[ 48%] Built target bf_shader_fx
[ 48%] Linking C executable ../../../../bin/makesdna
[ 49%] Built target makesdna
[ 49%] Generating dna.c, dna_type_offsets.h, dna_verify.c
dyld: Library not loaded: @rpath/Python3.framework/Versions/3.7/Python3
  Referenced from: /Users/rolands/.blenderpy/master/build_bpy_darwin_custom/source/blender/makesdna/intern/../../../../bin/makesdna
  Reason: image not found
/bin/sh: line 1: 36106 Abort trap: 6           ../../../../bin/makesdna /Users/rolands/.blenderpy/master/build_bpy_darwin_custom/source/blender/makesdna/intern/dna.c /Users/rolands/.blenderpy/master/build_bpy_darwin_custom/source/blender/makesdna/intern/dna_type_offsets.h /Users/rolands/.blenderpy/master/build_bpy_darwin_custom/source/blender/makesdna/intern/dna_verify.c /Users/rolands/.blenderpy/master/blender/source/blender/makesdna/
make[2]: *** [source/blender/makesdna/intern/dna.c] Error 134
make[1]: *** [source/blender/makesdna/intern/CMakeFiles/bf_dna.dir/all] Error 2
make: *** [all] Error 2
cp: bin/bpy.so: No such file or directory
mkdir: /Users/rolands/.blenderpy/venv/lib/python3.7/Resources: File exists
cp: bin/2.82: No such file or directory

@Rolandisimo
Copy link

What macos version do you have? Do you have python command for python 2.7 and python3 for 3.x? Did you install future-strings locally?

@TylerGubala
Copy link
Owner Author

@Rolandisimo You ought to have installed Python 3.7 for MacOS from https://www.python.org/

Then you would have your /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m directory.

I highly doubt simply copying the folder out of your XCode installation directory will suffice.

I am on macOS 10.15.3. Though from the looks of it I don't think your issue is related to a specific MacOS version.

Please try again after installing from Python.org.

@Chandler
Copy link

Chandler commented Apr 5, 2020

EDIT: I believe my issue was called by running make update before I had properly installed the system python. I was under the impression make install did all the work but it seems like make update requires the correct python as well

My build works after correctly installing python 3.7 to the system location /Library/Frameworks/Python.framework/Versions and doing a full rebuild of everything


For MacOS 10.15

I have followed the instructions here: https://github.com/TylerGubala/blenderpy/wiki/Platform---MacoOS#build-script

cd blender
make update
cd ../build_bpy_darwin_custom
cmake ../blender -DWITH_PLAYER=OFF -DWITH_PYTHON_INSTALL=OFF -DWITH_PYTHON_MODULE=ON -DWITH_OPENMP=OFF -DWITH_AUDASPACE=OFF
make install -j8
cp bin/bpy.so  /Users/cbabraham/.blenderpy/venv/lib/python3.7/site-packages
cp -R bin/2.83 /Users/cbabraham/.blenderpy/venv/lib/python3.7/Resources

everything went smoothly except I am hopelessly stuck at this error when I try to import the module:

(venv) which python3
/Users/cbabraham/.blenderpy/venv/bin/python3
(venv) python3
Python 3.7.7 (v3.7.7:d7c567b08f, Mar 10 2020, 02:56:16)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import bpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dynamic module does not define module export function (PyInit_bpy)

do you have any advice @TylerGubala @a0s ? thanks!!

It seems I'm the only one on the internet with this error for blender (bad sign) but the cause of similar errors is when a module has been compiled against python 2.7. But everything in the output and cmake suggests that it is compiling against system python 3.7
https://github.com/blender/blender/blob/master/build_files/cmake/platform/platform_apple.cmake

which I have:

ls /Library/Frameworks/Python.framework/Versions
3.7 3.8

(note I have tried installing the .so file in my venv python3 and system python3, same error)

There are no obvious python related errors in the make install output, this is the snippet for the linking stage

[100%] Linking CXX shared module ../../bin/bpy.so
ld: warning: direct access in function 'std::__1::__shared_ptr_pointer<std::__1::__empty_state<char>*, std::__1::default_delete<std::__1::__empty_state<char> >, std::__1::allocator<std::__1::__empty_state<char> > >::__get_deleter(std::type_info const&) const' from file '../../lib/libextern_mantaflow.a(cnpy.cpp.o)' to global weak symbol 'typeinfo name for std::__1::default_delete<std::__1::__empty_state<char> >' from file '/Users/cbabraham/code/blender-git/blender/../lib/darwin/openimageio/lib/libOpenImageIO.a(formatspec.cpp.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'std::__1::__shared_ptr_pointer<std::__1::__empty_state<char>*, std::__1::default_delete<std::__1::__empty_state<char> >, std::__1::allocator<std::__1::__empty_state<char> > >::__get_deleter(std::type_info const&) const' from file '../../lib/libextern_mantaflow.a(cnpy.cpp.o)' to global weak symbol 'typeinfo name for std::__1::default_delete<std::__1::__empty_state<char> >' from file '/Users/cbabraham/code/blender-git/blender/../lib/darwin/openimageio/lib/libOpenImageIO.a(formatspec.cpp.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
now run: "make install" to copy runtime files and scripts to 2.83
[100%] Built target blender

--

I've looked at the blender source and the export function that it claims is missing is here
https://github.com/blender/blender/blob/master/source/blender/python/intern/bpy_interface.c#L972

I've looked at the link.txt in my build folder build_bpy_darwin_custom/source/creator/CMakeFiles/blender.dir/link.txt and it only references system python 3.7 directories as -L arguments.

--

I found a similar error where it's suggested again that python version mismatch somewhere int he build process is the culprit
https://blender.stackexchange.com/questions/90072/importerror-dynamic-module-does-not-define-init-function-initbpy

@ankushpanwar19
Copy link

cp

I tried exactly the same approach for installation on my mac but when i did import byp it gave segmentation fault.
`(base) ankushpanwar@109-202-223-75 dsif_3dvision % python
Python 3.7.6 (default, Jan 8 2020, 13:42:34)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.

import bpy
zsh: segmentation fault python`

Please suggest a solution.

@TylerGubala
Copy link
Owner Author

TylerGubala commented Apr 8, 2020 via email

@ankushpanwar19
Copy link

Thanks it worked in normal python ! But in anaconda it gave segmentation fault.

@TylerGubala
Copy link
Owner Author

TylerGubala commented Apr 8, 2020 via email

@Gaurav1302
Copy link

Gaurav1302 commented Jun 29, 2020

Hi @TylerGubala, @gandarez, I followed the steps mentioned above and was stuck at this error after the make install step:

[100%] Building C object source/creator/CMakeFiles/blender.dir/buildinfo.c.o
[100%] Linking CXX shared module ../../bin/bpy.so
[100%] Built target buildinfoobj
ld: -stack_size option can only be used when linking a main executable
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/bpy.so] Error 1
make[1]: *** [source/creator/CMakeFiles/blender.dir/all] Error 2
make: *** [all] Error 2

Could you please help with the issue?
My system configurations:
macOS Catalina 10.15.5
Python 3.7.5 (for MacOS from https://www.python.org/)

The file in build_bpy_darwin_custom/source/creator/CMakeFiles/blender.dir/link.txt looks like this -
link.txt

@TylerGubala
Copy link
Owner Author

@Gaurav1302 What tag?

Sometimes building master isn't the best course of action.

@Gaurav1302
Copy link

Gaurav1302 commented Jun 29, 2020

@TylerGubala,

@Gaurav1302 What tag?

$ git describe
v2.83-1886-gf28e59bd742

Sometimes building master isn't the best course of action.

Could you please elaborate on how do I proceed further?
Thanks!

@TylerGubala
Copy link
Owner Author

@Gaurav1302 My apologies, I should have elaborated.

You have basically two options:

  1. python3 -m pip install bpy && bpy_post_install
  2. Build from sources using the manual build script, which allows you to specify a tag, examples are included on the wiki page.

Option number 1 is the easiest and hopefully the most flexible, but may have compatibility issues. It was only recently made possible by the pypi upload limit being increased, so go ahead and give it a whirl if you have a chance! Notably it requires wheel.

Option number two requires the most system configuration, for instance the correct version of cmake and having XCode installed, etc. Please see the documentation for number two, and example command would be

./build_bpy.sh v2.82 python3.7

Where v2.82 is the git tag you want to build (matches the application release version number) and python3.7 is the name of the Python version you are using.

@Gaurav1302
Copy link

Gaurav1302 commented Jun 30, 2020

@TylerGubala, For the first option, I get the following error:

python3 -m pip install bpy && bpy_post_install
Collecting bpy
  Using cached bpy-2.82.1.tar.gz (19 kB)
Building wheels for collected packages: bpy
  Building wheel for bpy (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tb/grty5mjx29vf5jmj6ltcthbw0000gn/T/pip-install-cy56k917/bpy/setup.py'"'"'; __file__='"'"'/private/var/folders/tb/grty5mjx29vf5jmj6ltcthbw0000gn/T/pip-install-cy56k917/bpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/tb/grty5mjx29vf5jmj6ltcthbw0000gn/T/pip-wheel-uar9y_kh
       cwd: /private/var/folders/tb/grty5mjx29vf5jmj6ltcthbw0000gn/T/pip-install-cy56k917/bpy/
  Complete output (23310 lines):
.
.
.
.

ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tb/grty5mjx29vf5jmj6ltcthbw0000gn/T/pip-install-cy56k917/bpy/setup.py'"'"'; __file__='"'"'/private/var/folders/tb/grty5mjx29vf5jmj6ltcthbw0000gn/T/pip-install-cy56k917/bpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/tb/grty5mjx29vf5jmj6ltcthbw0000gn/T/pip-record-e0613wh8/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/bpy Check the logs for full command output.

Here is the complete output:logs.txt

While for the second option, I got the following error file error.pdf
Here is the complete output: logs 2.txt

I have already installed XCode (Version 11.5 (11E608c)), and CMake (Version 3.17.3).

What could be the issue here?

@rossjillian
Copy link

Hi @Gaurav1302,

I know this thread is about 4 months old, but I'm experiencing the same problem with installing bpy on my Mac. Did you ever resolve?

@Gaurav1302
Copy link

Hi @rossjillian,

No, it didn't work out on a Mac. As far as I can understand, Mac support for bpy is still limited. I switched to a Linux (Ubuntu) machine, instead. I would recommend you to do the same. It is much more hassle-free and straightforward. You'll definitely save time -- more than you can anticipate at the moment!

@Chandler
Copy link

@rossjillian @Gaurav1302 if you want to get the MacOS build working easily, download tyler's prebuilt MacOS wheel off google drive https://drive.google.com/drive/folders/1uSiTQLvlUxu7PDT2TCT4XIrwGwn1WWph

The reason pip install doesn't use these is they are too big to upload to pypy pypi/support#362 (comment)

pip install wheel_file.whl
bpy_post_install

building bpy for mac from scratch is indeed a pain so I hope we can find a solution for making it easier to host the pre-built binaries.

--

@TylerGubala I'm no expert but could we host them on a custom repo? https://packaging.python.org/guides/hosting-your-own-index/. So users could do something like pip install --extra-index-url https://repo.blenderpy.net bpy or w/e

@TylerGubala
Copy link
Owner Author

Hi!

To comment on this, yeah I was thinking about making a custom repo, as well as hosting the built wheels as a release in this Github project.

It's pretty tough, because (especially on linux) the builds are just getting bigger and bigger.

One thing that I want to mention too is that on this repo now, there are VS Code commands to build Blender.

Starting out, clone the repo and then run the First Time - Git & Svn Checkout VSCode task.

Then you should be able to run the Build VS Code task. Hopefully that makes building the module itself less painful in cases where the user can't use a prebuild.

Also, I am going to be working on migrating much of what exists in this repository into the Main Blender Foundation repo. My main goal is to have this repo only contain convenience functions like VS Code Tasks which probably would not be accepted into the main Blender codebase. Really anything that helps Blender be usable, including the Python extension module Packaging, should be part of Blender itself I feel.

Which to be honest, this repo is mostly just some scaffolding so that Python understands the built Extension module as a package, the setup.py file, while it does a lot, really isn't that complicated. I also don't think that the build configuration should be specified by the setup.py.

Anyways, @Chandler for hosting those files, are there any companies that provide PYPI custom servers? I could make it myself but it would be faster to just buy some hosting I feel. Also hosting on my own hardware feels like a dirty solution. I'm just not very familiar with if there are best practices for custom pypi like repos.

@rossjillian If you are on Mac and just want to "try out" Linux I recommend Docker. You can use my Google drive prebuilts or if you want to build for yourself you can clone this repo and run the Build Manylinux Wheels [Requires Docker] task.

Note that a stumbling block that I can't quite get over is that I do not support MacOS brew based Python installations because for some reason the wheel files I build for those just do not work on them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests