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
Related
Any ideas on why my app won't deploy? Build is succeeding -- deploy is failing.
Here are my requirements.txt.
-f https://download.pytorch.org/whl/torch_stable.html
Django==4.1.4
djangorestframework==3.14.0
requests==2.28.1
whisper==1.0
django-cors-headers==3.13.0
psycopg2==2.9.5
gunicorn==20.1.0
dj-database-url>=1.0,<2.0
whitenoise>=6.0,<7.0
torch==1.13.1+cpu
speechbrain
pyannote.audio
pyannote.core
I'm using torch==1.13.1+cpu because torch==1.13.1 causes the compressed slug size on Heroku to be >500MB, which isn't allowed.
Full stack trace below:
/app/.heroku/python/lib/python3.8/site-packages/torchaudio/_internal/module_utils.py:99: UserWarning: Failed to import soundfile. 'soundfile' backend is not available.
warnings.warn("Failed to import soundfile. 'soundfile' backend is not available.")
Traceback (most recent call last):
File "manage.py", line 22, in <module>
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/app/.heroku/python/lib/python3.8/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/app/.heroku/python/lib/python3.8/site-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/app/.heroku/python/lib/python3.8/site-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "/app/.heroku/python/lib/python3.8/site-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "/app/.heroku/python/lib/python3.8/site-packages/django/core/management/base.py", line 96, in wrapped
res = handle_func(*args, **kwargs)
File "/app/.heroku/python/lib/python3.8/site-packages/django/core/management/commands/migrate.py", line 97, in handle
self.check(databases=[database])
File "/app/.heroku/python/lib/python3.8/site-packages/django/core/management/base.py", line 475, in check
all_issues = checks.run_checks(
File "/app/.heroku/python/lib/python3.8/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/app/.heroku/python/lib/python3.8/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "/app/.heroku/python/lib/python3.8/site-packages/django/core/checks/urls.py", line 24, in check_resolver
return check_method()
File "/app/.heroku/python/lib/python3.8/site-packages/django/urls/resolvers.py", line 494, in check
for pattern in self.url_patterns:
File "/app/.heroku/python/lib/python3.8/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/app/.heroku/python/lib/python3.8/site-packages/django/urls/resolvers.py", line 715, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/app/.heroku/python/lib/python3.8/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/app/.heroku/python/lib/python3.8/site-packages/django/urls/resolvers.py", line 708, in urlconf_module
return import_module(self.urlconf_name)
File "/app/.heroku/python/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 "/app/podcast_project_django/urls.py", line 4, in <module>
from . import views
File "/app/podcast_project_django/views.py", line 12, in <module>
from pyannote.audio.pipelines.speaker_verification import PretrainedSpeakerEmbedding
File "/app/.heroku/python/lib/python3.8/site-packages/pyannote/audio/__init__.py", line 29, in <module>
from .core.inference import Inference
File "/app/.heroku/python/lib/python3.8/site-packages/pyannote/audio/core/inference.py", line 34, in <module>
from pyannote.audio.core.io import AudioFile
File "/app/.heroku/python/lib/python3.8/site-packages/pyannote/audio/core/io.py", line 38, in <module>
import torchaudio
File "/app/.heroku/python/lib/python3.8/site-packages/torchaudio/__init__.py", line 1, in <module>
from torchaudio import ( # noqa: F401
File "/app/.heroku/python/lib/python3.8/site-packages/torchaudio/_extension.py", line 135, in <module>
_init_extension()
File "/app/.heroku/python/lib/python3.8/site-packages/torchaudio/_extension.py", line 105, in _init_extension
_load_lib("libtorchaudio")
File "/app/.heroku/python/lib/python3.8/site-packages/torchaudio/_extension.py", line 52, in _load_lib
torch.ops.load_library(path)
File "/app/.heroku/python/lib/python3.8/site-packages/torch/_ops.py", line 573, in load_library
ctypes.CDLL(path)
File "/app/.heroku/python/lib/python3.8/ctypes/__init__.py", line 373, in __init__
self._handle = _dlopen(self._name, mode)
OSError: libtorch_hip.so: cannot open shared object file: No such file or directory
Here is the code block that I'm pretty sure is breaking the deploy:
model = whisper.load_model("small.en")
embedding_model = PretrainedSpeakerEmbedding(
"speechbrain/spkrec-ecapa-voxceleb",
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
)
Comes from Dwarkesh Patel's app on huggingface: https://huggingface.co/spaces/dwarkesh/whisper-speaker-recognition/blob/main/app.py
Update:
Update:
Added torchaudio==0.13.1+cpu to my requirements.txt and am now hitting a new error
File "/app/.heroku/python/lib/python3.8/site-packages/soundfile.py", line 142, in <module>
raise OSError('sndfile library not found')
OSError: sndfile library not found
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!)
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\utils\autoreload.py", line 76, in raise_last_exception
raise _exception[1]
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\apps\registry.py", line 122, in populate
app_config.ready()
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\contrib\admin\apps.py", line 24, in ready
self.module.autodiscover()
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\contrib\admin\__init__.py", line 26, in autodiscover
autodiscover_modules('admin', register_to=site)
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\utils\module_loading.py", line 47, in autodiscover_modules
import_module('%s.%s' % (app_config.name, module_to_search))
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\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 "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\contrib\gis\admin\__init__.py", line 5, in <module>
from django.contrib.gis.admin.options import GeoModelAdmin, OSMGeoAdmin
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\contrib\gis\admin\options.py", line 2, in <module>
from django.contrib.gis.admin.widgets import OpenLayersWidget
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\contrib\gis\admin\widgets.py", line 4, in <module>
from django.contrib.gis.geos import GEOSException, GEOSGeometry
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\contrib\gis\geos\__init__.py", line 5, in <module>
from .collections import ( # NOQA
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\contrib\gis\geos\collections.py", line 8, in <module>
from django.contrib.gis.geos.geometry import GEOSGeometry, LinearGeometryMixin
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\contrib\gis\geos\geometry.py", line 17, in <module>
from django.contrib.gis.geos.prototypes.io import (
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\contrib\gis\geos\prototypes\io.py", line 212, in <module>
class WKBWriter(IOBase):
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\contrib\gis\geos\prototypes\io.py", line 216, in WKBWriter
geos_version = geos_version_tuple()
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\contrib\gis\geos\libgeos.py", line 174, in geos_version_tuple
return get_version_tuple(geos_version().decode())
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\contrib\gis\geos\libgeos.py", line 169, in geos_version
return lgeos.GEOSversion()
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\utils\functional.py", line 224, in inner
self._setup()
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\utils\functional.py", line 360, in _setup
self._wrapped = self._setupfunc()
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\contrib\gis\geos\libgeos.py", line 66, in load_geos
_lgeos.initGEOS_r.restype = CONTEXT_PTR
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\ctypes\__init__.py", line 382, in __getattr__
func = self.__getitem__(name)
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\lib\ctypes\__init__.py", line 387, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'initGEOS_r' not found
I get AttributeError: function 'initGEOS_r' not found error while trying to run my server.
I am trying to write a basic Geo Django program
I have Postgres and GEOS also installed
I have also included GEOS and GDAL paths in my settings.py file.
I have tried all possible way to resolve this error but couldn't.
Can Someone Help me out!
I had the same problem this worked for me:
On settings.py write:
GDAL_LIBRARY_PATH = r'C:\OSGeo4W64\bin\gdal204'
GEOS_LIBRARY_PATH = r'C:\OSGeo4W64\bin\geos_c.dll'
PROJ_LIBRARY_PATH = r'C:\OSGeo4W64\share\proj'
On settings.py INSTALLED_APPS code:
'django.contrib.gis',
Add postgis to backend
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'xxx',
'USER': 'yyy',
'PASSWORD': 'xxx',
'HOST': '',
'PORT': '1234',
}
}
Remember that your models should inherit from
from django.contrib.gis.db import models
I hope this can help you
Same steps as the answer above, but on the M1 Macs, the settings looked like this:
GDAL_LIBRARY_PATH = "/opt/homebrew/lib/libgdal.dylib"
GEOS_LIBRARY_PATH = "/opt/homebrew/lib/libgeos_c.dylib"
(Didn't need PROJ because I'm using "ENGINE": "django.contrib.gis.db.backends.mysql",
Here is the question: an error occurs when I import pandas:
dateutil: No module named 'dateutil'
So i installed dateutil, which is successfully installed, with pip:
pip3 install python-dateutil
but when i run my django project i got error like this:
Watching for file changes with StatReloader
Performing system checks...
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/django/urls/resolvers.py", line 573, in url_patterns
iter(patterns)
TypeError: 'module' object is not iterable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.5/dist-packages/django/utils/autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/commands/runserver.py", line 117, in inner_run
self.check(display_num_errors=True)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 390, in check
include_deployment_checks=include_deployment_checks,
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 377, in _run_checks
return checks.run_checks(**kwargs)
File "/usr/local/lib/python3.5/dist-packages/django/core/checks/registry.py", line 72, in run_checks
new_errors = check(app_configs=app_configs)
File "/usr/local/lib/python3.5/dist-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "/usr/local/lib/python3.5/dist-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
File "/usr/local/lib/python3.5/dist-packages/django/urls/resolvers.py", line 398, in check
for pattern in self.url_patterns:
File "/usr/local/lib/python3.5/dist-packages/django/utils/functional.py", line 80, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.5/dist-packages/django/urls/resolvers.py", line 580, in url_patterns
raise ImproperlyConfigured(msg.format(name=self.urlconf_name))
django.core.exceptions.ImproperlyConfigured: The included URLconf 'django_project.urls' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import.
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/commands/runserver.py", line 60, in execute
super().execute(*args, **options)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/commands/runserver.py", line 95, in handle
self.run(**options)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/commands/runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "/usr/local/lib/python3.5/dist-packages/django/utils/autoreload.py", line 579, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/django/utils/autoreload.py", line 564, in start_django
reloader.run(django_main_thread)
File "/usr/local/lib/python3.5/dist-packages/django/utils/autoreload.py", line 272, in run
get_resolver().urlconf_module
File "/usr/local/lib/python3.5/dist-packages/django/utils/functional.py", line 80, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.5/dist-packages/django/urls/resolvers.py", line 564, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 665, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/murphy/django_project/django_project/urls.py", line 22, in <module>
from app1.views import IndexView, GLCView
File "/home/murphy/django_project/apps/app1/views.py", line 15, in <module>
import myvariant
File "/usr/local/lib/python3.5/dist-packages/myvariant/__init__.py", line 4, in <module>
from biothings_client import get_client
File "/usr/local/lib/python3.5/dist-packages/biothings_client/__init__.py", line 10, in <module>
from .base import (BiothingClient, __version__, alwayslist, caching_avail,
File "/usr/local/lib/python3.5/dist-packages/biothings_client/base.py", line 18, in <module>
from pandas import DataFrame
File "/usr/local/lib/python3.5/dist-packages/pandas/__init__.py", line 55, in <module>
from pandas.core.api import (
File "/usr/local/lib/python3.5/dist-packages/pandas/core/api.py", line 5, in <module>
from pandas.core.arrays.integer import (
File "/usr/local/lib/python3.5/dist-packages/pandas/core/arrays/__init__.py", line 1, in <module>
from .array_ import array # noqa: F401
File "/usr/local/lib/python3.5/dist-packages/pandas/core/arrays/array_.py", line 7, in <module>
from pandas.core.dtypes.common import (
File "/usr/local/lib/python3.5/dist-packages/pandas/core/dtypes/common.py", line 11, in <module>
from pandas.core.dtypes.dtypes import (
File "/usr/local/lib/python3.5/dist-packages/pandas/core/dtypes/dtypes.py", line 53, in <module>
class Registry:
File "/usr/local/lib/python3.5/dist-packages/pandas/core/dtypes/dtypes.py", line 84, in Registry
self, dtype: Union[Type[ExtensionDtype], str]
File "/usr/lib/python3.5/typing.py", line 552, in __getitem__
dict(self.__dict__), parameters, _root=True)
File "/usr/lib/python3.5/typing.py", line 512, in __new__
for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
File "/usr/lib/python3.5/typing.py", line 512, in <genexpr>
for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
File "/usr/lib/python3.5/typing.py", line 1077, in __subclasscheck__
if super().__subclasscheck__(cls):
File "/usr/lib/python3.5/abc.py", line 225, in __subclasscheck__
for scls in cls.__subclasses__():
TypeError: descriptor '__subclasses__' of 'type' object needs an argument
There are 2 line relating to my project, which use a biological packages, I don't know if that's the reason.
To continue my django project, i have to uninstall dateutil as a temporary solution.
How can I solve this problem?
This problem has been solved. It turns out I did not describe what the real problem is, it's pandas(0.25.3) conflict with django(2.2) instead of dateutil. I reinstalled a old version of pandas(0.24.1) and it can work. I don't know why, but it works. Hope this can give other people a hint when they have the same question.
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