我正在尝试部署一个利用MSSQL Server的Django项目。我正在尝试使用AWS Elastic Beanstalk进行部署。如果有人可以帮助我,我将非常感激。
我的计算机上运行的是GCC和G ++,所以我不确定为什么这会引起任何问题。我四处搜寻,却找不到任何与我的直接相关的解决方案,而且我不确定从这里前进。
这是requirements.txt
astroid==1.6.5
awsebcli==3.14.6
botocore==1.12.9
cement==2.8.2
colorama==0.3.9
Django==2.0.6
django-mssql==1.8
django-pyodbc-azure==2.0.6.1
django-sendgrid-v5==0.6.893
docutils==0.14
future==0.16.0
isort==4.3.4
jmespath==0.9.3
lazy-object-proxy==1.3.1
mccabe==0.6.1
mysql-connector-python-rf==2.2.2
pathspec==0.5.5
pylint==1.9.2
PyMySQL==0.8.1
pyodbc==4.0.23
pypyodbc==1.3.3.1
python-dateutil==2.7.3
python-http-client==3.1.0
pytz==2018.5
PyYAML==3.13
semantic-version==2.5.0
sendgrid==5.4.1
six==1.11.0
style==1.1.0
termcolor==1.1.0
update==0.0.1
urllib3==1.22
wrapt==1.10.11
这是我的日志,特别是eb-activity部分
Running setup.py bdist_wheel for pyodbc: started
Running setup.py bdist_wheel for pyodbc: finished with status 'error'
Complete output from command /opt/python/run/venv/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1cdwy0uv/pyodbc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpxf7u3lwwpip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYODBC_VERSION=4.0.23 -I/usr/include/python3.6m -c src/pyodbcmodule.cpp -o build/temp.linux-x86_64-3.6/src/pyodbcmodule.o -Wno-write-strings
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status
Failed building wheel for pyodbc
Running setup.py clean for pyodbc
Failed to build pyodbc
Installing collected packages: pyodbc, django-pyodbc-azure, future, python-http-client, sendgrid, django-sendgrid-v5, isort, mccabe, mysql-connector-python-rf, pylint, PyMySQL, pypyodbc, style, update
Running setup.py install for pyodbc: started
Running setup.py install for pyodbc: finished with status 'error'
Complete output from command /opt/python/run/venv/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1cdwy0uv/pyodbc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-wpg4l1dm-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/python/run/venv/include/site/python3.6/pyodbc:
running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYODBC_VERSION=4.0.23 -I/usr/include/python3.6m -c src/pyodbcmodule.cpp -o build/temp.linux-x86_64-3.6/src/pyodbcmodule.o -Wno-write-strings
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1
答案 0 :(得分:0)
如果您还没有.ebextensions
目录,请创建一个目录,并向其中添加一个名为01_packages.config
的文件,其内容如下:
packages:
yum:
gcc-c++: []
unixODBC-devel: []
在控制台上运行eb deploy
时,在.ebextensions
文件上AWS运行pip install
之前,将处理requirements.txt
目录中的配置文件,您应该已安装满足您pypyodbc==1.3.3.1
要求的正确软件包。