During installing of apache superset, while "superset db upgrade" - apache-superset

Traceback (most recent call last):
File "C:\Users\ACER\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\ACER\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\ACER\Virtual_environment\venv\Scripts\superset.exe_main.py", line 4, in
ModuleNotFoundError: No module named 'superset'

The virtual environment you are using to run "superset db upgrade" has no superset installation. Confirm you are running the right virtual environment

Related

Trying to install Django reversion

I'm trying to setup a Django project but Im getting this:
python2.7 manage.py migrate
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 338, in execute
django.setup()
File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 94, in create
module = import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named reversion
So I'm trying to instal reversion, but I'm getting this error message when trying to installenter code here it:
$sudo pip install django-reversion
Downloading/unpacking django-reversion
Downloading django-reversion-3.0.7.tar.gz (67kB): 67kB downloaded
Running setup.py (path:/tmp/pip_build_root/django-reversion/setup.py) egg_info for package django-reversion
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/django-reversion/setup.py", line 28, in <module>
long_description=read('README.rst'),
File "/tmp/pip_build_root/django-reversion/setup.py", line 19, in read
with open(filepath, "r", encoding="utf-8") as f:
TypeError: 'encoding' is an invalid keyword argument for this function
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/django-reversion/setup.py", line 28, in <module>
long_description=read('README.rst'),
File "/tmp/pip_build_root/django-reversion/setup.py", line 19, in read
with open(filepath, "r", encoding="utf-8") as f:
TypeError: 'encoding' is an invalid keyword argument for this function
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/django-reversion
Storing debug log for failure in /home/tirengarfio/.pip/pip.log
I'm on Ubuntu 16.04 and python 2.7.
That Python3-only open() was added with version 3.0.6. Try earlier versions, 3.0.5 or 3.0.4:
pip install django-reversion==3.0.5
or
pip install django-reversion==3.0.4
Django 3 supports python versions 3.6 and above.
Here is the official Django 3.0 release notes

Failed Manage.py runserver command

I'm a beginner in web development. I'm using pycharm and django 2.1 framework
I installed django using ('py -m pip install django==2.1') and it is done.
I started myweb project using ('py -m django-admin startproject myweb .') and it also done
but when I try ('manage.py runserver') command, this is the result:
(venv) C:\Users\مرحبا\PycharmProjects\Myweb>manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
March 27, 2020 - 20:08:58
Django version 3.0.4, using settings 'myweb.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Exception in thread <bound method Thread.name of <Thread(django-main-thread,
started
daemon 5152)>>:
Traceback (most recent call last):
File "C:\Users\مرحبا\AppData\Local\Programs\lib\threading.py", line 917, in
_bootstrap_inner
self.run()
File "C:\Users\مرحبا\AppData\Local\Programs\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\django\core\management\commands\runserver.py", line 139, in inner_run
ipv6=self.use_ipv6, threading=threading, server_cls=self.server_cls)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\django\core\servers\basehttp.py", line 206, in run
httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\django\core\servers\basehttp.py", line 67, in __init__
super().__init__(*args, **kwargs)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\socketserver.py", line 449, in
__init__
self.server_bind()
File "C:\Users\مرحبا\AppData\Local\Programs\lib\wsgiref\simple_server.py", line
50,
in server_bind
HTTPServer.server_bind(self)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\http\server.py", line 139, in
server_bind
self.server_name = socket.getfqdn(host)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\socket.py", line 680, in getfqdn
aliases.insert(0, hostname)
AttributeError: 'str' object has no attribute 'insert'
Could you help me please?
In the last line of the error it says
aliases.insert(0, hostname) AttributeError: 'str' object has no attribute 'insert'
Your Aliases variables is a string, not a list, so you can't .insert() to it, as that functionality doesn't exist.
You need to make sure Aliases is a list in your code.

Third party tool ecs-deploy getting error while deploying

I have installed thrid party tool pip install ecs-deploy from https://github.com/fabfuel/ecs-deploy When I try to deploy ecs deploy demo-cluster demo-service I am getting some error
[ec2-user#ip-172-32-82-233 ~]$ ecs deploy demo-cluster demo-service
Traceback (most recent call last):
File "/usr/local/bin/ecs", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3049, in <module>
#_call_aside
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3033, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3062, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 660, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 673, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 863, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (botocore 1.12.92 (/usr/lib/python2.7/dist-packages), Requirement.parse('botocore<1.15.0,>=1.14.9'), set(['boto3']))
I just uninstalled aws-cli and installed again by taking reference of this https://docs.aws.amazon.com/cli/latest/userguide/install-linux.html. It worked

eb cli error message Traceback (most recent call last):

I tried to install eb cli throw pip or msi and i always get the same wierd message after i check if eb was installed successfully:
PS C:\Users\liron> eb --version
Traceback (most recent call last):
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 570, in _build_master
ws.require(requires)
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 888, in require
needed = self.resolve(parse_requirements(requirements))
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 779, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (colorama 0.3.9 (c:\users\liron\appdata\roaming\python\python36\site-packages), Requirement.parse('colorama==0.3.7'), {'awsebcli'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\liron\AppData\Roaming\Python\Scripts\eb-script.py", line 6, in
from pkg_resources import load_entry_point
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 3095, in
#_call_aside
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 3079, in _call_aside
f(*args, **kwargs)
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 3108, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 572, in _build_master
return cls._build_from_requirements(requires)
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 585, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 779, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (colorama 0.3.7 (c:\users\liron\appdata\roaming\python\lib\site-packages), Requirement.parse('colorama<0.4,>=0.3.9; sys_platform == "win32"'), {'docker-compose'})
i tried to install with pip and msi.
aws version: aws-cli/1.15.35 Python/3.6.0 Windows/7 botocore/1.10.35
python version: Python 3.6.3
pip version: pip 10.0.1 from c:\users\liron\appdata\roaming\python\lib\site-packages\pip (python 3.6).
i tried to update and uninstall everything without any luck.
thank you for your help :)

Cannot successfully merge devserver patches together for deployment to Heroku

I have tried to push my new code to Heroku but I experiencing an ImportError which says:
Starting process with command `python manage.py runserver --insecure 0.0.0.0:13192 --noreload`
Traceback (most recent call last):
execute_from_command_line(sys.argv
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "manage.py", line 10, in <module>
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
from django.core.servers.basehttp import AdminMediaHandler, WSGIServerException, \
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
File "/app/.heroku/python/lib/python2.7/site-packages/devserver/management/commands/runserver.py", line 3, in <module>
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 77, in load_command_class
utility.execute()
ImportError: cannot import name AdminMediaHandler
I have found in the documentation that django.core.servers.basehttp.AdminMediaHandler from 1.4 would be replaced with django.contrib.staticfiles.handlers.StaticFilesHandler. My question is where do I place the StaticFilesHandler in place of the AdminMediaHandler?
Update:
I have now tried to merge the two patches together by placing git+git://github.com/dcramer/django-devserver#egg=django-devserver in my requirements. But I am still receiving the same error when trying to deploy
No need to try and merge the patches of django-devserver together. Django-devserver 0.5.0 is compatible with Django 1.5, once I placed 'django-deveserver 0.5.0' in my requirements.txt my app could deploy without crashing.