要求.txt弹性bean上的with conda/pip无效

2024-04-26 01:26:04 发布

您现在位置:Python中文网/ 问答频道 /正文

有没有可能它不喜欢conda/pip的混合?它说我的pip过期了,但实际上在我的本地机器上是7.1.2。在

我正在尝试将一个包含numpy、scipy等的flask应用程序部署到aws

AppDeployPreHook/03deploy.py] : Activity execution failed, because: You are using pip version 7.0.3, however version 7.1.2 is available.
      You should consider upgrading via the 'pip install --upgrade pip' command.
      Exception:
      Traceback (most recent call last):
        File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 223, in main
          status = self.run(options, args)
        File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/commands/install.py", line 268, in run
          wheel_cache
        File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 287, in populate_requirement_set
          wheel_cache=wheel_cache):
        File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_file.py", line 86, in parse_requirements
          for req in req_iter:
        File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_file.py", line 130, in process_line
          wheel_cache=wheel_cache
        File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_install.py", line 207, in from_line
          wheel_cache=wheel_cache)
        File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_install.py", line 66, in __init__
          req = pkg_resources.Requirement.parse(req)
        File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2960, in parse
          reqs = list(parse_requirements(s))
        File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2904, in parse_requirements
          "version spec")
        File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2869, in scan_list
          raise ValueError(msg, line, "at", line[p:])
      ValueError: ('Expected version spec in', '_license=1.1=py27_0', 'at', '=1.1=py27_0')

  2015-10-16 01:37:43,439 ERROR    Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2
  Traceback (most recent call last):
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 22, in main
      install_dependencies()
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 18, in install_dependencies
      check_call('%s install -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True)
    File "/usr/lib64/python2.7/subprocess.py", line 540, in check_call
      raise CalledProcessError(retcode, cmd)
  CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2 (ElasticBeanstalk::ExternalInvocationError)
caused by: You are using pip version 7.0.3, however version 7.1.2 is available.
  You should consider upgrading via the 'pip install --upgrade pip' command.
  Exception:
  Traceback (most recent call last):
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 223, in main
      status = self.run(options, args)
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/commands/install.py", line 268, in run
      wheel_cache
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 287, in populate_requirement_set
      wheel_cache=wheel_cache):
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_file.py", line 86, in parse_requirements
      for req in req_iter:
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_file.py", line 130, in process_line
      wheel_cache=wheel_cache
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_install.py", line 207, in from_line
      wheel_cache=wheel_cache)
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_install.py", line 66, in __init__
      req = pkg_resources.Requirement.parse(req)
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2960, in parse
      reqs = list(parse_requirements(s))
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2904, in parse_requirements
      "version spec")
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2869, in scan_list
      raise ValueError(msg, line, "at", line[p:])
  ValueError: ('Expected version spec in', '_license=1.1=py27_0', 'at', '=1.1=py27_0')

  2015-10-16 01:37:43,439 ERROR    Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2
  Traceback (most recent call last):
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 22, in main
      install_dependencies()
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 18, in install_dependencies
      check_call('%s install -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True)
    File "/usr/lib64/python2.7/subprocess.py", line 540, in check_call
      raise CalledProcessError(retcode, cmd)
  CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2 (Executor::NonZeroExitStatus)

这是我的需求文件,上面写着无效:

^{pr2}$

Tags: installpipruninpyvenvlibpackages
1条回答
网友
1楼 · 发布于 2024-04-26 01:26:04

您的requirements.txt文件无效(至少对pip)无效。看看标题,如果你说

# This file may be used to create an environment using:
# $ conda create  name <env>  file <this file>
# platform: osx-64

{{cd4}要想让这个非cd2}格式有效,还需要从cd2}环境中删除。在

除此之外,你会看到这样的警告

^{pr2}$

一般来说,最好假设它说的是实话。也许您在本地有7.1.2,但是这个脚本是在本地运行的(或者可能是在安装了旧的pip的EBS实例上…)运行的?在

相关问题 更多 >