Installation failed with standard install instructions - amazon-web-services

Following the instructions in the documentation, I attempt to create my new project, and get the following error:
EDIT: I should not post questions late at night. Added more detail to the terminal output. Prior to this, I verified pip was upgraded, djangocms-installer is installed and the virtualenv was installed.
(djangoenv) [ec2-user#web01 ~]$ djangocms jbi
Creating the project
Please wait while I install dependencies
If I am stuck for a long time, please check for connectivity / PyPi issues
Dependencies installed
Creating the project
The installation has failed.
*****************************************************************
Check documentation at https://djangocms-installer.readthedocs.io
*****************************************************************
Traceback (most recent call last):
File "/home/ec2-user/djangoenv/bin/djangocms", line 8, in <module>
sys.exit(execute())
File "/home/ec2-user/djangoenv/lib/python3.7/site-packages/djangocms_installer/main.py", line 44, in execute
django.setup_database(config_data)
File "/home/ec2-user/djangoenv/lib/python3.7/site-packages/djangocms_installer/django/__init__.py", line 353, in setup_database
output = subprocess.check_output(command, env=env, stderr=subprocess.STDOUT)
File "/usr/lib64/python3.7/subprocess.py", line 411, in check_output
**kwargs).stdout
File "/usr/lib64/python3.7/subprocess.py", line 512, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/home/ec2-user/djangoenv/bin/python', '-W', 'ignore', 'manage.py', 'migrate']' returned non-zero exit status 1.
Using Django inside a virtual environment created on an AWS EC2 instance, running Amazon Linux 2. I'm OK with burning the instance down and using another distro if the issue is the distro.

Related

googlecloudsdk.core.exceptions.RequiresAdminRightsError: You cannot perform this action because you do not have permission

I am trying to install google-cloud-sdk in ubuntu-18.04. I am following offical docs given here. When I run ./google-cloud-sdk/install.sh I get following error:-
Welcome to the Google Cloud SDK!
To help improve the quality of this product, we collect anonymized usage data
and anonymized stacktraces when crashes are encountered; additional information
is available at <https://cloud.google.com/sdk/usage-statistics>. This data is
handled in accordance with our privacy policy
<https://policies.google.com/privacy>. You may choose to opt in this
collection now (by choosing 'Y' at the below prompt), or at any time in the
future by running the following command:
gcloud config set disable_usage_reporting false
Do you want to help improve the Google Cloud SDK (y/N)? N
Traceback (most recent call last):
File "/home/vineet/./google-cloud-sdk/bin/bootstrapping/install.py", line 225, in <module>
main()
File "/home/vineet/./google-cloud-sdk/bin/bootstrapping/install.py", line 200, in main
Prompts(pargs.usage_reporting)
File "/home/vineet/./google-cloud-sdk/bin/bootstrapping/install.py", line 123, in Prompts
scope=properties.Scope.INSTALLATION)
File "/home/vineet/google-cloud-sdk/lib/googlecloudsdk/core/properties.py", line 2406, in PersistProperty
config.EnsureSDKWriteAccess()
File "/home/vineet/google-cloud-sdk/lib/googlecloudsdk/core/config.py", line 198, in EnsureSDKWriteAccess
raise exceptions.RequiresAdminRightsError(sdk_root)
googlecloudsdk.core.exceptions.RequiresAdminRightsError: You cannot perform this action because you do not have permission to modify the Google Cloud SDK installation directory [/home/vineet/google-cloud-sdk].
Re-run the command with sudo: sudo /home/vineet/google-cloud-sdk/bin/gcloud ...
I tried to search it on stackoverflow and github-issues but in vain.
Would appreciate any hint to solve it.
As stated on the error message.
Re-run the command with sudo: sudo /home/vineet/google-cloud-sdk/bin/gcloud ...
The install.sh script should be run using sudo.
There are also other alternatives to install the Google Cloud SDK in Ubuntu 18.04 just as installing the package with apt-get as explained on the documentation.

AWS DataPipeline Maching Learning AMI tensorflow issues

I'm running the AWS Machine Learning AMI on an EC2 instance. I've confirmed that from the terminal, both in python and jupyter can run
import tensorflow as tf
along with
python pytest.py
from the terminal (which contains the above tensorflow import), with no issues.
I'm now trying to automate my script using DataPipeline along with TaskRunner. The bash command in DataPipeline is again, just:
python pytest.py
However, Immediately get the following error:
Traceback (most recent call last): File "pytest.py", line 1, in
import tensorflow as tf File "/usr/lib/python2.7/dist-packages/tensorflow/init.py", line 24, in
from tensorflow.python import * File "/usr/lib/python2.7/dist-packages/tensorflow/python/init.py", line
72, in
raise ImportError(msg) ImportError: Traceback (most recent call last): File
"/usr/lib/python2.7/dist-packages/tensorflow/python/init.py", line
61, in
from tensorflow.python import pywrap_tensorflow File "/usr/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py",
line 28, in
_pywrap_tensorflow = swig_import_helper() File "/usr/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py",
line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description) ImportError: libcudart.so.7.5: cannot open shared object
file: No such file or directory
Failed to load the native TensorFlow runtime.
See
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#import_error
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
It seems like AWS DataPipeline (or TaskRunner?) uses a different enviornment setup, because again, I have no issues running the script through an ssh terminal to the instance. I found a few posts which suggested adding cuda to the LD_LIBRARY_PATH, but the AMI instance already has it:
echo $LD_LIBRARY_PATH
/home/ec2-user/src/torch/install/lib:/home/ec2-user/src/cntk/bindings/python/cntk/libs:/usr/local/cuda/lib64:/usr/local/lib:/usr/lib:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/mpi/lib:/home/ec2-user/src/mxnet/mklml_lnx_2017.0.1.20161005/lib:
which clearly contains the cuda librarypath that tensorflow needs.

