i am getting an error when trying to import import sklearn.metrics.pairwise as pw how do i fix this?
full error: ImportError: DLL load failed while importing _arpack: The specified procedure could not be found.
import: import sklearn.metrics.pairwise as pw
traceback:
Traceback (most recent call last):
File "C:\Users\Humza\anaconda3\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\Humza\anaconda3\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Humza\anaconda3\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "C:\Users\Humza\anaconda3\lib\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run
self.check(display_num_errors=True)
File "C:\Users\Humza\anaconda3\lib\site-packages\django\core\management\base.py", line 392, in check
all_issues = checks.run_checks(
File "C:\Users\Humza\anaconda3\lib\site-packages\django\core\checks\registry.py", line 70, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "C:\Users\Humza\anaconda3\lib\site-packages\django\core\checks\urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "C:\Users\Humza\anaconda3\lib\site-packages\django\core\checks\urls.py", line 23, in check_resolver
return check_method()
File "C:\Users\Humza\anaconda3\lib\site-packages\django\urls\resolvers.py", line 408, in check
for pattern in self.url_patterns:
File "C:\Users\Humza\anaconda3\lib\site-packages\django\utils\functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\Humza\anaconda3\lib\site-packages\django\urls\resolvers.py", line 589, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "C:\Users\Humza\anaconda3\lib\site-packages\django\utils\functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\Humza\anaconda3\lib\site-packages\django\urls\resolvers.py", line 582, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Users\Humza\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\Humza\Recommend_Me_Entertainment\Recommend_Me_Entertainment\urls.py", line 19, in <module>
from home import views
File "C:\Users\Humza\Recommend_Me_Entertainment\home\views.py", line 16, in <module>
import sklearn.metrics.pairwise as pw
File "C:\Users\Humza\anaconda3\lib\site-packages\sklearn\__init__.py", line 80, in <module>
from .base import clone
File "C:\Users\Humza\anaconda3\lib\site-packages\sklearn\base.py", line 21, in <module>
from .utils import _IS_32BIT
File "C:\Users\Humza\anaconda3\lib\site-packages\sklearn\utils\__init__.py", line 23, in <module>
from .class_weight import compute_class_weight, compute_sample_weight
File "C:\Users\Humza\anaconda3\lib\site-packages\sklearn\utils\class_weight.py", line 7, in <module>
from .validation import _deprecate_positional_args
File "C:\Users\Humza\anaconda3\lib\site-packages\sklearn\utils\validation.py", line 26, in <module>
from .fixes import _object_dtype_isnan
File "C:\Users\Humza\anaconda3\lib\site-packages\sklearn\utils\fixes.py", line 18, in <module>
import scipy.stats
File "C:\Users\Humza\anaconda3\lib\site-packages\scipy\stats\__init__.py", line 388, in <module>
from .stats import *
File "C:\Users\Humza\anaconda3\lib\site-packages\scipy\stats\stats.py", line 180, in <module>
from . import distributions
File "C:\Users\Humza\anaconda3\lib\site-packages\scipy\stats\distributions.py", line 8, in <module>
from ._distn_infrastructure import (entropy, rv_discrete, rv_continuous,
File "C:\Users\Humza\anaconda3\lib\site-packages\scipy\stats\_distn_infrastructure.py", line 23, in <module>
from scipy import optimize
File "C:\Users\Humza\anaconda3\lib\site-packages\scipy\optimize\__init__.py", line 387, in <module>
from .optimize import *
File "C:\Users\Humza\anaconda3\lib\site-packages\scipy\optimize\optimize.py", line 36, in <module>
from ._numdiff import approx_derivative
File "C:\Users\Humza\anaconda3\lib\site-packages\scipy\optimize\_numdiff.py", line 6, in <module>
from scipy.sparse.linalg import LinearOperator
File "C:\Users\Humza\anaconda3\lib\site-packages\scipy\sparse\linalg\__init__.py", line 114, in <module>
from .eigen import *
File "C:\Users\Humza\anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\__init__.py", line 9, in <module>
from .arpack import *
File "C:\Users\Humza\anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\__init__.py", line 20, in <module>
from .arpack import *
File "C:\Users\Humza\anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\arpack.py", line 43, in <module>
from . import _arpack
ImportError: DLL load failed while importing _arpack: The specified procedure could not be found.
try remove and re-install the sklearn package
conda remove --force numpy, scipy, scikit-learn
or
conda remove scikit-learn
and install using pip
pip install -U scikit-learn
Related
I am using Python 3.11.0 on Windows 10. I was able to successfully create a virtual environment with a requirements file. My pip.ini has references to my company's repository.
When I ran pip freeze it threw an exception.
My minimal requirements file is as follows:
asc-security-python
derf-api-catalog
flask
flask-restx
gevent
openpyxl
pandas
pytest
pytest-xdist
requests-negotiate-sspi
sqlalchemy-pyodbc-mssql
waitress
xlsxwriter
The detailed steps are as follows:
%USERPROFILE%\Python\python -m venv %USERPROFILE%\envs\MyEnv
%USERPROFILE%\envs\MyEnv\Scripts\activate
cd %USERPROFILE%\MyProject
pip install -r myrequirements.txt
pip freeze
The exception thrown is as follows:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\johndoe\envs\MyEnv\Scripts\pip.exe\__main__.py", line 4, in <module>
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\pip\_internal\cli\main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\pip\_internal\cli\autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\pip\_internal\cli\main_parser.py", line 9, in <module>
from pip._internal.build_env import get_runnable_pip
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\pip\_internal\build_env.py", line 20, in <module>
from pip._internal.cli.spinners import open_spinner
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\pip\_internal\cli\spinners.py", line 9, in <module>
from pip._internal.utils.logging import get_indentation
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\pip\_internal\utils\logging.py", line 29, in <module>
from pip._internal.utils.misc import ensure_dir
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\pip\_internal\utils\misc.py", line 41, in <module>
from pip._internal.exceptions import CommandError
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\pip\_internal\exceptions.py", line 13, in <module>
from pip._vendor.requests.models import Request, Response
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\pip\_vendor\requests\__init__.py", line 149, in <module>
from . import packages, utils
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\pip\_vendor\requests\utils.py", line 24, in <module>
from . import certs
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\wrapt\importer.py", line 177, in _exec_module
notify_module_loaded(module)
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\wrapt\decorators.py", line 470, in _synchronized
return wrapped(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\wrapt\importer.py", line 136, in notify_module_loaded
hook(module)
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\certifi_win32\wrapt_pip.py", line 35, in apply_patches
import certifi
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\wrapt\importer.py", line 177, in _exec_module
notify_module_loaded(module)
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\wrapt\decorators.py", line 470, in _synchronized
return wrapped(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\wrapt\importer.py", line 136, in notify_module_loaded
hook(module)
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\certifi_win32\wrapt_certifi.py", line 20, in apply_patches
certifi_win32.wincerts.CERTIFI_PEM = certifi.where()
^^^^^^^^^^^^^^^
File "C:\Users\johndoe\envs\MyEnv\Lib\site-packages\certifi\core.py", line 37, in where
_CACERT_PATH = str(_CACERT_CTX.__enter__())
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\johndoe\Python\Lib\contextlib.py", line 137, in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
File "C:\Users\johndoe\Python\Lib\importlib\resources\_common.py", line 80, in _tempfile
os.write(fd, reader())
^^^^^^^^
File "C:\Users\johndoe\Python\Lib\importlib\resources\abc.py", line 76, in read_bytes
with self.open('rb') as strm:
^^^^^^^^^^^^^^^
File "C:\Users\johndoe\Python\Lib\importlib\resources\_adapters.py", line 141, in open
raise FileNotFoundError("Can't open orphan path")
FileNotFoundError: Can't open orphan path
Is there a fix for the issue that will allow me to generate a detailed requirements.txt showing all dependencies?
When running a project via pipenv, I get the following stacktrace. As I typically do not work with pipenv and cookiecutter projects, I have been struggling to fix it. Any help is appreciated. In case it matters, it is this project that I am trying to build and launch.
➜ project-shop git:(master) ✗ pipenv run ./manage.py runserver
[2022-11-04 13:08:19,329 autoreload] INFO: Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/user/miniconda3/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/home/user/miniconda3/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django/utils/autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django/utils/autoreload.py", line 76, in raise_last_exception
raise _exception[1]
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django/core/management/__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django/utils/autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django/apps/registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/home/user/miniconda3/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/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django_elasticsearch_dsl/__init__.py", line 5, in <module>
from .documents import Document # noqa
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django_elasticsearch_dsl/documents.py", line 8, in <module>
from elasticsearch.helpers import bulk, parallel_bulk
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/elasticsearch/__init__.py", line 36, in <module>
from .client import Elasticsearch
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/elasticsearch/client/__init__.py", line 23, in <module>
from ..transport import Transport, TransportError
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/elasticsearch/transport.py", line 26, in <module>
from .connection import Urllib3HttpConnection
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/elasticsearch/connection/__init__.py", line 20, in <module>
from .http_urllib3 import Urllib3HttpConnection, create_ssl_context
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/elasticsearch/connection/http_urllib3.py", line 18, in <module>
import ssl
File "/home/user/miniconda3/lib/python3.7/ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: libssl.so.1.0.0: cannot open shared object file: No such file or directory
add :
deb http://security.ubuntu.com/ubuntu xenial-security main
in /etc/apt/source.list
then ==> apt-get update ,
apt install libssl1.0.0
I am new to Django and I want to create some API with tastypie, but when I import ModelResource from tastypie.resource I face with error :/
I just do this:
from tastypie.resources import ModelResource
I get this error:
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/core/management/commands/runserver.py", line 110, in inner_run
autoreload.raise_last_exception()
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/utils/autoreload.py", line 87, in raise_last_exception
raise _exception[1]
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/core/management/__init__.py", line 375, in execute
autoreload.check_errors(django.setup)()
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/apps/config.py", line 301, in import_models
self.models_module = import_module(models_module_name)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/Users/macbook/Documents/PriceList/api/models.py", line 4, in <module>
from tastypie.resources import ModelResource
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/tastypie/resources.py", line 22, in <module>
from django.contrib.gis.db.models.fields import GeometryField
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/contrib/gis/db/models/__init__.py", line 3, in <module>
import django.contrib.gis.db.models.functions # NOQA
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/contrib/gis/db/models/functions.py", line 3, in <module>
from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/contrib/gis/db/models/fields.py", line 3, in <module>
from django.contrib.gis import forms, gdal
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/contrib/gis/forms/__init__.py", line 3, in <module>
from .fields import ( # NOQA
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/contrib/gis/forms/fields.py", line 2, in <module>
from django.contrib.gis.gdal import GDALException
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/contrib/gis/gdal/__init__.py", line 28, in <module>
from django.contrib.gis.gdal.datasource import DataSource
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/contrib/gis/gdal/datasource.py", line 40, in <module>
from django.contrib.gis.gdal.driver import Driver
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/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 "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/contrib/gis/gdal/prototypes/ds.py", line 9, in <module>
from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal
File "/Users/macbook/.local/share/virtualenvs/PriceList-ofEay4QN/lib/python3.9/site-packages/django/contrib/gis/gdal/libgdal.py", line 50, in <module>
lgdal = CDLL(lib_path)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/usr/local/lib/libgdal.dylib, 6): Symbol not found: _curl_multi_poll
Referenced from: /usr/local/lib/libgdal.dylib
Expected in: /usr/lib/libcurl.4.dylib
in /usr/local/lib/libgdal.dylib
The current Django version is 3.2 . I try to install the latest version of Django (4.1.1) to fix the error but it doesn't work. The version of tastypie is 0.14.4.
If it helps I use python version 3.9.
Thanks
Problem solved :/
There was a problem with GDAL on my system and the Django version.
I just run this command in my terminal:
brew link --overwrite gdal
and downgrade the Django version to 3.2 .
installed:
mingw-w64-x86_64-python-pip 21.0.1-2
mingw-w64-x86_64-python 3.8.8-2
environment variable:
PATH=/mingw64/bin:/usr/bin:/mingw64/lib/python3.8/lib-dynload:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
$ pip --version
Traceback (most recent call last):
File "C:\bin\msys64\mingw64\bin\pip-script.py", line 33, in <module>
sys.exit(load_entry_point('pip==21.0.1', 'console_scripts', 'pip')())
File "C:\bin\msys64\mingw64\bin\pip-script.py", line 25, in importlib_load_entry_point
return next(matches).load()
File "C:/bin/msys64/mingw64/lib/python3.8/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "C:/bin/msys64/mingw64/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 "C:/bin/msys64/mingw64/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 8, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:/bin/msys64/mingw64/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:/bin/msys64/mingw64/lib/python3.8/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "C:/bin/msys64/mingw64/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.py", line 22, in <module>
from pip._internal.cli.progress_bars import BAR_TYPES
File "C:/bin/msys64/mingw64/lib/python3.8/site-packages/pip/_internal/cli/progress_bars.py", line 9, in <module>
from pip._internal.utils.logging import get_indentation
File "C:/bin/msys64/mingw64/lib/python3.8/site-packages/pip/_internal/utils/logging.py", line 14, in <module>
from pip._internal.utils.misc import ensure_dir
File "C:/bin/msys64/mingw64/lib/python3.8/site-packages/pip/_internal/utils/misc.py", line 20, in <module>
from pip._vendor import pkg_resources
File "C:/bin/msys64/mingw64/lib/python3.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 35, in <module>
import plistlib
File "C:/bin/msys64/mingw64/lib/python3.8/plistlib.py", line 65, in <module>
from xml.parsers.expat import ParserCreate
File "C:/bin/msys64/mingw64/lib/python3.8/xml/parsers/expat.py", line 4, in <module>
from pyexpat import *
ImportError: DLL load failed while importing pyexpat: ▒Ҳ▒▒▒ָ▒▒▒▒ģ▒顣
[0x7FF8AD8DE0A4] ANOMALY: use of REX.w is meaningless (default operand size is 64)
[0x7FF8AD8DE0A4] ANOMALY: use of REX.w is meaningless (default operand size is 64)
please help me, big brother
I'm running wagtail in a virtualenvwrapper on my machine. The requirements all install as needed
Django>=2.0,<2.1
wagtail>=2.0,<2.1
I've even started this process over again by completely uninstalling django and wagtail. After reinstall wagtail, I run wagtail start mysite, cd into my directory and run python manage.py migrate. This is what I see:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
utility.execute()
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/management/base.py", line 332, in execute
self.check()
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/management/base.py", line 364, in check
include_deployment_checks=include_deployment_checks,
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 58, in _run_checks
issues.extend(super()._run_checks(**kwargs))
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/management/base.py", line 351, in _run_checks
return checks.run_checks(**kwargs)
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/checks/registry.py", line 73, in run_checks
new_errors = check(app_configs=app_configs)
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/checks/urls.py", line 40, in check_url_namespaces_unique
all_namespaces = _load_all_namespaces(resolver)
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/checks/urls.py", line 57, in _load_all_namespaces
url_patterns = getattr(resolver, 'url_patterns', [])
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/utils/functional.py", line 36, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/urls/resolvers.py", line 536, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/utils/functional.py", line 36, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/urls/resolvers.py", line 529, in urlconf_module
return import_module(self.urlconf_name)
File "/Users/johnbriggs/.virtualenvs/wagtail/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 "/Users/johnbriggs/Sites/wagtail/farts/farts/urls.py", line 5, in <module>
from wagtail.admin import urls as wagtailadmin_urls
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/wagtail/admin/urls/__init__.py", line 13, in <module>
from wagtail.admin.api import urls as api_urls
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/wagtail/admin/api/urls.py", line 6, in <module>
from .endpoints import PagesAdminAPIEndpoint
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/wagtail/admin/api/endpoints.py", line 3, in <module>
from wagtail.api.v2.endpoints import PagesAPIEndpoint
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/wagtail/api/v2/endpoints.py", line 9, in <module>
from rest_framework.renderers import BrowsableAPIRenderer, JSONRenderer
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/rest_framework/renderers.py", line 25, in <module>
from rest_framework import VERSION, exceptions, serializers, status
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/rest_framework/exceptions.py", line 17, in <module>
from rest_framework.utils.serializer_helpers import ReturnDict, ReturnList
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/rest_framework/utils/serializer_helpers.py", line 9, in <module>
from rest_framework.compat import unicode_to_repr
File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/rest_framework/compat.py", line 26, in <module>
from django.core.urlresolvers import ( # Will be removed in Django 2.0
ModuleNotFoundError: No module named 'django.core.urlresolvers'
I haven't added in any custom code.. this is a from-the-start installation. What is causing this error?
It turns out that djangorestframework was an older version. It was most definitely not a duplicate of the question suggested but I was able to solve it by upgrading my version (as suggested by #Alexy). I'm leaving this up in case someone else has a similar issue.