python - Installing via `setup.py develop` fails - pip works -
my python package footools needs html5lib via install_requires in setup.py.
setup.py develop fails
installing via setup.py develop fails:
cd src/footools/ python setup.py develop processing dependencies footools==2016.205 searching html5lib==0.9999999 reading https://source.example.com/pypi/simple/html5lib/ download error on https://source.example.com/pypi/simple/html5lib/: [errno 185090050] _ssl.c:354: error:0b084002:x509 certificate routines:x509_load_cert_crl_file:system lib -- packages may not found! couldn't find index page 'html5lib' (maybe misspelled?) pip works
but direct download works:
bar@workdevel123:~/src/footools> pip install html5lib==0.9999999 /home/bar/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: insecureplatformwarning: true sslcontext object not available. prevents urllib3 configuring ssl appropriately , may cause ssl connections fail. more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. insecureplatformwarning collecting html5lib==0.9999999 /home/bar/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: insecureplatformwarning: true sslcontext object not available. prevents urllib3 configuring ssl appropriately , may cause ssl connections fail. more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. insecureplatformwarning downloading https://source.example.com/pypi/packages/html5lib-0.9999999.tar.gz requirement satisfied (use --upgrade upgrade): 6 in /usr/lib/python2.7/site-packages (from html5lib==0.9999999) installing collected packages: html5lib running setup.py install html5lib installed html5lib-0.9999999 questions
what difference between these 2 methods?
why different?
what correct way install dependency in python?
setup.py
the setup.py not special:
import setuptools setuptools.setup( name='foo', version='2016.210', long_description=open('readme.txt').read(), packages=setuptools.find_packages(), install_requires=[ # twenty packages before line 'html5lib==0.9999999' ], include_package_data=true, entry_points={ 'console_scripts': [ 'foo=foo.utils.bar:main', ], }, )
python setup.py develop, or setuptools in general uses easy_install satisfy dependencies in turn uses urllib2 whereas pip uses requests. see here easy_install vs pip.
pip more modern , among other things has capability uninstall packages , complies pep 438 -- transitioning release-file hosting on pypi. can achieve same thing python setup.py develop pip install -e src/footools/, note if project path in current directory use, ./footools.
the requests package bundles ca certs in package itself, python -c 'import pip;print(pip.download.requests.certs.where())'.
setuptools uses system installed ca certs python -c 'from setuptools import ssl_support;print(ssl_support.cert_paths)'.
you have update system installed ca certs using tools update-ca-certificates ubuntu either update ca certs automatically or download https://curl.haxx.se/docs/caextract.html , install 1 of paths shown setuptools or set setuptools.ssl_support.cert_paths empy sequence [] , pip install certifi. calling setuptools.ssl_support.find_ca_bundle() reveal location of ca certs.
Comments
Post a Comment