anaconda3/bin/python: undefined symbol: archive_errno - python

I installed Anaconda 4.7.10 on Ubuntu 16.04.2 LTS and everything worked smoothly.
After a couple of days I wanted to install "sqlalchemy" but this time I got the error message below. Since then almost every conda command yields the message below. Includingconda update --all and conda upgrade.
Any suggestions?
Traceback (most recent call last):
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1062, in __call__
return func(*args, **kwargs)
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 84, in _main
exit_code = do_call(args, p)
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 80, in do_call
module = import_module(relative_mod, __name__.rsplit('.', 1)[0])
File "/home/martin/anaconda3/lib/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/martin/anaconda3/lib/python3.6/site-packages/conda/cli/main_install.py", line 8, in <module>
from .install import install
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda/cli/install.py", line 19, in <module>
from ..core.index import calculate_channel_urls, get_index
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda/core/index.py", line 9, in <module>
from .package_cache_data import PackageCacheData
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda/core/package_cache_data.py", line 15, in <module>
from conda_package_handling.api import InvalidArchiveError
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda_package_handling/api.py", line 3, in <module>
from libarchive.exception import ArchiveError as _LibarchiveArchiveError
File "/home/martin/anaconda3/lib/python3.6/site-packages/libarchive/__init__.py", line 1, in <module>
from .entry import ArchiveEntry
File "/home/martin/anaconda3/lib/python3.6/site-packages/libarchive/entry.py", line 6, in <module>
from . import ffi
File "/home/martin/anaconda3/lib/python3.6/site-packages/libarchive/ffi.py", line 108, in <module>
errno = ffi('errno', [c_archive_p], c_int)
File "/home/martin/anaconda3/lib/python3.6/site-packages/libarchive/ffi.py", line 95, in ffi
f = getattr(libarchive, 'archive_'+name)
File "/home/martin/anaconda3/lib/python3.6/ctypes/__init__.py", line 361, in __getattr__
func = self.__getitem__(name)
File "/home/martin/anaconda3/lib/python3.6/ctypes/__init__.py", line 366, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /home/martin/anaconda3/bin/python: undefined symbol: archive_errno
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/martin/anaconda3/bin/conda", line 13, in <module>
sys.exit(main())
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 150, in main
return conda_exception_handler(_main, *args, **kwargs)
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1354, in conda_exception_handler
return_value = exception_handler(func, *args, **kwargs)
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1065, in __call__
return self.handle_exception(exc_val, exc_tb)
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1109, in handle_exception
return self.handle_unexpected_exception(exc_val, exc_tb)
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1120, in handle_unexpected_exception
self.print_unexpected_error_report(error_report)
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1190, in print_unexpected_error_report
from .cli.main_info import get_env_vars_str, get_main_info_str
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda/cli/main_info.py", line 19, in <module>
from ..core.index import _supplement_index_with_system
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda/core/index.py", line 9, in <module>
from .package_cache_data import PackageCacheData
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda/core/package_cache_data.py", line 15, in <module>
from conda_package_handling.api import InvalidArchiveError
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda_package_handling/api.py", line 7, in <module>
from .tarball import CondaTarBZ2 as _CondaTarBZ2
File "/home/martin/anaconda3/lib/python3.6/site-packages/conda_package_handling/tarball.py", line 7, in <module>
import libarchive
File "/home/martin/anaconda3/lib/python3.6/site-packages/libarchive/__init__.py", line 1, in <module>
from .entry import ArchiveEntry
File "/home/martin/anaconda3/lib/python3.6/site-packages/libarchive/entry.py", line 6, in <module>
from . import ffi
File "/home/martin/anaconda3/lib/python3.6/site-packages/libarchive/ffi.py", line 108, in <module>
errno = ffi('errno', [c_archive_p], c_int)
File "/home/martin/anaconda3/lib/python3.6/site-packages/libarchive/ffi.py", line 95, in ffi
f = getattr(libarchive, 'archive_'+name)
File "/home/martin/anaconda3/lib/python3.6/ctypes/__init__.py", line 361, in __getattr__
func = self.__getitem__(name)
File "/home/martin/anaconda3/lib/python3.6/ctypes/__init__.py", line 366, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /home/martin/anaconda3/bin/python: undefined symbol: archive_errno

I've came across the same error on my conda installation in windows subsystem for linux and could solve it by installing libarchive-dev. This seems to be some kind of hidden dependency, libarchive was not installed on my system previously.
apt-get install libarchive-dev

