首页 > 解决方案 > 使用 python2.7 的 Codalab 设置问题

问题描述

我在使用 python2.7.x安装 codalab ( https://codalab.org/ ) 时遇到问题。codalab 站点在此处提供了一个教程,通过该教程可以安装他们的 CLI 以与他们的服务器进行交互。该教程说我们需要 python 2.7 并安装 codalab 只需运行命令“pip install codalab -U --user”,而这里它说运行“pip install codalab”但没有任何命令起作用,我得到了错误从这两个命令。

错误跟踪如下

https://pip.pypa.io/en/latest/development/relea
se-process/#python-2-support
Collecting codalab
c:\python27\lib\site-packages\pip\_vendor\urllib3\util\ssl_.py:365: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures.<br />
You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings SNIMissingWarning
c:\python27\lib\site-packages\pip\_vendor\urllib3\util\ssl_.py:149: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail.You can upgrade to a newer version of Python to solve this. For more information, seehttps://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecurePlatformWarning <br />
  Using cached https://files.pythonhosted.org/packages/78/c9/596147d4836372f07c2
463cc8ad79eba3c6b18f3a9ab50b57fbac94ea3f2/codalab-0.3.2.tar.gz
Collecting codalabworker>=0.3.2 (from codalab)
  Using cached https://files.pythonhosted.org/packages/8e/16/7bdc06efeab5d712a55
7a0fed8d1e050dbf4769d96afac295f620e2b44a2/codalabworker-0.3.2.tar.gz <br />
    ERROR: Command errored out with exit status 1:
     command: 'c:\python27\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\hafiza~1\\appdata\\local\\temp\\pip-install-rbchpi\\codalabworker\\setup.py'"'"';__file__='"'"'c:\\users\\hafiza~1\\appdata\\local\\temp\\pip-installrbchpi\\codalabworker\\setup.py'"'"';f=getattr(tokenize, '"'"'
open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'egg_info --egg-base pip-egg-info <br />
         cwd: c:\users\hafiza~1\appdata\local\temp\pip-install-rbchpi\codalabworker\ <br />
    Complete output (1 lines):<br />
    **error in codalabworker setup command: "values of 'package_data' dict" must be a list of strings (got 'requirements.txt')** <br />
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.<br />

我尝试了从 2.7.0 到 2.7.8 和 2.7.16 的不同版本的 python,但我得到了同样的错误。我也试过3.7.0。

操作系统:windows 8.1
Python --version 已尝试:上面提到的
pip 版本已尝试:2.7 和 3.0 的最新 19
每个 python 工具都已升级。
其他链接尝试:找不到与此问题相关的任何链接

标签: python-2.7

解决方案


您可能需要修复该codalabworker/setup.py文件。

检查这个:https ://github.com/codalab/codalab-worksheets/commit/6e92da072e17ad7a25c287325d0795233fd2d168

或更改package_data={'': 'requirements.txt'}package_data={'': ['requirements.txt'\].


推荐阅读