Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B buck
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 201
    • Issues 201
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • buck
  • Issues
  • #1902
Closed
Open
Issue created May 30, 2018 by Administrator@rootContributor

Python's wheel package with native libraries fails to load

Created by: marekcirkos

I am having problems loading Python's whl package that contains native library with prebuilt_python_library.

Eg. BUCK file:

python_binary(
  name = 'app',
  main_module = 'app',
  deps = [':app_lib'],
  platform = 'py3',
)

python_library(
  name = 'app_lib',
  deps = ['//third-party:pyobjc_core'],
  srcs = ['app.py'],
)

prebuilt_python_library(
  name = 'pyobjc_core',
  binary_src = 'pyobjc_core-4.2.1-cp36-cp36m-macosx_10_6_intel.whl',
)

app.py is simple

import objc

Fails to load, when calling buck run //:app with message

Building: finished in 0.7 sec (100%) 3/3 jobs, 2 updated, 33.3% cache miss
  Total time: 0.9 sec
Traceback (most recent call last):
  File ".bootstrap/_pex/pex.py", line 328, in execute
  File ".bootstrap/_pex/pex.py", line 261, in _wrap_coverage
  File ".bootstrap/_pex/pex.py", line 293, in _wrap_profiling
  File ".bootstrap/_pex/pex.py", line 371, in _execute
  File ".bootstrap/_pex/pex.py", line 429, in execute_entry
  File ".bootstrap/_pex/pex.py", line 434, in execute_module
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 208, in run_module
    return _run_code(code, {}, init_globals, run_name, mod_spec)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "app.py", line 4, in <module>
    import objc
  File "objc/__init__.py", line 18, in <module>
  File "objc/__init__.py", line 15, in _update
ModuleNotFoundError: No module named 'objc._objc'

I suspect this is because objc module in pyobjc_core contains file _objc.cpython-36m-darwin.so that should be loaded as _objc but it doesn't.

Installing same package with pip3 and running python3 app.py works like a charm.

Links: pyobjc_core-4.2.1-cp36-cp36m-macosx_10_6_intel.whl can be found here https://pypi.org/project/pyobjc-core/#files

Assignee
Assign to
Time tracking