docker - 通过 pipenv 安装 P4Python 在 docker 文件中失败

标签 docker dockerfile pipenv p4python

pipenv 的文件具有指定安装的模块 p4python,下面是运行 pipenv 模块安装的 docker 文件中的相关行。

RUN pipenv install --system --deploy --ignore-pipfile

但是,依赖项安装失败并显示以下消息。
Installing initially failed dependencies…
[pipenv.exceptions.InstallError]:   File "/usr/lib/python3.6/site- 
packages/pipenv/core.py", line 1874, in do_install
[pipenv.exceptions.InstallError]:       keep_outdated=keep_outdated
[pipenv.exceptions.InstallError]:   File "/usr/lib/python3.6/site- 
packages/pipenv/core.py", line 1253, in do_init
[pipenv.exceptions.InstallError]:       pypi_mirror=pypi_mirror,
[pipenv.exceptions.InstallError]:   File "/usr/lib/python3.6/site- 
packages/pipenv/core.py", line 859, in do_install_dependencies
[pipenv.exceptions.InstallError]:       retry_list, procs, 
failed_deps_queue, requirements_dir, **install_kwargs
[pipenv.exceptions.InstallError]:   File "/usr/lib/python3.6/site- 
packages/pipenv/core.py", line 763, in batch_install
[pipenv.exceptions.InstallError]:       _cleanup_procs(procs, not 
blocking, failed_deps_queue, retry=retry)
[pipenv.exceptions.InstallError]:   File "/usr/lib/python3.6/site- 
packages/pipenv/core.py", line 681, in _cleanup_procs
[pipenv.exceptions.InstallError]:       raise 
exceptions.InstallError(c.dep.name, extra=err_lines)
[pipenv.exceptions.InstallError]: ['Collecting p4python==2018.2.1743033 
(from -r /tmp/pipenv-9u5gpy03-requirements/pipenv-6yab4iqw- 
requirement.txt (line 1))', '  Using cached 
https://files.pythonhosted.org/packages/36/5a
/0a1b192cdecd31cb8bc0d0ba39c73ffd84ce823053d0004823a1fdbe1440/p4python- 
2018.2.1743033.tar.gz']
[pipenv.exceptions.InstallError]: ['ERROR: Complete output from command 
python setup.py egg_info:', '    ERROR: Attempting to load API from 
ftp.perforce.com', '    Traceback (most recent call last):', '      
File "<string>", line 1, in <module>', '      File "/tmp/pip-install- 
r77dk6yj/p4python/setup.py", line 269, in <module>', '        
(p4_api_dir, loaded_from_ftp) = get_api_dir(version.getVersion())', '      
File "/tmp/pip-install-r77dk6yj/p4python/setup.py", line 179, in 
get_api_dir', '        p4ftp = P4APIFtp()', '      File "/tmp/pip- 
install-r77dk6yj/p4python/tools/P4APIFtp.py", line 18, in __init__', '        
self.ftp = FTP(PERFORCE_FTP)', '      File 
"/usr/lib64/python3.6/ftplib.py", line 117, in __init__', '        
self.connect(host)', '      File "/usr/lib64/python3.6/ftplib.py", line 
152, in connect', '        source_address=self.source_address)', '      
File "/usr/lib64/python3.6/socket.py", line 724, in create_connection', 
'        raise err', '      File "/usr/lib64/python3.6/socket.py", line 
713, in create_connection', '        sock.connect(sa)', '    
ConnectionRefusedError: [Errno 111] Connection refused', '    --------- 
-------------------------------', 'ERROR: Command "python setup.py 
egg_info" failed with error code 1 in /tmp/pip-install- 
r77dk6yj/p4python/']
ERROR: ERROR: Package installation failed...

有谁知道为什么安装失败?

最佳答案

似乎有什么东西阻止了您对 ftp.perforce.com 的 FTP 访问.如果您在防火墙后面,请检查您是否可以访问 ftp.perforce.com 上的端口 21(FTP 端口) ,或请您的 IT 团队为您打开它。

关于docker - 通过 pipenv 安装 P4Python 在 docker 文件中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57176362/

相关文章:

linux - 如何更改docker容器中 'flink'上的默认用户 'root'?

django - 如何将 docker-compose.yml 翻译成 Dockerfile

python - Windows 在尝试使用 pipenv 安装包时报告错误

python - 使用 Django 和 pipenv 正确设置 uwsgi.ini 文件

docker - 如何在 Kubernetes (GCP) 中预配置 Pod 的 IP 地址?

postgresql - 如何从主机访问 docker postgres db

Docker 容器无法 curl,SSL 版本号错误

docker - Traefik:同一域上的 http、https、ws、wss(docker swarm)

ruby-on-rails - Rails Assets :precompile is using wrong bundler version

python - 无法使用 pipenv 安装 channel (django)