I am trying to deploy a basic web application using Elastic Beanstalk from AWS.
My app is written in python and uses pyTorch library so it can import NLP model named "bart-cnn-large" (with it I can produce text summarization).
I have a file named requirements.txt and with it the EC2 sets the virtual environment.
However, it always fails when trying to install the pytorch library.
If I remove "torch" from the requirements.txt then the installation doesn't fail anymore.
but I get this message:
None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models
won't be available and only tokenizers, configuration and file/data
utilities can be used.
If I leave "torch" in requirements I get this message:
2021/08/06 10:54:23.688955 [ERROR] An error occurred during execution
of command [app-deploy] - [InstallDependency]. Stop running the
command. Error: fail to install dependencies with requirements.txt
file with error Command /bin/sh -c
/var/app/venv/staging-LQM1lest/bin/pip install -r requirements.txt
failed with error exit status 1. Stderr:ERROR: Invalid requirement:
'torch==1.9.0+cu102 torchvision==0.10.0+cu102 torchaudio===0.9.0'
(from line 1 of requirements.txt)
the requirments.txt content:
>torch==1.9.0+cu102 torchvision==0.10.0+cu102 torchaudio===0.9.0 -f
https://download.pytorch.org/whl/torch_stable.html
Flask~=2.0.1
Werkzeug~=2.0.1
tika~=1.24
beautifulsoup4~=4.8.2
docx2txt~=0.8
transformers~=4.8.2
clean-text
I tried several versions of "pip torch" but none seems to work.
is this a storage problem? why won't it install?
Related
I have been trying for a long time to find a solution to the scrapyd error message: pkg_resources.DistributionNotFound: The 'idna<3,>=2.5' distribution was not found and is required by requests
What I have done:
$ docker pull ceroic/scrapyd
$ docker build -t scrapyd .
Dockerfile:
FROM ceroic/scrapyd
RUN pip install "idna==2.5"
$ docker build -t scrapyd .
Sending build context to Docker daemon 119.3kB
Step 1/2 : FROM ceroic/scrapyd
---> 868dca3c4d94
Step 2/2 : RUN pip install "idna==2.5"
---> Running in c0b6f6f73cf1
Downloading/unpacking idna==2.5
Installing collected packages: idna
Successfully installed idna
Cleaning up...
Removing intermediate container c0b6f6f73cf1
---> 849200286b7a
Successfully built 849200286b7a
Successfully tagged scrapyd:latest
I run the container:
$ docker run -d -p 6800:6800 scrapyd
Next:
scrapyd-deploy demo -p tutorial
And get error:
pkg_resources.DistributionNotFound: The 'idna<3,>=2.5' distribution was not found and is required by requests
I'm not a Docker expert, and I don't understand the logic. If idna==2.5 has been successfully installed inside the container, why does the error message require version 'idna<3,>=2.5'?
The answer is very simple. I finished my 3 days! torment. When I run the
scrapyd-deploy demo -p tutorial
then I do it not in the created container, but outside it.
The problem was solved by:
pip uninstall idna
pip install "idna == 2.5"
This was to be done on a virtual server, not a container. I can't believe I didn't understand it right away.
I am getting the following error when trying to deploy my build release for a python/flask web app:-
I created a python command task with the following -
pip install --upgrade
However, error persists.
I'd suggest you try to disable\suppress this error\warning (because its pretty harmless):
[global]
disable-pip-version-check = True
On many linux the default location for the pip configuration file is $HOME/.config/pip/pip.conf. You can always look that up in the docs.
I'm trying to deploy a Flak Restful API to azure.
I have set up continuous deployment with a Github repo.
The deployment is failing on one of the requirements.txt
returning the following error:
ValueError: ('Expected version spec in', 'azure-common ~=1.1.4', 'at', ' ~=1.1.4')
The application is running fine locally.
I'm new to the Azure platform and the config and deploy files are quite confusing I'm not sure if the problem is with these or the package in the virtual environment.
You need to update pip, as I guess the version is old enough to do not support the "~=" syntax in the setup.py of the packages you install.
For examples:
ValueError "Expected version spec" when installing local wheel via pip
How to fix error “Expected version spec in …” using pip install on Windows?
I was trying to install keras (for using LSTM) on my Windows 10 system in Anaconda using the method provided by Yelaman. But after running the command pip install git+git://github.com/Theano/Theano.git, I received the following fatal error -
C:\Anaconda>pip install git+git://github.com/Theano/Theano.git
Collecting git+git://github.com/Theano/Theano.git
Cloning git://github.com/Theano/Theano.git to
c:\users\krishna\appdata\local\temp\pip-reettr-build fatal: protocol
error: bad line length character:
Er
Command "git clone -q git://github.com/Theano/Theano.git
c:\users\krishna\appdata\local\temp\pip-reettr-build" failed with
error code 128 in None
I don't have a github account but i use git using bitbucket (if that matters).
Could anyone explain to me what error I am committing and if there is a way out? My main goal is to use keras in Anaconda in Windows.
Thanks!
It seems that the error may be because we have a git repository listed as a dependency. Not still fully sure, though. (Source)
The solution is to replace pip install git+git://github.com/Theano/Theano.git with pip install git+http://github.com/Theano/Theano.git i.e. replacing the second git with http (this works since the repository is public)
I have developed a Flask web application that works on my local computer but which I am now trying to port onto the web (via IBM Bluemix). My first attempt to do so was unsuccessful. The error message I receive is:
Server error, status code: 400, error code: 170001, message: Staging error: no available stagers
When I check the log files with cf logs myapp --recent I find:
2015-11-08T15:34:15.92-0500 [STG/35] OUT -----> Downloaded app package (72K)
2015-11-08T15:34:19.98-0500 [STG/35] OUT -----> Downloaded app buildpack cache (39M)
2015-11-08T15:34:24.82-0500 [STG/0] OUT -------> Buildpack version 1.3.1
2015-11-08T15:34:40.57-0500 [STG/0] OUT -----> Installing dependencies with pip
2015-11-08T15:34:41.54-0500 [STG/0] OUT You are using pip version 6.1.0.dev0, however version 7.1.2 is available.
2015-11-08T15:34:41.54-0500 [STG/0] OUT You should consider upgrading via the 'pip install --upgrade pip' command.
2015-11-08T15:34:41.56-0500 [STG/0] OUT Collecting flask.ext.wtf (from -r requirements.txt (line 2))
2015-11-08T15:34:41.88-0500 [STG/0] OUT Could not find a version that satisfies the requirement flask.ext.wtf (from -r requirements.txt (line 2)) (from versions: )
2015-11-08T15:34:41.88-0500 [STG/0] OUT No matching distribution found for flask.ext.wtf (from -r requirements.txt (line 2))
2015-11-08T15:34:41.96-0500 [STG/0] OUT Staging failed: Buildpack compilation step failed
2015-11-08T15:34:41.97-0500 [STG/0] ERR
2015-11-08T15:34:42.67-0500 [API/2] ERR encountered error: App staging failed in the buildpack compile phase
2015-11-08T15:35:37.75-0500 [API/3] OUT Updated app with guid b580bb64-4415-4bb4-8fd1-1e4d3de4f7d9 ({"name"=>"cultural-insight", "memory"=>128, "environment_json"=>"PRIVATE DATA HIDDEN"})
2015-11-08T15:35:49.95-0500 [API/3] OUT Updated app with guid b580bb64-4415-4bb4-8fd1-1e4d3de4f7d9 ({"state"=>"STOPPED"})
2015-11-08T15:35:52.41-0500 [DEA/113] OUT Got staging request for app with id b580bb64-4415-4bb4-8fd1-1e4d3de4f7d9
2015-11-08T15:35:52.47-0500 [API/0] ERR exception handling first response Staging error: failed to stage application:
2015-11-08T15:35:52.47-0500 [API/0] ERR Not enough memory resources available
2015-11-08T15:50:52.42-0500 [API/0] ERR encountered error: Staging error: failed to stage application: staging had already been marked as failed, this could mean that staging took too long
The problem appears to be that pip can't find Flask-WTF, which I need for my application to work.
I installed Flask-WTF on my local machine with pip install Flask-WTF. The contents of requirements.txt, which the builder ingests while setting up, is simply:
Flask==0.10.1
Flask-WTF
In particular, I am unsure why pip is asking for flask.ext.wtf? Additionally it is troubling me that the application says it is limited to 128 MB, when I bumped it up to 512 MB.
Altogether, I'm not sure what's going on. How do I resolve this issue? The full source code is here.
run this (EDITED):
pip install --upgrade pip
and update your requirements.txt file:
pip freeze > requirements.txt