Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/350.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用conda在Elastic Beanstalk上安装python模块 问题_Python_Amazon Web Services_Amazon Elastic Beanstalk_Conda_Xgboost - Fatal编程技术网

使用conda在Elastic Beanstalk上安装python模块 问题

使用conda在Elastic Beanstalk上安装python模块 问题,python,amazon-web-services,amazon-elastic-beanstalk,conda,xgboost,Python,Amazon Web Services,Amazon Elastic Beanstalk,Conda,Xgboost,我正在尝试安装在AWS Elastic Beanstalk上具有C依赖项的python包(即:和) Elastic Beanstalk python在Amazon Linux 2上默认使用pip或pipenv从requirements.txt安装软件包 但是,fbprophet和xgboost在C中有依赖项,需要在使用pip安装它们之前进行编译conda附带了这些预编译的库,因此使用conda安装它们要容易得多 我试过的 下面是我尝试使用.ebextensions文件夹中的.config文件,

我正在尝试安装在AWS Elastic Beanstalk上具有C依赖项的python包(即:和)

Elastic Beanstalk python在Amazon Linux 2上默认使用
pip
pipenv
requirements.txt
安装软件包

但是,fbprophet和xgboost在C中有依赖项,需要在使用
pip
安装它们之前进行编译
conda
附带了这些预编译的库,因此使用
conda
安装它们要容易得多


我试过的 下面是我尝试使用
.ebextensions
文件夹中的
.config
文件,使用
conda
安装它们的过程:

commands:
  00_download_conda:
    command: 'wget http://repo.continuum.io/archive/Anaconda3-2020.02-Linux-x86_64.sh'
    test: test ! -d /anaconda
  01_install_conda:
    command: 'bash Anaconda3-2020.02-Linux-x86_64.sh -b -f -p /anaconda'
    test: test ! -d /anaconda
  02_reload_bash: 
    command: 'source ~/.bashrc'
  03_create_home:
    command: 'mkdir -p /home/wsgi'
  04_conda_env:
    command: 'conda env create -f environment.yml'
  05_activate_env:
    command: 'conda activate demo_forecast'
但是,这不起作用并引发以下错误:

[2020-04-21T18:18:22.285Z] INFO  [3699]  - [Application update app-8acc-200421_201612@4/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_0_test_empty_dash/Command 03_conda_env] : Activity execution failed, because: /bin/sh: conda: command not found
   (ElasticBeanstalk::ExternalInvocationError)


[2020-04-21T18:18:22.285Z] INFO  [3699]  - [Application update app-8acc-200421_201612@4/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_0_test_empty_dash/Command 03_conda_env] : Activity failed.

因此,似乎源代码
.bashrc
不会创建
conda
别名

我知道,但是它有点旧,没有为我的案例提供足够的细节,因为它没有通过使用
conda
安装软件包

另一种方法是在
pip
安装需求之前,尝试安装并编译C依赖项,但我目前还没有成功


谢谢你的帮助

你明白了吗?我预计在几天后部署时也会遇到同样的问题。我的基于ML模型的Flask应用程序太大,无法在Heroku上运行,因此正在尝试EBS。如果有用的话,我会更新。我最终使用了一个变通方法,在用PIP安装之前安装了C依赖项。你知道了吗?我预计在几天后部署时也会遇到同样的问题。我的基于ML模型的Flask应用程序太大,无法在Heroku上运行,因此正在尝试EBS。如果有什么效果,我会更新。在使用pip安装之前,我使用了一个变通方法并安装了C依赖项