Tag Archives: python

Pyinstaller Error: INTEL MKL ERROR: The specified module could not be found. mkl_intel_thread.1.dll.Intel MKL FATAL ERROR: Cannot

After using pyinstaller to package successfully, an error is reported when executing the executable file

Intel MKL error: the specified module could not be found. mkl_ intel_ thread.1.dll.
Intel MKL FATAL ERROR: Cannot load mkl_ intel_ thread.1.dll.
Method 1:

Enter the directory under CONDA

./conda/Liabary/bin/

After entering the directory, find mkl_ intel_ thread.1.dll   File, add the path to the system environment variable.

However, this method does not solve my problem, so it will MKL_ intel_ The thread.1.dll file is copied to the successfully packaged directory and placed in the folder of the executable file.

Problem-solving.

[Solved] AttributeError: module ‘selenium.webdriver‘ has no attribute ‘Chrome‘

**

Attributeerror: module ‘selenium. Webdriver’ has no attribute ‘chrome’

**
Description:
there is no problem creating a Google browser directly in the IDE
this error is reported when you go to Python
this is a novice problem

solution:
the reason for the error is that the selenium module is not installed in Python
this module is added in the setting project interpreter

in addition:
if it has been preceded, But not now
the possible reason is that you have opened a new project, which needs to be imported again

[Solved] AttributeError: Manager isn‘t available; ‘auth.User‘ has been swapped for ‘

AttributeError: Manager isn't available; ' auth.User' has been swapped for 'account.UserInfo'

This is because I have extended Django’s user authentication model

#setting.py
AUTH_USER_MODEL = 'account.UserInfo'

Official documents

from django.contrib.auth.models import User
from django.contrib.auth import get_user_model

User = get_user_model()

Or use the user info model directly

""" get_user_model"""
def get_user_model():
    """
    Return the User model that is active in this project.
    """
    try:
        return django_apps.get_model(settings.AUTH_USER_MODEL, require_ready=False)
    except ValueError:
        raise ImproperlyConfigured("AUTH_USER_MODEL must be of the form 'app_label.model_name'")
    except LookupError:
        raise ImproperlyConfigured(
            "AUTH_USER_MODEL refers to model '%s' that has not been installed" % settings.AUTH_USER_MODEL
        )

Invalid python sd, Fatal Python error: init_fs_encoding: failed to get the Python cod [How to Solve]

Error:
prompt when opening pycharm: invalid python sdk.
The cmd appears as: Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding;
Error message:
Python path configuration:
PYTHONHOME = ‘C:\PythonHome’
PYTHONPATH = ‘C:\PythonPath’
program name = ‘D:\Python38\python.exe’
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = ‘D:\Python38\python.exe’
sys.base_prefix = ‘C:\PythonHome’
sys.base_exec_prefix = ‘C:\PythonHome’
sys.executable = ‘D:\Python38\python.exe’
sys.prefix = ‘C:\PythonHome’
sys.exec_prefix = ‘C:\PythonHome’
sys.path = [
‘C:\PythonPath’,
‘D:\Python38\python38.zip’,
‘C:\PythonHome\DLLs’,
‘C:\PythonHome\lib’,
‘D:\Python38’,
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named ‘encodings’
Current thread 0x00008bd8 (most recent call first):

Configuring environment variables, no matter how they are configured, does not work.

Solution:
Tried opening the installation package directly and reinstalling it, and making changes in System Applications and Features, but none of them solved it.
I can only find python in settings-applications and features, uninstall it first, and then reinstall it.
The problem is solved, although after re-entering pycharm, the previous library needs to be reinstalled.

chatbot error: [E941] Can‘t find model ‘en‘

Today, when you try to run a demo of Chatbot and create an entity, an error occurs:

Traceback (most recent call last):
  File "c:/users/USER/desktop/bot.py", line 77, in <module>
    chatbot = ChatBot('Ron Obvious')
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\chatterbot.py", line 28, in __init__
    self.storage = utils.initialize_class(storage_adapter, **kwargs)
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\utils.py", line 33, in initialize_class
    return Class(*args, **kwargs)
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\storage\sql_storage.py", line 20, in __init__
    super().__init__(**kwargs)
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\storage\storage_adapter.py", line 21, in __init__
    'tagger_language', languages.ENG
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\tagging.py", line 13, in __init__
    self.nlp = spacy.load(self.language.ISO_639_1.lower())
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\spacy\__init__.py", line 47, in load
    return util.load_model(name, disable=disable, exclude=exclude, config=config)
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\spacy\util.py", line 328, in load_model
    raise IOError(Errors.E941.format(name=name, full=OLD_MODEL_SHORTCUTS[name]))
OSError: [E941] Can't find model 'en'. It looks like you're trying to load a model from a shortcut, which is deprecated as of spaCy v3.0. To load the model, use its full name instead:

nlp = spacy.load("en_core_web_sm")

For more details on the available models, see the models directory: https://spacy.io/models. If you want to create a blank model, use spacy.blank: nlp = spacy.blank("en")

In fact, I feel that there is a conflict between packages. Spacyv3.0 will no longer support the simple reference of “en”, and I expect the full name of “en”_ core_ web_ SM “reference. Chatbot failed to follow up, and kept trying the deprecated shortcut such as “en” in the source code.

resolvent:

Enter the tagging.py module in the Chatbot package in the PY environment, and the sentence mentioned in the error message will be:

self.nlp = spacy.load(self.language.ISO_639_1.lower())

Change to:

if self.language.ISO_639_1.lower() == 'en':
    self.nlp = spacy.load('en_core_web_sm')
else:
    self.nlp = spacy.load(self.language.ISO_639_1.lower())

The problem is resolved after reloading.

python gensim AttributeError: ‘Doc2Vec‘ object has no attribute ‘dv‘

python3

gensim 4.0.1

My code: doc2vec reported an error when loading the doc2vec model file

from gensim.models import Doc2Vec

doc2vec_model = Doc2Vec.load('data/doc2vec.model')

“AttributeError: ‘Doc2Vec’ object has no attribute ‘dv’”

Reason 1: there may be some problems with the latest version. Change the version!!!

Reason 2: another code   Change model.dv to = & gt;    model.docvecs  

resolvent:

I uninstalled gensim PIP uninstall gensim

Reinstall PIP install gensim = = 3.8.3

Solved!!! I hope it will be useful to you.