webapp2 application not running locally

I am starting with webapp2. I have created an application at following directory.
/home/github_projects/hellowebapp2
But when I try to fire up a server using:
/usr/lib/google-cloud-sdk/bin/dev_appserver.py github_projects/hellowebapp2
I get following error:
This action requires the installation of components: [app-engine-python]
You cannot perform this action because this Cloud SDK installation is
managed by an external package manager. If you would like to get the
latest version, please see our main download page at:
https://cloud.google.com/sdk/
Traceback (most recent call last):
File "/usr/lib/google-cloud-sdk/bin/dev_appserver.py", line 35, in <module>
main()
File "/usr/lib/google-cloud-sdk/bin/dev_appserver.py", line 22, in main
command=__file__)
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/updater/update_manager.py", line 189, in EnsureInstalledAndRestart
return manager._EnsureInstalledAndRestart(components, msg, command)
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/updater/update_manager.py", line 1139, in _EnsureInstalledAndRestart
restart_args=restart_args):
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/updater/update_manager.py", line 660, in Install
restart_args=restart_args)
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/updater/update_manager.py", line 690, in Update
self._EnsureNotDisabled()
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/updater/update_manager.py", line 357, in _EnsureNotDisabled
'The component manager is disabled for this installation')
googlecloudsdk.core.updater.update_manager.UpdaterDisableError: The component manager is disabled for this installation
P.S I have already installed sdk from https://cloud.google.com/sdk/docs/#deb
Ok I solved this by installing specific python package from :
https://cloud.google.com/sdk/downloads#apt-get
sudo apt-get install google-cloud-sdk-app-engine-python

gsutil: ImportError: No module named google

As of Friday 11th of February, 2016, gsutil has suddenly stopped working. I run nightly backups using gsutil, and prior to executing I perform a gcloud components update.
$ gsutil --version
Traceback (most recent call last):
File "/home/IRUser/google-cloud-sdk/bin/bootstrapping/gsutil.py", line 12, in <module>
import bootstrapping
File "/home/IRUser/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 9, in <module>
import setup
File "/home/IRUser/google-cloud-sdk/bin/bootstrapping/setup.py", line 41, in <module>
reload(google)
ImportError: No module named google
If I manually pip install google, gsutil works fine again. However, I question that this somehow wasn't performed by gcloud components update.
My question: Isn't gcloud components update supposed to take care of any such dependencies?
I'm on CentOS 7.
This issue has been reported https://code.google.com/p/google-cloud-sdk/issues/detail?id=538
"google" package was included in previous releases of cloud sdk, but it is no longer needed.
On python installations (which have protobuf installed) "google" package is auto-imported on the startup the reload of existing google package can fail.
By installing it "google" with pip you made reload stop complaining about the module, even though it is not used.
Alternatively you can apply patches suggested in the above issue log.

Python pikascript.py fails from command prompt

I have a script in python which is used to connect to RabbitMQ server and consumes messages. When i tried to run the script from command prompt as "./pikascript.py" i am getting the proper output but the same script when i try to execute as "python pikascript.py" i get the following error:
WARNING:pika.adapters.base_connection:Connection to 16.125.72.210:5671 failed: [Errno 1] _ssl.c:503: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
Traceback (most recent call last):
File "pikascript.py", line 39, in <module>
ssl=True, ssl_options=ssl_options))
File "build\bdist.win-amd64\egg\pika\adapters\blocking_connection.py", line 130, in __init__
File "build\bdist.win-amd64\egg\pika\adapters\base_connection.py", line 72, in __init__
File "build\bdist.win-amd64\egg\pika\connection.py", line 600, in __init__
File "build\bdist.win-amd64\egg\pika\adapters\blocking_connection.py", line 230, in connect
File "build\bdist.win-amd64\egg\pika\adapters\blocking_connection.py", line 301, in _adapter_connect
pika.exceptions.AMQPConnectionError: Connection to 16.125.72.210:5671 failed: [Errno 1] _ssl.c:503: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
I gave the proper path in the environmenal variables. Are there any dependencies to run the pika libraries.. Could someone please help me out.
When I tried to run the script from command line as "./pikascript.py" it is referring to the python path in "C:\Python\python.exe", but when I run the same script as "python pikascript.py" it refers to another python path in the same machine, where setup tools and pika library are not installed properly.
So I started executing the script as "C:\Python\python.exe pikascript.py" and script gets executed without any error.