2

While building my python source code using "pants", the build fails with "DistutilsError: Could not find suitable distribution for Requirement.parse('Cython!=0.25,<0.30,>=0.20')"

Following is a snapshot of error:

19:18:49 00:00 [main]
               (To run a reporting server: ./pants server)
19:18:49 00:00   [setup]
19:18:49 00:00     [parse]
               Executing tasks in goals: gen -> pyprep -> binary
19:18:49 00:00   [gen]
19:18:49 00:00     [thrift-py]
19:18:49 00:00   [pyprep]
19:18:49 00:00     [interpreter]
19:18:49 00:00     [build-local-dists]
19:18:49 00:00     [requirements]
19:18:50 00:01       [cache]   
                   No cached artifacts for 3 targets.
                   Invalidated 3 targets.**** Failed to install cassandra-driver-3.18.0 (caused by: NonZeroExit("received exit code 1 during execution of `[u'/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7', '-', 'bdist_wheel', '--dist-dir=/tmp/tmpZaWobT']` while trying to execute `[u'/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7', '-', 'bdist_wheel', '--dist-dir=/tmp/tmpZaWobT']`",)
):
stdout:

stderr:
Download error on https://pypi.org/simple/Cython/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) -- Some packages may not be found!
Couldn't find index page for 'Cython' (maybe misspelt?)
Download error on https://pypi.org/simple/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) -- Some packages may not be found!
No local packages or working download links found for Cython!=0.25,<0.30,>=0.20
Traceback (most recent call last):
  File "<stdin>", line 9, in <module>
  File "setup.py", line 441, in <module>
    run_setup(None)
  File "setup.py", line 439, in run_setup
    **kw)
  File "build/bdist.macosx-10.12-intel/egg/setuptools/__init__.py", line 139, in setup
  File "build/bdist.macosx-10.12-intel/egg/setuptools/__init__.py", line 134, in _install_setup_requires
  File "build/bdist.macosx-10.12-intel/egg/setuptools/dist.py", line 514, in fetch_build_eggs
  File "build/bdist.macosx-10.12-intel/egg/pkg_resources/__init__.py", line 777, in resolve
  File "build/bdist.macosx-10.12-intel/egg/pkg_resources/__init__.py", line 1060, in best_match
  File "build/bdist.macosx-10.12-intel/egg/pkg_resources/__init__.py", line 1072, in obtain
  File "build/bdist.macosx-10.12-intel/egg/setuptools/dist.py", line 581, in fetch_build_egg
  File "build/bdist.macosx-10.12-intel/egg/setuptools/command/easy_install.py", line 670, in easy_install

distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('Cython!=0.25,<0.30,>=0.20')



               Waiting for background workers to finish.
19:18:51 00:02   [complete]
               FAILURE
timestamp: 2019-06-03T19:18:51.874305
Exception caught: (pex.resolver.Untranslateable) (backtrace omitted)
Exception message: Package SourcePackage(u'file:///Arun/Python/Heron/pmpex/.pants.d/python-setup/resolved_requirements/CPython-2.7.10/cassandra-driver-3.18.0.tar.gz') is not translateable by ChainedTranslator(WheelTranslator, EggTranslator, SourceTranslator)

I'm using Mac OS X Sierra version 10.12.6. Python, Pip and OpenSSL versions are up-to-date as shown below:

$python --version
Python 2.7.16

$pip --version
pip 19.0.3 from /usr/local/lib/python2.7/site-packages/pip (python 2.7)

$openssl version
OpenSSL 1.0.2r  26 Feb 2019

Python in my Mac also supports TLS 1.2 as shown below:

$python -c "import json, urllib2; print json.load(urllib2.urlopen('https://www.howsmyssl.com/a/check'))['tls_version']"
TLS 1.2

All the packages are also up-to-date as shown below:

$pip list
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Package          Version
---------------- -------
cassandra-driver 3.18.0 
futures          3.2.0  
pip              19.1.1 
pyspark          2.3.1  
setuptools       41.0.1 
six              1.12.0 
wheel            0.33.4 

The expected result is, obviously my pants build to succeed. Even the URL https://pypi.org/simple/Cython/ is valid. I'm not sure what's the root cause here. Appreciate any help/ guidance to solve this error. Thanks in advance.

1
  • 1
    Hey, How did you solved it !! facing something similar !! Commented Sep 7, 2021 at 12:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.