Problem in building a docker image with pyspark lib

笑着哭i 提交于 2021-02-08 11:00:57

问题


I'm trying to build a docker image using s2i and Jenkins. I have the following dependencies in the requirement.txt file

scikit-learn==0.21.2
scipy==0.18.1
pandas==0.24.2
seldon-core==0.3.0
pypandoc
pyspark==2.4.1

But my build process fails when it tries to install pyspark with the following error message

Downloading https://repo.company.com/repository/pypi-all/packages/f2/64/a1df4440483df47381bbbf6a03119ef66515cf2e1a766d9369811575454b/pyspark-2.4.1.tar.gz (215.7MB)
Complete output from command python setup.py egg_info:
Could not import pypandoc - required to package PySpark
Download error on https://pypi.org/simple/pypandoc/: [Errno 97] Address 
family not supported by protocol -- Some packages may not be found!
Couldn't find index page for 'pypandoc' (maybe misspelled?)
Download error on https://pypi.org/simple/: [Errno 97] Address family not 
supported by protocol -- Some packages may not be found!
No local packages or working download links found for pypandoc
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-dra7nhke/pyspark/setup.py", line 224, in <module>
'Programming Language :: Python :: Implementation :: PyPy']
File "/usr/local/lib/python3.6/site-packages/setuptools/__init__.py", line 
144, in setup
_install_setup_requires(attrs)
File "/usr/local/lib/python3.6/site-packages/setuptools/__init__.py", line 
139, in _install_setup_requires
...

although I have listed pypandoc before pyspark in the requirments.txt file, but it looks like when it's installing pyspark, pypandoc is not installed yet, which is a dependency. What's the problem?


回答1:


I passed this error by executing:

pip install pypandoc

before installing pyspark. I tried a lot use pypandoc==1.4 in requirements.txt but it doesn't work.

In that sources people using same way: https://hub.docker.com/r/takaomag/test-0/dockerfile https://www.ibm.com/support/knowledgecenter/el/SSWTQQ_2.0.3/install/t_si_pythonpackagesoffline.html unable to install pyspark



来源:https://stackoverflow.com/questions/56652619/problem-in-building-a-docker-image-with-pyspark-lib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!