Face many issues to rasa initialization rasa init --no-prompt - python-3.x

I knew, its duplicate question, but I can't find the way to solve my issue.
I tried, tensorflow all versions.
Python 3.6.8
tensorflow = 1.15.0
Windows 10
Faced VC++ error, I installed VC++ 14
I tried via using condo, still facing the tensorflow issue.
I face the issue like, its created the project structure, but tensorflow.python.framework.errors
To get started quickly, an initial project will be created.
If you need some help, check out the documentation at https://rasa.com/docs/rasa.
Created project directory at 'C:\Users\Administrator\AppData\Local\Programs\Python\Python36\Scripts\venv\Scripts'.
Finished creating project structure.
Training an initial model...
Training Core model...
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\Scripts\venv\Scripts\rasa.exe\__main__.py", line 7, in <module>
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\rasa\__main__.py", line 92, in main
cmdline_arguments.func(cmdline_arguments)
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\rasa\cli\scaffold.py", line 206, in run
init_project(args, path)
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\rasa\cli\scaffold.py", line 118, in init_project
print_train_or_instructions(args, path)
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\rasa\cli\scaffold.py", line 58, in print_train_or_instructions
args.model = rasa.train(domain, config, training_files, output)
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\rasa\train.py", line 50, in train
additional_arguments=additional_arguments,
File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 583, in run_until_complete
return future.result()
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\rasa\train.py", line 101, in train_async
additional_arguments,
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\rasa\train.py", line 188, in _train_async_internal
additional_arguments=additional_arguments,
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\rasa\train.py", line 223, in _do_training
additional_arguments=additional_arguments,
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\rasa\train.py", line 361, in _train_core_with_validated_data
additional_arguments=additional_arguments,
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\rasa\core\train.py", line 43, in train
policies = config.load(policy_config)
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\rasa\core\config.py", line 28, in load
return PolicyEnsemble.from_dict(config_data)
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\rasa\core\policies\ensemble.py", line 308, in from_dict
constr_func = registry.policy_from_module_path(policy_name)
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\rasa\core\registry.py", line 21, in policy_from_module_path
module_path, lookup_path="rasa.core.policies.registry"
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\rasa\utils\common.py", line 220, in class_from_module_path
m = importlib.import_module(lookup_path)
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\rasa\core\policies\registry.py", line 5, in <module>
from rasa.core.policies.ted_policy import TEDPolicy
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\rasa\core\policies\ted_policy.py", line 8, in <module>
import tensorflow_addons as tfa
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\tensorflow_addons\__init__.py", line 21, in <module>
from tensorflow_addons import activations
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\tensorflow_addons\activations\__init__.py", line 21, in <module>
from tensorflow_addons.activations.gelu import gelu
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\tensorflow_addons\activations\gelu.py", line 24, in <module>
get_path_to_datafile("custom_ops/activations/_activation_ops.so"))
File "c:\users\administrator\appdata\local\programs\python\python36\scripts\venv\lib\site-packages\tensorflow_core\python\framework\load_library.py", line 61, in load_op_library
lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Invalid name: Addons>Gelu (Did you use CamelCase?); in OpDef: name: "Addons>Gelu" input_arg { name: "features" type_attr: "T" } output_arg { name: "activations" type_attr: "T" } attr { name: "T" type: "type" allowed_values { list { type: DT_HALF type: DT_FLOAT type: DT_DOUBLE } } } attr { name: "approximate" type: "bool" default_value { b: true } }```

rasa>=1.8 supports tensorflow 2 and tensorflow-text. However, tensorflow-text is not supported on Windows, which it looks like you're developing on. You can still use Rasa, but some pipelines will not be supported. I'd recommend this video tutorial for installing Rasa on Windows: https://www.youtube.com/watch?v=4ewIABo0OkU&t=1s

Related

XMLParser.__init__() takes 1 positional argument but 4 were given

I am getting this error while running the below command:-
Python version=3.10.8
Django version=2.1
openpyxl=2.6.2
python manage.py runserver 127.0.0.1:8000
Error:-
Exception ignored in thread started by: <function check_errors.<locals>.wrapper at 0x118793400>
Traceback (most recent call last):
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/django/utils/autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/django/utils/autoreload.py", line 248, in raise_last_exception
raise _exception[1]
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 337, in execute
autoreload.check_errors(django.setup)()
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/django/utils/autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/django/apps/registry.py", line 89, in populate
app_config = AppConfig.create(entry)
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/opt/homebrew/Cellar/python#3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/tablib/__init__.py", line 3, in <module>
from tablib.core import (
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/tablib/core.py", line 15, in <module>
from tablib import formats
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/tablib/formats/__init__.py", line 12, in <module>
from . import _xlsx as xlsx
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/tablib/formats/_xlsx.py", line 14, in <module>
import openpyxl
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/openpyxl/__init__.py", line 6, in <module>
from openpyxl.workbook import Workbook
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/openpyxl/workbook/__init__.py", line 5, in <module>
from .workbook import Workbook
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/openpyxl/workbook/workbook.py", line 8, in <module>
from openpyxl.worksheet.worksheet import Worksheet
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/openpyxl/worksheet/worksheet.py", line 30, in <module>
from openpyxl.cell import Cell, MergedCell
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/openpyxl/cell/__init__.py", line 4, in <module>
from .cell import Cell, WriteOnlyCell, MergedCell
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/openpyxl/cell/cell.py", line 52, in <module>
from openpyxl.styles.styleable import StyleableObject
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/openpyxl/styles/styleable.py", line 11, in <module>
from .builtins import styles
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/openpyxl/styles/builtins.py", line 1347, in <module>
('Normal', NamedStyle.from_tree(fromstring(normal))),
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/defusedxml/common.py", line 113, in fromstring
parser = DefusedXMLParser(target=_TreeBuilder(),
File "/Users/chandanvarma/Desktop/project/retailer-backend/venv/lib/python3.10/site-packages/defusedxml/ElementTree.py", line 68, in __init__
_XMLParser.__init__(self, html, target, encoding)
TypeError: XMLParser.__init__() takes 1 positional argument but 4 were given
I couldn't understand the exact issue behind this, If anyone has an idea how to resolve, please feel free share his/her suggestions.
The html argument of XMLParser() is deprecated in python3.7. You must to upgrade openpyxl to a newest version (at least 3.0.0):
https://openpyxl.readthedocs.io/en/stable/changes.html#id80

ModuleNotFoundError: No module named 'rest_framework' while building django app

When I tried to run my python django project in my environment using the command
python -m manage startapp product
it showed me this error
Traceback (most recent call last):
File "C:\Users\ASHU\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\ASHU\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\ASHU\Desktop\Django Project API\project1_django\manage.py", line 22, in <module>
main()
File "C:\Users\ASHU\Desktop\Django Project API\project1_django\manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\ASHU\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line
utility.execute()
File "C:\Users\ASHU\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\__init__.py", line 420, in execute
django.setup()
File "C:\Users\ASHU\AppData\Local\Programs\Python\Python310\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\ASHU\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\ASHU\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\config.py", line 193, in create
import_module(entry)
File "C:\Users\ASHU\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'rest_framework'
I have already installed my Django rest framework inside my project using
pip3 install djangorestframework
Can anyone help me to reslove this error

pip gives an AttributeError: module 'typing' has no attribute '_ClassVar'

I'm having trouble with pip on my Windows 10 system. If I try to do anything with pip (such as "pip -h") I get the following:
D:\Downloads\pip\pip-22.0.4>pip -h
Traceback (most recent call last):
File "C:\Program Files\Python310\Scripts\pip-script.py", line 33, in <module>
sys.exit(load_entry_point('pip==22.0.4', 'console_scripts', 'pip')())
File "C:\Program Files\Python310\Scripts\pip-script.py", line 25, in importlib_load_entry_point
return next(matches).load()
File "C:\Program Files\Python310\lib\importlib\metadata\__init__.py", line 171, in load
module = import_module(match.group('module'))
File "C:\Program Files\Python310\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\jxcla\AppData\Local\Programs\Python\Python39\Lib\site-packages\pip\_internal\cli\main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\Users\jxcla\AppData\Local\Programs\Python\Python39\Lib\site-packages\pip\_internal\cli\autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\Users\jxcla\AppData\Local\Programs\Python\Python39\Lib\site-packages\pip\_internal\cli\main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "C:\Users\jxcla\AppData\Local\Programs\Python\Python39\Lib\site-packages\pip\_internal\cli\cmdoptions.py", line 23, in <module>
from pip._internal.cli.parser import ConfigOptionParser
File "C:\Users\jxcla\AppData\Local\Programs\Python\Python39\Lib\site-packages\pip\_internal\cli\parser.py", line 12, in <module>
from pip._internal.configuration import Configuration, ConfigurationError
File "C:\Users\jxcla\AppData\Local\Programs\Python\Python39\Lib\site-packages\pip\_internal\configuration.py", line 20, in <module>
from pip._internal.exceptions import (
File "C:\Users\jxcla\AppData\Local\Programs\Python\Python39\Lib\site-packages\pip\_internal\exceptions.py", line 14, in <module>
from pip._vendor.rich.console import Console, ConsoleOptions, RenderResult
File "C:\Users\jxcla\AppData\Local\Programs\Python\Python39\Lib\site-packages\pip\_vendor\rich\console.py", line 55, in <module>
from .pretty import Pretty, is_expandable
File "C:\Users\jxcla\AppData\Local\Programs\Python\Python39\Lib\site-packages\pip\_vendor\rich\pretty.py", line 366, in <module>
class Node:
File "C:\Users\jxcla\AppData\Local\Programs\Python\Python36\Lib\site-packages\dataclasses.py", line 958, in dataclass
return wrap(_cls)
File "C:\Users\jxcla\AppData\Local\Programs\Python\Python36\Lib\site-packages\dataclasses.py", line 950, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
File "C:\Users\jxcla\AppData\Local\Programs\Python\Python36\Lib\site-packages\dataclasses.py", line 800, in _process_class
cls_fields = [_get_field(cls, name, type)
File "C:\Users\jxcla\AppData\Local\Programs\Python\Python36\Lib\site-packages\dataclasses.py", line 800, in <listcomp>
cls_fields = [_get_field(cls, name, type)
File "C:\Users\jxcla\AppData\Local\Programs\Python\Python36\Lib\site-packages\dataclasses.py", line 659, in _get_field
if (_is_classvar(a_type, typing)
File "C:\Users\jxcla\AppData\Local\Programs\Python\Python36\Lib\site-packages\dataclasses.py", line 550, in _is_classvar
return type(a_type) is typing._ClassVar
AttributeError: module 'typing' has no attribute '_ClassVar'. Did you mean: 'ClassVar'?
I'm not sure when this started happening and I've tried reinstalling pip in numerous ways, but no luck. Same error. I've searched for answers on the web, but nothing has fixed it for me.
I'm a bit of a noob when it comes to this, so it's entirely possible I've done something to gum up the works. Any help would be greatly appreciated.
John
This issue seems to be cropping up for me in a couple of my CI builds. One possible fix seems to be:
pip uninstall dataclasses -y
In my case, I don't know how dataclasses is getting installed (it's supposed to be a built-in not a dependency), but it failed last night when I unpinned the dependency scs.

waagent not deprovisioning on preparing debian VHD Azure

When running the final command which is sudo waagent –force -deprovision after preparing a Debian VHD for Kali but it keeps finishing with the below messages:
Traceback (most recent call last):
File "/usr/sbin/waagent", line 33, in <module>
sys.exit(load_entry_point('WALinuxAgent==2.2.47', 'console_scripts', 'waagent')())
File "/usr/sbin/waagent", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in load_unlocked
File "<frozen importlib.bootstrap_external>", line 790, in exec_module
File "<frozen importlib.bootstrap>", line 228, in call_with_frames_removed
File "/usr/lib/python3/dist-packages/azurelinuxagent/agent.py", line 34, in <module>
import azurelinuxagent.common.event as event
File "/usr/lib/python3/dist-packages/azurelinuxagent/common/event.py", line 632, in <module>
event_logger = EventLogger()
File "/usr/lib/python3/dist-packages/azurelinuxagent/common/event.py", line 304, in init
osutil = get_osutil()
File "/usr/lib/python3/dist-packages/azurelinuxagent/common/osutil/factory.py", line 50, in get_osutil
return _get_osutil(distro_name, distro_code_name, distro_version, distro_full_name)
File "/usr/lib/python3/dist-packages/azurelinuxagent/common/osutil/factory.py", line 79, in _get_osutil
return DebianOSBaseUtil()
NameError: name 'DebianOSBaseUtil' is not defined`
The deployment fails in Azure and I think this may be apart of that issue. I have reviewed their documentation and seen users having the same issue. Anyone ever faced this issue?
The original document in question that was used is this: https://learn.microsoft.com/en-us/azure/virtual-machines/linux/debian-create-upload-vhd
It looks like there is an error in the factory.py file.
try changing line 25 to add ", DebianOSBaseUtil" to the end of the import statement.