Related

Conda is broken

I am having a really annoying problem. Conda seems to be broken on Mac and I am getting a permission denied to uninstall and install. Not a huge deal since I am using conda in ec2 most of the time, but I am hoping to learn what the problem is. If I run a simple code such as "conda update conda" from command I am getting the error below. "conda --version" gives me 4.11
conda update conda
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.8/site-packages/conda/exceptions.py", line 1080, in __call__
return func(*args, **kwargs)
File "/opt/anaconda3/lib/python3.8/site-packages/conda/cli/main.py", line 84, in _main
exit_code = do_call(args, p)
File "/opt/anaconda3/lib/python3.8/site-packages/conda/cli/conda_argparse.py", line 81, in do_call
module = import_module(relative_mod, __name__.rsplit('.', 1)[0])
File "/opt/anaconda3/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 843, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/opt/anaconda3/lib/python3.8/site-packages/conda/cli/main_update.py", line 8, in <module>
from .install import install
File "/opt/anaconda3/lib/python3.8/site-packages/conda/cli/install.py", line 19, in <module>
from ..core.index import calculate_channel_urls, get_index
File "/opt/anaconda3/lib/python3.8/site-packages/conda/core/index.py", line 13, in <module>
from .package_cache_data import PackageCacheData
File "/opt/anaconda3/lib/python3.8/site-packages/conda/core/package_cache_data.py", line 14, in <module>
from .path_actions import CacheUrlAction, ExtractPackageAction
File "/opt/anaconda3/lib/python3.8/site-packages/conda/core/path_actions.py", line 30, in <module>
from ..gateways.connection.download import download
File "/opt/anaconda3/lib/python3.8/site-packages/conda/gateways/connection/download.py", line 14, in <module>
from .session import CondaSession
File "/opt/anaconda3/lib/python3.8/site-packages/conda/gateways/connection/session.py", line 13, in <module>
from .adapters.s3 import S3Adapter
File "/opt/anaconda3/lib/python3.8/site-packages/conda/gateways/connection/adapters/s3.py", line 14, in <module>
boto3.client('s3') # https://github.com/conda/conda/issues/8993
File "/opt/anaconda3/lib/python3.8/site-packages/boto3/__init__.py", line 93, in client
return _get_default_session().client(*args, **kwargs)
File "/opt/anaconda3/lib/python3.8/site-packages/boto3/session.py", line 258, in client
return self._session.create_client(
File "/opt/anaconda3/lib/python3.8/site-packages/botocore/session.py", line 847, in create_client
client = client_creator.create_client(
File "/opt/anaconda3/lib/python3.8/site-packages/botocore/client.py", line 86, in create_client
client_args = self._get_client_args(
File "/opt/anaconda3/lib/python3.8/site-packages/botocore/client.py", line 355, in _get_client_args
return args_creator.get_client_args(
File "/opt/anaconda3/lib/python3.8/site-packages/botocore/args.py", line 99, in get_client_args
endpoint = endpoint_creator.create_endpoint(
File "/opt/anaconda3/lib/python3.8/site-packages/botocore/endpoint.py", line 287, in create_endpoint
raise ValueError("Invalid endpoint: %s" % endpoint_url)
ValueError: Invalid endpoint: https://s3..amazonaws.com
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/anaconda3/bin/conda", line 13, in <module>
sys.exit(main())
File "/opt/anaconda3/lib/python3.8/site-packages/conda/cli/main.py", line 152, in main
return conda_exception_handler(_main, *args, **kwargs)
File "/opt/anaconda3/lib/python3.8/site-packages/conda/exceptions.py", line 1372, in conda_exception_handler
return_value = exception_handler(func, *args, **kwargs)
File "/opt/anaconda3/lib/python3.8/site-packages/conda/exceptions.py", line 1083, in __call__
return self.handle_exception(exc_val, exc_tb)
File "/opt/anaconda3/lib/python3.8/site-packages/conda/exceptions.py", line 1127, in handle_exception
return self.handle_unexpected_exception(exc_val, exc_tb)
File "/opt/anaconda3/lib/python3.8/site-packages/conda/exceptions.py", line 1138, in handle_unexpected_exception
self.print_unexpected_error_report(error_report)
File "/opt/anaconda3/lib/python3.8/site-packages/conda/exceptions.py", line 1208, in print_unexpected_error_report
from .cli.main_info import get_env_vars_str, get_main_info_str
File "/opt/anaconda3/lib/python3.8/site-packages/conda/cli/main_info.py", line 19, in <module>
from ..core.index import _supplement_index_with_system
File "/opt/anaconda3/lib/python3.8/site-packages/conda/core/index.py", line 13, in <module>
from .package_cache_data import PackageCacheData
File "/opt/anaconda3/lib/python3.8/site-packages/conda/core/package_cache_data.py", line 14, in <module>
from .path_actions import CacheUrlAction, ExtractPackageAction
File "/opt/anaconda3/lib/python3.8/site-packages/conda/core/path_actions.py", line 30, in <module>
from ..gateways.connection.download import download
File "/opt/anaconda3/lib/python3.8/site-packages/conda/gateways/connection/download.py", line 14, in <module>
from .session import CondaSession
File "/opt/anaconda3/lib/python3.8/site-packages/conda/gateways/connection/session.py", line 13, in <module>
from .adapters.s3 import S3Adapter
File "/opt/anaconda3/lib/python3.8/site-packages/conda/gateways/connection/adapters/s3.py", line 14, in <module>
boto3.client('s3') # https://github.com/conda/conda/issues/8993
File "/opt/anaconda3/lib/python3.8/site-packages/boto3/__init__.py", line 93, in client
return _get_default_session().client(*args, **kwargs)
File "/opt/anaconda3/lib/python3.8/site-packages/boto3/session.py", line 258, in client
return self._session.create_client(
File "/opt/anaconda3/lib/python3.8/site-packages/botocore/session.py", line 847, in create_client
client = client_creator.create_client(
File "/opt/anaconda3/lib/python3.8/site-packages/botocore/client.py", line 86, in create_client
client_args = self._get_client_args(
File "/opt/anaconda3/lib/python3.8/site-packages/botocore/client.py", line 355, in _get_client_args
return args_creator.get_client_args(
File "/opt/anaconda3/lib/python3.8/site-packages/botocore/args.py", line 99, in get_client_args
endpoint = endpoint_creator.create_endpoint(
File "/opt/anaconda3/lib/python3.8/site-packages/botocore/endpoint.py", line 287, in create_endpoint
raise ValueError("Invalid endpoint: %s" % endpoint_url)
ValueError: Invalid endpoint: https://s3..amazonaws.com

How to fix: "HadoopFileSystem load error: libhdfs.so: cannot open shared object file: No such file or directory 10:49:33 Traceback"?

I have a project in which I use a rq worker in conjuction with tensorflow to predict the genre of songs recorded on a microphone (Raspberry pi4).
The problem is: when i use the function to predict the genre i get an error on the rq worker that says:
2021-09-13 10:49:30.246680: E tensorflow/core/platform/hadoop/hadoop_file_system.cc:132] HadoopFileSystem load error: libhdfs.so: cannot open shared object file: No such file or directory
10:49:33 Traceback (most recent call last):
File "/home/pi/.local/lib/python3.7/site-packages/rq/worker.py", line 1031, in perform_job
rv = job.perform()
File "/home/pi/.local/lib/python3.7/site-packages/rq/job.py", line 749, in perform
self._result = self._execute()
File "/home/pi/.local/lib/python3.7/site-packages/rq/job.py", line 772, in _execute
result = self.func(*self.args, **self.kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/rq/job.py", line 225, in func
return import_attribute(self.func_name)
File "/home/pi/.local/lib/python3.7/site-packages/rq/utils.py", line 142, in import_attribute
module = importlib.import_module(module_name)
File "/usr/lib/python3.7/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 "./recognition.py", line 1, in <module>
from tensorflow.keras import layers
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow/__init__.py", line 98, in <module>
from tensorflow_core import *
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/__init__.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "<frozen importlib._bootstrap>", line 1019, in _handle_fromlist
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow/__init__.py", line 50, in __getattr__
module = self._load()
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow/__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/__init__.py", line 88, in <module>
from tensorflow.python import keras
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/__init__.py", line 26, in <module>
from tensorflow.python.keras import activations
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/__init__.py", line 26, in <module>
from tensorflow.python.keras import activations
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/activations.py", line 23, in <module>
from tensorflow.python.keras.utils.generic_utils import deserialize_keras_object
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/__init__.py", line 34, in <module>
from tensorflow.python.keras.utils.io_utils import HDF5Matrix
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/io_utils.py", line 30, in <module>
import h5py
File "/home/pi/.local/lib/python3.7/site-packages/h5py/__init__.py", line 25, in <module>
from . import _errors
File "h5py/_errors.pyx", line 1, in init h5py._errors
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 44 from C header, got 40 from PyObject
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.7/site-packages/rq/worker.py", line 1031, in perform_job
rv = job.perform()
File "/home/pi/.local/lib/python3.7/site-packages/rq/job.py", line 749, in perform
self._result = self._execute()
File "/home/pi/.local/lib/python3.7/site-packages/rq/job.py", line 772, in _execute
result = self.func(*self.args, **self.kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/rq/job.py", line 225, in func
return import_attribute(self.func_name)
File "/home/pi/.local/lib/python3.7/site-packages/rq/utils.py", line 142, in import_attribute
module = importlib.import_module(module_name)
File "/usr/lib/python3.7/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 "./recognition.py", line 1, in <module>
from tensorflow.keras import layers
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow/__init__.py", line 98, in <module>
from tensorflow_core import *
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/__init__.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "<frozen importlib._bootstrap>", line 1019, in _handle_fromlist
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow/__init__.py", line 50, in __getattr__
module = self._load()
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow/__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/__init__.py", line 88, in <module>
from tensorflow.python import keras
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/__init__.py", line 26, in <module>
from tensorflow.python.keras import activations
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/__init__.py", line 26, in <module>
from tensorflow.python.keras import activations
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/activations.py", line 23, in <module>
from tensorflow.python.keras.utils.generic_utils import deserialize_keras_object
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/__init__.py", line 34, in <module>
from tensorflow.python.keras.utils.io_utils import HDF5Matrix
File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/io_utils.py", line 30, in <module>
import h5py
File "/home/pi/.local/lib/python3.7/site-packages/h5py/__init__.py", line 25, in <module>
from . import _errors
File "h5py/_errors.pyx", line 1, in init h5py._errors
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 44 from C header, got 40 from PyObject
I know it's a lot of text but i have no clue on how to fix the error.
Also I want to specify that the rq worker works fine with other functions that does not require the Tensorflow library.

getting error cannot read file data: is a directory when making migration in django rest framework

hi i am making an app which takes a users location and compares it with other people to find the distance. When i added a installed gdal geos postgis and proj4 i then added a pointfield from
from django.contrib.gis.db import models
then i did a migration and it returned an error of
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/aarush/anaconda3/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/home/aarush/anaconda3/lib/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/utils/autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 110, in inner_run
autoreload.raise_last_exception()
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/utils/autoreload.py", line 76, in raise_last_exception
raise _exception[1]
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/core/management/__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/utils/autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/home/aarush/anaconda3/lib/python3.7/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 "/home/aarush/git_fudo/food1_back/food1_back/posts_v1/models.py", line 1, in <module>
from django.contrib.auth.base_user import BaseUserManager
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/contrib/auth/base_user.py", line 48, in <module>
class AbstractBaseUser(models.Model):
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/db/models/base.py", line 122, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/db/models/base.py", line 326, in add_to_class
value.contribute_to_class(cls, name)
File "/home/aarush/anaconda3/lib/python3.7/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/aarush/anaconda3/lib/python3.7/site-packages/django/db/__init__.py", line 28, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/db/utils.py", line 214, in __getitem__
backend = load_backend(db['ENGINE'])
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/db/utils.py", line 111, in load_backend
return import_module('%s.base' % backend_name)
File "/home/aarush/anaconda3/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/contrib/gis/db/backends/postgis/base.py", line 6, in <module>
from .features import DatabaseFeatures
File "/home/aarush/anaconda3/lib/python3.7/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/aarush/anaconda3/lib/python3.7/site-packages/django/contrib/gis/db/backends/base/features.py", line 3, in <module>
from django.contrib.gis.db import models
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/contrib/gis/db/models/__init__.py", line 3, in <module>
import django.contrib.gis.db.models.functions # NOQA
File "/home/aarush/anaconda3/lib/python3.7/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/aarush/anaconda3/lib/python3.7/site-packages/django/contrib/gis/db/models/fields.py", line 3, in <module>
from django.contrib.gis import forms, gdal
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/contrib/gis/forms/__init__.py", line 3, in <module>
from .fields import ( # NOQA
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/contrib/gis/forms/fields.py", line 2, in <module>
from django.contrib.gis.gdal import GDALException
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/contrib/gis/gdal/__init__.py", line 28, in <module>
from django.contrib.gis.gdal.datasource import DataSource
File "/home/aarush/anaconda3/lib/python3.7/site-packages/django/contrib/gis/gdal/datasource.py", line 39, in <module>
from django.contrib.gis.gdal.driver import Driver
File "/home/aarush/anaconda3/lib/python3.7/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/aarush/anaconda3/lib/python3.7/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/aarush/anaconda3/lib/python3.7/site-packages/django/contrib/gis/gdal/libgdal.py", line 50, in <module>
lgdal = CDLL(lib_path)
File "/home/aarush/anaconda3/lib/python3.7/ctypes/__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /home/aarush/git_fudo/food1_back/food1_back: cannot read file data: Is a directory
to basically summarise this it is saying
cannot read file data: Is a directory
is there something i am missing?
(if you need anymore data about my project feel free to ask!)

why my pip gives same error when i run Django server?

I updated the version of my pip but when I run every time any command with pip on terminal, it gives me the same error. Before I tried to create a django project and after some time when I run project it gives error. I don't know where I am going wrong.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/bin/pip", line 8, in <module>
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/commands/__init__.py", line 104, in create_command
module = importlib.import_module(module_path)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 17, in <module>
from pip._internal.cli.req_command import RequirementCommand, with_cleanup
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 22, in <module>
from pip._internal.req.constructors import (
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/req/__init__.py", line 10, in <module>
from .req_install import InstallRequirement
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 10, in <module>
import uuid
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/uuid.py", line 57, in <module>
_AIX = platform.system() == 'AIX'
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/platform.py", line 891, in system
return uname().system
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/platform.py", line 857, in uname
processor = _syscmd_uname('-p', '')
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/platform.py", line 613, in _syscmd_uname
output = subprocess.check_output(('uname', option),
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/run/__init__.py", line 145, in __new__
process = cls.create_process(command, stdin, cwd=cwd, env=env, shell=shell)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/run/__init__.py", line 121, in create_process
shlex.split(command),
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shlex.py", line 311, in split
return list(lex)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shlex.py", line 300, in __next__
token = self.get_token()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shlex.py", line 109, in get_token
raw = self.read_token()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shlex.py", line 140, in read_token
nextchar = self.instream.read(1)
AttributeError: 'tuple' object has no attribute 'read'
Every time it is the same error with pip. Please help me with this problem.

RQ job times out

I am trying to accomplish a task by using rq and redis. However the job is sometimes getting stuck importing a module.
JobTimeoutException: Task exceeded maximum timeout value (100 seconds)
File "rq/worker.py", line 812, in perform_job
rv = job.perform()
File "rq/job.py", line 588, in perform
self._result = self._execute()
File "rq/job.py", line 594, in _execute
return self.func(*self.args, **self.kwargs)
File "rq/job.py", line 199, in func
return import_attribute(self.func_name)
File "rq/utils.py", line 155, in import_attribute
module = importlib.import_module(module_name)
File "__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 "my_task.py", line 13, in <module>
import my_sockets
File "my_sockets.py", line 1, in <module>
from flask_socketio import SocketIO
File "__init__.py", line 8, in <module>
from socketio import socketio_manage
File "__init__.py", line 3, in <module>
from .client import Client
File "/usr/local/lib/python3.6/dist-packages/socketio/client.py", line 5, in <module>
import engineio
File "__init__.py", line 3, in <module>
from .client import Client
File "/usr/local/lib/python3.6/dist-packages/engineio/client.py", line 13, in <module>
import requests
File "__init__.py", line 95, in <module>
from urllib3.contrib import pyopenssl
File "urllib3/contrib/pyopenssl.py", line 48, in <module>
from cryptography.hazmat.backends.openssl import backend as openssl_backend
File "cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
from cryptography.hazmat.backends.openssl.backend import backend
File "cryptography/hazmat/backends/openssl/backend.py", line 2419, in <module>
backend = Backend()
File "cryptography/hazmat/backends/openssl/backend.py", line 119, in __init__
self.activate_osrandom_engine()
File "cryptography/hazmat/backends/openssl/backend.py", line 163, in activate_osrandom_engine
with self._get_osurandom_engine() as e:
File "contextlib.py", line 81, in __enter__
return next(self.gen)
File "cryptography/hazmat/backends/openssl/backend.py", line 146, in _get_osurandom_engine
res = self._lib.ENGINE_init(e)
File "rq/timeouts.py", line 64, in handle_death_penalty
'({0} seconds)'.format(self._timeout))
It happens only 1 out of 10 times, which makes it hard to reproduce. Does anyone know what is causing this?

Categories