The specified module could not be found error on app configuration - python

I am using geodjango to implement Google Map API in my web application. I configured the database in settings.py:
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'geodjango_project',
'USER': 'postgres',
'HOST': 'localhost',
'PASSWORD': 'postgres',
'PORT': '5432'
},
}
I got this error:
django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal204", "gdal203", "gdal202", "gdal201", "gdal20"). Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings.
then according to the instruction of the error, I added `GDAL_LIBRARY_PATH = r'C:\OSGeo4W64\bin\gdal202'` and this error was thrown:
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "c:\programdata\anaconda3\Lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "c:\programdata\anaconda3\Lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\utils\autoreload.py", line 76, in raise_last_exception
raise _exception[1]
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\core\management\__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\apps\registry.py", line 114, in populate
app_config.import_models()
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\apps\config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\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\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\contrib\auth\models.py", line 2, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\contrib\auth\base_user.py", line 47, in <module>
class AbstractBaseUser(models.Model):
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\db\models\base.py", line 121, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\db\models\base.py", line 325, in add_to_class
value.contribute_to_class(cls, name)
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\db\models\options.py", line 208, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\db\__init__.py", line 28, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\db\utils.py", line 207, in __getitem__
backend = load_backend(db['ENGINE'])
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\db\utils.py", line 111, in load_backend
return import_module('%s.base' % backend_name)
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\contrib\gis\db\backends\postgis\base.py", line 6, in <module>
from .features import DatabaseFeatures
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\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 "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\contrib\gis\db\backends\base\features.py", line 3, in <module>
from django.contrib.gis.db.models import aggregates
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\contrib\gis\db\models\__init__.py", line 3, in <module>
import django.contrib.gis.db.models.functions # NOQA
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\contrib\gis\db\models\functions.py", line 3, in <module>
from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\contrib\gis\db\models\fields.py", line 3, in <module>
from django.contrib.gis import forms, gdal
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\contrib\gis\forms\__init__.py", line 3, in <module>
from .fields import ( # NOQA
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\contrib\gis\forms\fields.py", line 2,
in <module>
from django.contrib.gis.gdal import GDALException
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\contrib\gis\gdal\__init__.py", line 28, in <module>
from django.contrib.gis.gdal.datasource import DataSource
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\contrib\gis\gdal\datasource.py", line
39, in <module>
from django.contrib.gis.gdal.driver import Driver
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\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 "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\contrib\gis\gdal\prototypes\ds.py", line 9, in <module>
from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal
File "C:\Users\pytuts\.virtualenvs\geodjango-project-Aa0-CBie\lib\site-packages\django\contrib\gis\gdal\libgdal.py", line 47, in <module>
lgdal = CDLL(lib_path)
File "c:\programdata\anaconda3\Lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

Related

Python Django ImportError, cannot import name

I am having this issue with django project that has the following apps:
Accounts
Billing
Bookings
Notifications
The error appears as soon as I add the following to notifications/models.py:
import notifications.utils as U
The following is the full log of the exception:
D:\Noki\code\nokidepot_tcp\website\noki_proj>python manage.py runserver 192.168.1.103:8000
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\jahanzeb\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "C:\Users\jahanzeb\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "D:\Noki\code\nokidepot_tcp\nokienv\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "D:\Noki\code\nokidepot_tcp\nokienv\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "D:\Noki\code\nokidepot_tcp\nokienv\lib\site-packages\django\utils\autoreload.py", line 77, in raise_last_exception
raise _exception[1]
File "D:\Noki\code\nokidepot_tcp\nokienv\lib\site-packages\django\core\management\__init__.py", line 337, in execute
autoreload.check_errors(django.setup)()
File "D:\Noki\code\nokidepot_tcp\nokienv\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "D:\Noki\code\nokidepot_tcp\nokienv\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "D:\Noki\code\nokidepot_tcp\nokienv\lib\site-packages\django\apps\registry.py", line 114, in populate
app_config.import_models()
File "D:\Noki\code\nokidepot_tcp\nokienv\lib\site-packages\django\apps\config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "C:\Users\jahanzeb\AppData\Local\Programs\Python\Python37-32\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 "D:\Noki\code\nokidepot_tcp\website\noki_proj\accounts\models.py", line 13, in <module>
from billing.views import charge_booking
File "D:\Noki\code\nokidepot_tcp\website\noki_proj\billing\views.py", line 14, in <module>
from bookings.models import *
File "D:\Noki\code\nokidepot_tcp\website\noki_proj\bookings\models.py", line 9, in <module>
from notifications.views import create_event
File "D:\Noki\code\nokidepot_tcp\website\noki_proj\notifications\views.py", line 3, in <module>
from .models import Events, get_event_string, get_event_time
File "D:\Noki\code\nokidepot_tcp\website\noki_proj\notifications\models.py", line 8, in <module>
import notifications.utils as U
File "D:\Noki\code\nokidepot_tcp\website\noki_proj\notifications\utils.py", line 1, in <module>
from accounts.views import get_user_by_phone
File "D:\Noki\code\nokidepot_tcp\website\noki_proj\accounts\views.py", line 7, in <module>
from .models import NokiUser, EmailActivationLinks
ImportError: cannot import name 'NokiUser' from 'accounts.models' (D:\Noki\code\nokidepot_tcp\website\noki_proj\accounts\models.py)
Any help on this will be greatly appreciated.
There is a circular import here as you can see in the last half of the trace. Basically, adding the import notifications.utils as U creates a link in a chain that starts and ends at accounts\models.py
There are various ways of handling circular imports, but without the specifics of your code it's hard to see what would fit. This answer may have some useful suggestions.

GDAL dll points to old python

I am trying to use gdal from Christopher Gohlke's site and apparently, the path to the gdal303.dll is set in old Python3.9 while I am currently using Python3.10, and throws FilNotFoundError. The stack trace looks like:
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner
self.run()
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
autoreload.raise_last_exception()
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
raise _exception[1]
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\__init__.py", line 398, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\registry.py", line 116, in populate
app_config.import_models()
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\config.py", line 304, in import_models
self.models_module = import_module(models_module_name)
File "C:\Users\E6400\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 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\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\auth\models.py", line 3, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\auth\base_user.py", line 49, in <module>
class AbstractBaseUser(models.Model):
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\db\models\base.py", line 141, in __new__
new_class.add_to_class("_meta", Options(meta, app_label))
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\db\models\base.py", line 369, in add_to_class
value.contribute_to_class(cls, name)
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\db\models\options.py", line 235, in contribute_to_class
self.db_table, connection.ops.max_name_length()
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\connection.py", line 15, in __getattr__
return getattr(self._connections[self._alias], item)
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\connection.py", line 62, in __getitem__
conn = self.create_connection(alias)
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\db\utils.py", line 208, in create_connection
backend = load_backend(db["ENGINE"])
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\db\utils.py", line 113, in load_backend
return import_module("%s.base" % backend_name)
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\gis\db\backends\postgis\base.py", line 6, in <module>
from .features import DatabaseFeatures
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\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 "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\gis\db\backends\base\features.py", line 3, in <module>
from django.contrib.gis.db import models
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\gis\db\models\__init__.py", line 3, in <module>
import django.contrib.gis.db.models.functions # NOQA
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\gis\db\models\functions.py", line 3, in <module>
from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\gis\db\models\fields.py", line 3, in <module>
from django.contrib.gis import forms, gdal
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\gis\forms\__init__.py", line 3, in <module>
from .fields import ( # NOQA
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\gis\forms\fields.py", line 2, in <module>
from django.contrib.gis.gdal import GDALException
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\gis\gdal\__init__.py", line 28, in <module>
from django.contrib.gis.gdal.datasource import DataSource
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\gis\gdal\datasource.py", line 40, in <module>
from django.contrib.gis.gdal.driver import Driver
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\gis\gdal\driver.py", line 5, in <module>
from django.contrib.gis.gdal.prototypes import ds as vcapi
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\gis\gdal\prototypes\ds.py", line 9, in <module>
from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\gis\gdal\libgdal.py", line 69, in <module>
lgdal = CDLL(lib_path)
File "C:\Users\E6400\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Python39\Lib\site-packages\osgeo\gdal304.dll' (or one of its dependencies). Try using the full path with const
ructor syntax.

ImportError: Can't determine version for numexpr caused by scrapy

I'm trying to run a scrapy problem downloaded on the Internat,when I try to start running a scrapy crawl this program, there turn to the following error, I don't know the cause, I don't know is it pandas version problem? or numpy? After changed the bottleneck_ floader name, nothing changed.
The code:
Scarpy crawl guba
then tips are following:
Traceback (most recent call last):
File "C:\Users\Saraph\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Saraph\anaconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Saraph\anaconda3\Scripts\scrapy.exe\__main__.py", line 7, in <module>
File "C:\Users\Saraph\anaconda3\lib\site-packages\scrapy\cmdline.py", line 144, in execute
cmd.crawler_process = CrawlerProcess(settings)
File "C:\Users\Saraph\anaconda3\lib\site-packages\scrapy\crawler.py", line 280, in __init__
super().__init__(settings)
File "C:\Users\Saraph\anaconda3\lib\site-packages\scrapy\crawler.py", line 152, in __init__
self.spider_loader = self._get_spider_loader(settings)
File "C:\Users\Saraph\anaconda3\lib\site-packages\scrapy\crawler.py", line 146, in _get_spider_loader
return loader_cls.from_settings(settings.frozencopy())
File "C:\Users\Saraph\anaconda3\lib\site-packages\scrapy\spiderloader.py", line 67, in from_settings
return cls(settings)
File "C:\Users\Saraph\anaconda3\lib\site-packages\scrapy\spiderloader.py", line 24, in __init__
self._load_all_spiders()
File "C:\Users\Saraph\anaconda3\lib\site-packages\scrapy\spiderloader.py", line 51, in _load_all_spiders
for module in walk_modules(name):
File "C:\Users\Saraph\anaconda3\lib\site-packages\scrapy\utils\misc.py", line 88, in walk_modules
submod = import_module(fullpath)
File "C:\Users\Saraph\anaconda3\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\Saraph\Desktop\github\guba\guba_crawler-master\guba_stock_reviews_spider\spiders\guba.py", line 3, in <module>
import pandas as pd
File "C:\Users\Saraph\anaconda3\lib\site-packages\pandas\__init__.py", line 48, in <module>
from pandas.core.api import (
File "C:\Users\Saraph\anaconda3\lib\site-packages\pandas\core\api.py", line 29, in <module>
from pandas.core.arrays import Categorical
File "C:\Users\Saraph\anaconda3\lib\site-packages\pandas\core\arrays\__init__.py", line 1, in <module>
from pandas.core.arrays.base import (
File "C:\Users\Saraph\anaconda3\lib\site-packages\pandas\core\arrays\base.py", line 68, in <module>
from pandas.core import (
File "C:\Users\Saraph\anaconda3\lib\site-packages\pandas\core\arraylike.py", line 21, in <module>
from pandas.core.ops.common import unpack_zerodim_and_defer
File "C:\Users\Saraph\anaconda3\lib\site-packages\pandas\core\ops\__init__.py", line 33, in <module>
from pandas.core.ops.array_ops import ( # noqa:F401
File "C:\Users\Saraph\anaconda3\lib\site-packages\pandas\core\ops\array_ops.py", line 48, in <module>
import pandas.core.computation.expressions as expressions
File "C:\Users\Saraph\anaconda3\lib\site-packages\pandas\core\computation\expressions.py", line 19, in <module>
from pandas.core.computation.check import NUMEXPR_INSTALLED
File "C:\Users\Saraph\anaconda3\lib\site-packages\pandas\core\computation\check.py", line 3, in <module>
ne = import_optional_dependency("numexpr", errors="warn")
File "C:\Users\Saraph\anaconda3\lib\site-packages\pandas\compat\_optional.py", line 142, in import_optional_dependency
version = get_version(module_to_get)
File "C:\Users\Saraph\anaconda3\lib\site-packages\pandas\compat\_optional.py", line 68, in get_version
raise ImportError(f"Can't determine version for {module.__name__}")
ImportError: Can't determine version for numexpr

ImportError: DLL load failed while importing cloneNodes: The parameter is incorrect

I'm facing this issue when I run this command and it creates a makecpython.py:
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [Extension("cloneNodes", ["app/v3/impl/cloneNodes.pyx"])]
setup(
name = 'arr',
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules,
compiler_directives={'language_level' : "3"}
)
Later I run my file to clone the nodes to this is created, this is the clonenode.py file made:
from cpython cimport *
def cloningNodes(matrix,toClone):
cdef Py_ssize_t matrixSize=PyList_Size(matrix),cloneSize=PyList_Size(toClone),newSize=matrixSize+cloneSize,i,j
output=PyList_New(newSize)
for i in range(matrixSize):
currentMatrixRow=<object>PyList_GET_ITEM(matrix,i)
Py_INCREF(currentMatrixRow)
PyList_SET_ITEM(output,i,
currentMatrixRow)
for j in range(cloneSize):
currentRow=<object>PyList_GET_ITEM(output,i)
PyList_Append(currentRow,<object>PyList_GET_ITEM(
<object>PyList_GET_ITEM(matrix,i),PyLong_AsSsize_t(<object>PyList_GET_ITEM(toClone,j))
)
)
for i in range(cloneSize):
toCloneRow=<object>PyList_GET_ITEM(output,PyLong_AsSsize_t(<object>PyList_GET_ITEM(toClone,i)))
Py_INCREF(toCloneRow)
PyList_SET_ITEM(output,i+matrixSize,toCloneRow)
return output
Now I have to run the uvicorn main app thus instead of showing the link it goes to the dll error:
uvicorn main:app
Traceback (most recent call last):
File "c:\users\nkgad\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\nkgad\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\nkgad\AppData\Local\Programs\Python\Python39\Scripts\uvicorn.exe\__main__.py", line 7, in <module>
File "c:\users\nkgad\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "c:\users\nkgad\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 1053, in main
rv = self.invoke(ctx)
File "c:\users\nkgad\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\users\nkgad\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "c:\users\nkgad\appdata\local\programs\python\python39\lib\site-packages\uvicorn\main.py", line 425, in main
run(app, **kwargs)
File "c:\users\nkgad\appdata\local\programs\python\python39\lib\site-packages\uvicorn\main.py", line 447, in run
server.run()
File "c:\users\nkgad\appdata\local\programs\python\python39\lib\site-packages\uvicorn\server.py", line 68, in run
return asyncio.run(self.serve(sockets=sockets))
File "c:\users\nkgad\appdata\local\programs\python\python39\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "c:\users\nkgad\appdata\local\programs\python\python39\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "c:\users\nkgad\appdata\local\programs\python\python39\lib\site-packages\uvicorn\server.py", line 76, in serve
config.load()
File "c:\users\nkgad\appdata\local\programs\python\python39\lib\site-packages\uvicorn\config.py", line 448, in load
self.loaded_app = import_from_string(self.app)
File "c:\users\nkgad\appdata\local\programs\python\python39\lib\site-packages\uvicorn\importer.py", line 24, in import_from_string
raise exc from None
File "c:\users\nkgad\appdata\local\programs\python\python39\lib\site-packages\uvicorn\importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
File "c:\users\nkgad\appdata\local\programs\python\python39\lib\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 ".\main.py", line 3, in <module>
from app.api import app
File ".\app\api.py", line 4, in <module>
from .v3.controller.route_info_controller import RouteController
File ".\app\v3\controller\route_info_controller.py", line 2, in <module>
from ..impl.vrp_impl import VRPImpl
File ".\app\v3\impl\vrp_impl.py", line 6, in <module>
from .open_route_map_impl import OpenRouteImpl
File ".\app\v3\impl\open_route_map_impl.py", line 2, in <module>
from cloneNodes import cloningNodes
ImportError: DLL load failed while importing cloneNodes: The parameter is incorrect.
How can I resolve this DLL load failure issue?

Error while creating conda environment in windows 10

I am trying to create conda virtual environment to use Tensorflow 1.14 inside of it. I have two environments already and they are working fine. But, when I ran the command conda create -n bert python=3.6 I got the following error.
Os -Windows 10
Python = 3.7 default one
Conda Version = 4.7.11
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\exceptions.py", line 1062, in __call__
return func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main
exit_code = do_call(args, p)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 80, in do_call
module = import_module(relative_mod, __name__.rsplit('.', 1)[0])
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:\ProgramData\Anaconda3\lib\site-packages\conda\cli\main_create.py", line 10, in <module>
from .install import install
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\install.py", line 19, in <module>
from ..core.index import calculate_channel_urls, get_index
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\index.py", line 9, in <module>
from .package_cache_data import PackageCacheData
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\package_cache_data.py", line 15, in <module>
from .path_actions import CacheUrlAction, ExtractPackageAction
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\path_actions.py", line 30, in <module>
from ..gateways.connection.download import download
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\gateways\connection\download.py", line 18, in <module>
from .session import CondaSession
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\gateways\connection\session.py", line 13, in <module>
from .adapters.s3 import S3Adapter
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\gateways\connection\adapters\s3.py", line 14, in <module>
boto3.client('s3') # https://github.com/conda/conda/issues/8993
File "C:\ProgramData\Anaconda3\lib\site-packages\boto3\__init__.py", line 91, in client
return _get_default_session().client(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\boto3\session.py", line 263, in client
aws_session_token=aws_session_token, config=config)
File "C:\ProgramData\Anaconda3\lib\site-packages\botocore\session.py", line 839, in create_client
client_config=config, api_version=api_version)
File "C:\ProgramData\Anaconda3\lib\site-packages\botocore\client.py", line 86, in create_client
verify, credentials, scoped_config, client_config, endpoint_bridge)
File "C:\ProgramData\Anaconda3\lib\site-packages\botocore\client.py", line 328, in _get_client_args
verify, credentials, scoped_config, client_config, endpoint_bridge)
File "C:\ProgramData\Anaconda3\lib\site-packages\botocore\args.py", line 85, in get_client_args
client_cert=new_config.client_cert)
File "C:\ProgramData\Anaconda3\lib\site-packages\botocore\endpoint.py", line 259, in create_endpoint
if not is_valid_endpoint_url(endpoint_url):
File "C:\ProgramData\Anaconda3\lib\site-packages\botocore\utils.py", line 842, in is_valid_endpoint_url
parts = urlsplit(endpoint_url)
File "C:\ProgramData\Anaconda3\lib\urllib\parse.py", line 456, in urlsplit
raise ValueError("Invalid IPv6 URL")
ValueError: Invalid IPv6 URL
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\Scripts\conda-script.py", line 12, in <module>
sys.exit(main())
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\main.py", line 150, in main
return conda_exception_handler(_main, *args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\exceptions.py", line 1354, in conda_exception_handler
return_value = exception_handler(func, *args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\exceptions.py", line 1065, in __call__
return self.handle_exception(exc_val, exc_tb)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\exceptions.py", line 1109, in handle_exception
return self.handle_unexpected_exception(exc_val, exc_tb)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\exceptions.py", line 1120, in handle_unexpected_exception
self.print_unexpected_error_report(error_report)
File "C:\ProgramData\Anaconda3\lib\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 "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\main_info.py", line 19, in <module>
from ..core.index import _supplement_index_with_system
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\index.py", line 9, in <module>
from .package_cache_data import PackageCacheData
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\package_cache_data.py", line 15, in <module>
from .path_actions import CacheUrlAction, ExtractPackageAction
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\path_actions.py", line 30, in <module>
from ..gateways.connection.download import download
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\gateways\connection\download.py", line 18, in <module>
from .session import CondaSession
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\gateways\connection\session.py", line 13, in <module>
from .adapters.s3 import S3Adapter
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\gateways\connection\adapters\s3.py", line 14, in <module>
boto3.client('s3') # https://github.com/conda/conda/issues/8993
File "C:\ProgramData\Anaconda3\lib\site-packages\boto3\__init__.py", line 91, in client
return _get_default_session().client(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\boto3\session.py", line 263, in client
aws_session_token=aws_session_token, config=config)
File "C:\ProgramData\Anaconda3\lib\site-packages\botocore\session.py", line 839, in create_client
client_config=config, api_version=api_version)
File "C:\ProgramData\Anaconda3\lib\site-packages\botocore\client.py", line 86, in create_client
verify, credentials, scoped_config, client_config, endpoint_bridge)
File "C:\ProgramData\Anaconda3\lib\site-packages\botocore\client.py", line 328, in _get_client_args
verify, credentials, scoped_config, client_config, endpoint_bridge)
File "C:\ProgramData\Anaconda3\lib\site-packages\botocore\args.py", line 85, in get_client_args
client_cert=new_config.client_cert)
File "C:\ProgramData\Anaconda3\lib\site-packages\botocore\endpoint.py", line 259, in create_endpoint
if not is_valid_endpoint_url(endpoint_url):
File "C:\ProgramData\Anaconda3\lib\site-packages\botocore\utils.py", line 842, in is_valid_endpoint_url
parts = urlsplit(endpoint_url)
File "C:\ProgramData\Anaconda3\lib\urllib\parse.py", line 456, in urlsplit
raise ValueError("Invalid IPv6 URL")
ValueError: Invalid IPv6 URL
How to solve this error? What is causing this?
saw "ValueError: Invalid IPv6 URL"
try change you ip from ipv6 to ipv4, and install again.

Categories

Resources