OSError: libgdal.so.27: cannot open shared object file: No such file or directory

I built a docker file that installs gdal and proj library on CentOS8.
After successfully installation of all dependencies, when i run my docker image i get OSError: libgdal.so.27: cannot open shared object file: No such file or directory.
Please how do i rectify this ?
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib64/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/devuser/.local/lib/python3.6/site-packages/django/utils/autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "/home/devuser/.local/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 110, in inner_run
autoreload.raise_last_exception()
File "/home/devuser/.local/lib/python3.6/site-packages/django/utils/autoreload.py", line 76, in raise_last_exception
raise _exception[1]
File "/home/devuser/.local/lib/python3.6/site-packages/django/core/management/__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "/home/devuser/.local/lib/python3.6/site-packages/django/utils/autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "/home/devuser/.local/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/devuser/.local/lib/python3.6/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/home/devuser/.local/lib/python3.6/site-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/devuser/.local/lib/python3.6/site-packages/django/contrib/auth/models.py", line 2, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "/home/devuser/.local/lib/python3.6/site-packages/django/contrib/auth/base_user.py", line 48, in <module>
class AbstractBaseUser(models.Model):
File "/home/devuser/.local/lib/python3.6/site-packages/django/db/models/base.py", line 122, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "/home/devuser/.local/lib/python3.6/site-packages/django/db/models/base.py", line 326, in add_to_class
value.contribute_to_class(cls, name)
File "/home/devuser/.local/lib/python3.6/site-packages/django/db/models/options.py", line 206, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "/home/devuser/.local/lib/python3.6/site-packages/django/db/__init__.py", line 28, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/home/devuser/.local/lib/python3.6/site-packages/django/db/utils.py", line 214, in __getitem__
backend = load_backend(db['ENGINE'])
File "/home/devuser/.local/lib/python3.6/site-packages/django/db/utils.py", line 111, in load_backend
return import_module('%s.base' % backend_name)
File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/devuser/.local/lib/python3.6/site-packages/django/contrib/gis/db/backends/postgis/base.py", line 6, in <module>
from .features import DatabaseFeatures
File "/home/devuser/.local/lib/python3.6/site-packages/django/contrib/gis/db/backends/postgis/features.py", line 1, in <module>
from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures
File "/home/devuser/.local/lib/python3.6/site-packages/django/contrib/gis/db/backends/base/features.py", line 3, in <module>
from django.contrib.gis.db import models
File "/home/devuser/.local/lib/python3.6/site-packages/django/contrib/gis/db/models/__init__.py", line 3, in <module>
import django.contrib.gis.db.models.functions # NOQA
File "/home/devuser/.local/lib/python3.6/site-packages/django/contrib/gis/db/models/functions.py", line 3, in <module>
from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField
File "/home/devuser/.local/lib/python3.6/site-packages/django/contrib/gis/db/models/fields.py", line 3, in <module>
from django.contrib.gis import forms, gdal
File "/home/devuser/.local/lib/python3.6/site-packages/django/contrib/gis/forms/__init__.py", line 3, in <module>
from .fields import ( # NOQA
File "/home/devuser/.local/lib/python3.6/site-packages/django/contrib/gis/forms/fields.py", line 2, in <module>
from django.contrib.gis.gdal import GDALException
File "/home/devuser/.local/lib/python3.6/site-packages/django/contrib/gis/gdal/__init__.py", line 28, in <module>
from django.contrib.gis.gdal.datasource import DataSource
File "/home/devuser/.local/lib/python3.6/site-packages/django/contrib/gis/gdal/datasource.py", line 39, in <module>
from django.contrib.gis.gdal.driver import Driver
File "/home/devuser/.local/lib/python3.6/site-packages/django/contrib/gis/gdal/driver.py", line 5, in <module>
from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi
File "/home/devuser/.local/lib/python3.6/site-packages/django/contrib/gis/gdal/prototypes/ds.py", line 9, in <module>
from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal
File "/home/devuser/.local/lib/python3.6/site-packages/django/contrib/gis/gdal/libgdal.py", line 50, in <module>
lgdal = CDLL(lib_path)
File "/usr/lib64/python3.6/ctypes/__init__.py", line 343, in __init__
self._handle = _dlopen(self._name, mode)
OSError: libgdal.so.27: cannot open shared object file: No such file or directory
What i've tried
DISCLAIMER: I really do not understand why i did all of these and i don't know what they mean. I just want to install gdal for geodjango
RUN echo /usr/local/lib >> /etc/ld.so.conf.d/usrlocal.conf
RUN touch /etc/ld.so.conf.d/libgdal-x86_64.conf
RUN echo "/usr/local/lib" >> /etc/ld.so.conf.d/libgdal-x86_64.conf
Django recommends doing this
RUN export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

Resources