Hi folks,
What I'm running:
$ ./pants --version
1.7.0rc1
$ python --version
Python 3.6.3
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="17.04 (Zesty Zapus)"
...
This is the entry for scikit-image and cython in 3rdparty:
python_requirement_library(
name='scikit-image',
requirements=[python_requirement(name='scikit-image', requirement='scikit-image==0.14.0')]
)
python_requirement_library(
name='cython',
requirements=[python_requirement(name='cython', requirement='cython==0.28.2')]
)
Here's my BUILD file:
python_library(
name='landsat-lib-test',
sources=['landsat.py'],
dependencies=[
'3rdparty:scikit-image',
]
)
And here's landsat.py:
import skimage
print(skimage)
When I try to create the binary:
$ ./pants binary libraries/landsat-lib-test:
10:05:16 00:00 [main]
(To run a reporting server: ./pants server)
10:05:16 00:00 [setup]
10:05:16 00:00 [parse]
Executing tasks in goals: jvm-platform-validate -> bootstrap -> imports -> unpack-jars -> deferred-sources -> gen -> pyprep -> resolve -> resources -> compile -> binary
10:05:16 00:00 [jvm-platform-validate]
10:05:16 00:00 [jvm-platform-validate]
10:05:16 00:00 [bootstrap]
10:05:16 00:00 [substitute-aliased-targets]
10:05:16 00:00 [jar-dependency-management]
10:05:16 00:00 [bootstrap-jvm-tools]
10:05:16 00:00 [provide-tools-jar]
10:05:16 00:00 [imports]
10:05:16 00:00 [ivy-imports]
10:05:16 00:00 [unpack-jars]
10:05:16 00:00 [unpack-jars]
10:05:16 00:00 [deferred-sources]
10:05:16 00:00 [deferred-sources]
10:05:16 00:00 [gen]
10:05:16 00:00 [antlr-java]
10:05:16 00:00 [antlr-py]
10:05:16 00:00 [jaxb]
10:05:16 00:00 [protoc]
10:05:16 00:00 [ragel]
10:05:16 00:00 [thrift-java]
10:05:16 00:00 [thrift-py]
10:05:16 00:00 [wire]
10:05:16 00:00 [pyprep]
10:05:16 00:00 [interpreter]
10:05:16 00:00 [build-local-dists]
10:05:16 00:00 [requirements]
10:05:16 00:00 [cache]
No cached artifacts for 1 target.
Invalidated 1 target.**** Failed to install scikit-image-0.14.0 (caused by: NonZeroExit("received exit code 1 during execution of `[u'/usr/local/bin/python3.6', '-', 'bdist_wheel', '--dist-dir=/tmp/tmptNyaMm']` while trying to execute `[u'/usr/local/bin/python3.6', '-', 'bdist_wheel', '--dist-dir=/tmp/tmptNyaMm']`",)
):
stdout:
Cython >= 0.23 not found; falling back to pre-built geometry.c
Cython >= 0.23 not found; falling back to pre-built transform.c
Cython >= 0.23 not found; falling back to pre-built interpolation.c
Cython >= 0.23 not found; falling back to pre-built _draw.c
Cython >= 0.23 not found; falling back to pre-built corner_cy.c
Cython >= 0.23 not found; falling back to pre-built censure_cy.c
Cython >= 0.23 not found; falling back to pre-built orb_cy.c
Cython >= 0.23 not found; falling back to pre-built brief_cy.c
Cython >= 0.23 not found; falling back to pre-built _texture.c
Cython >= 0.23 not found; falling back to pre-built _hessian_det_appx.c
Cython >= 0.23 not found; falling back to pre-built _hoghistogram.c
stderr:
Partial import of skimage during the build process.
Traceback (most recent call last):
File "/tmp/tmpt4RwSB/scikit-image-0.14.0/skimage/_build.py", line 30, in cython
from Cython import __version__
ModuleNotFoundError: No module named 'Cython'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 7, in <module>
File "setup.py", line 149, in <module>
**extra
File "/usr/local/lib/python3.6/site-packages/numpy/distutils/core.py", line 135, in setup
config = configuration()
File "setup.py", line 70, in configuration
config.add_subpackage('skimage')
File "/usr/local/lib/python3.6/site-packages/numpy/distutils/misc_util.py", line 1029, in add_subpackage
caller_level = 2)
File "/usr/local/lib/python3.6/site-packages/numpy/distutils/misc_util.py", line 998, in get_subpackage
caller_level = caller_level + 1)
File "/usr/local/lib/python3.6/site-packages/numpy/distutils/misc_util.py", line 935, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "skimage/setup.py", line 14, in configuration
config.add_subpackage('feature')
File "/usr/local/lib/python3.6/site-packages/numpy/distutils/misc_util.py", line 1029, in add_subpackage
caller_level = 2)
File "/usr/local/lib/python3.6/site-packages/numpy/distutils/misc_util.py", line 998, in get_subpackage
caller_level = caller_level + 1)
File "/usr/local/lib/python3.6/site-packages/numpy/distutils/misc_util.py", line 935, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "skimage/feature/setup.py", line 22, in configuration
cython(['_haar.pyx'], working_path=base_path)
File "/tmp/tmpt4RwSB/scikit-image-0.14.0/skimage/_build.py", line 42, in cython
% CYTHON_VERSION)
RuntimeError: Cython >= 0.23 is required to build scikit-image from git checkout
Waiting for background workers to finish.
10:05:18 00:02 [complete]
FAILURE
Exception caught: (<class 'pex.resolver.Untranslateable'>)
Exception message: Package SourcePackage(u'file:///home/jhersch/src/gemini/.pants.d/python-setup/resolved_requirements/CPython-3.6.3/scikit-image-0.14.0.tar.gz') is not translateable by ChainedTranslator(WheelTranslator, EggTranslator, SourceTranslator)
I do have cython installed in the environment where I run pants:
$ pip freeze | grep Cython
Cython==0.28.2
It doesn't help if I add cython to the BUILD file like this, I get the same error in that case:
python_library(
name='landsat-lib-test',
sources=['landsat.py'],
dependencies=[
'3rdparty:cython',
'3rdparty:scikit-image',
]
)
How do I tell pants where cython is located? Is this use case supported?
Thanks,
Jesse