Windows 11: xgboost Module Not Found - python

I am getting an error when I import xgboost
import xgboost as xgb
Traceback (most recent call last):
File "C:/Users/harsh/AppData/Roaming/JetBrains/PyCharmCE2021.2/scratches/scratch.py", line 2, in <module>
import xgboost as xgb
File "G:\My Drive\Oddsportal\venv\lib\site-packages\xgboost\__init__.py", line 9, in <module>
from .core import DMatrix, DeviceQuantileDMatrix, Booster
File "G:\My Drive\Oddsportal\venv\lib\site-packages\xgboost\core.py", line 21, in <module>
import scipy.sparse
File "G:\My Drive\Oddsportal\venv\lib\site-packages\scipy\__init__.py", line 136, in <module>
from . import _distributor_init
File "G:\My Drive\Oddsportal\venv\lib\site-packages\scipy\_distributor_init.py", line 61, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Program Files\Python37\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
Process finished with exit code 1
When I checked, it is installed.
Installed
It was working fine and I installed/upgraded to Windows 11 and this is a new error for me.

Related

Why can't I import panda to my python file?

Every time I try to import pandas I get this error and I don't understand why, because I successfully installed it. Here it is:
(base) C:\Users\snin2\Documents\panda python\codigos>C:/Users/snin2/anaconda3/python.exe "c:/Users/snin2/Documents/panda python/codigos/panda1.py"
Traceback (most recent call last):
File "c:/Users/snin2/Documents/panda python/codigos/panda1.py", line 1, in <module>
import pandas as pd
File "C:\Users\snin2\anaconda3\lib\site-packages\pandas\__init__.py", line 11, in <module>
__import__(dependency)
File "C:\Users\snin2\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py", line 140, in <module>
from . import _distributor_init
File "C:\Users\snin2\AppData\Roaming\Python\Python37\site-packages\numpy\_distributor_init.py", line 26, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Users\snin2\anaconda3\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
make sure you installed right version of anaconda python.or try to reinstall the python.
Here is the link,
if your system is 64 bit processor = https://repo.anaconda.com/archive/Anaconda3-2021.05-Windows-x86_64.exe
if 32 bit = https://repo.anaconda.com/archive/Anaconda3-2021.05-Windows-x86.exe

Error when importing scikit-learn library: [WinError126] specified module could not be found

I've install the scikit-learn module using pip, but when I try to import it in a file, I get the following error:
File "test.py", line 4, in <module>
from sklearn.model_selection import train_test_split
File "X:\...\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sklearn\__init__.py", line 80, in <module>
from .base import clone
File "X:\...\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sklearn\base.py", line 21, in <module>
from .utils import _IS_32BIT
File "X:\...\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sklearn\utils\__init__.py", line 20, in <module>
from scipy.sparse import issparse
File "X:\...\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\__init__.py", line 136, in <module>
from . import _distributor_init
File "X:\...\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\_distributor_init.py", line 61, in <module>
WinDLL(os.path.abspath(filename))
File "X:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2288.0_x64__qbz5n2kfra8p0\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
I've looked everywhere and haven't been able to find a solution. Please help.

Someone to explain to me how I can fix this problem with libraries? matplotlib

Someone know about this problem?
(Using Sublime Text)
from matplotlib import pyplot
Traceback (most recent call last):
File "C:\Users\Lorrety\Desktop\tarea9.py", line 1, in <module>
from matplotlib import pyplot
File "C:\Users\Lorrety\AppData\Roaming\Python\Python38\site-packages\matplotlib\__init__.py", line 139, in <module>
from . import cbook, rcsetup
File "C:\Users\Lorrety\AppData\Roaming\Python\Python38\site-packages\matplotlib\cbook\__init__.py", line 32, in <module>
import numpy as np
File "C:\Users\Lorrety\AppData\Roaming\Python\Python38\site-packages\numpy\__init__.py", line 138, in <module>
from . import _distributor_init
File "C:\Users\Lorrety\AppData\Roaming\Python\Python38\site-packages\numpy\_distributor_init.py", line 26, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Users\Lorrety\AppData\Local\Programs\Python\Python38-32\lib\ctypes\__init__.py", line 373, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

Spyder Anaconda launch error

When I installed the Anaconda python distribution in Ubuntu 16.04LTS, it doesn't launch and giving below error.
Studio-XPS-1640:~$ spyder
Traceback (most recent call last):
File "/usr/bin/spyder", line 3, in <module>
start_app.main()
File "/usr/lib/python2.7/dist-packages/spyderlib/start_app.py", line 114, in main
from spyderlib import spyder
File "/usr/lib/python2.7/dist-packages/spyderlib/spyder.py", line 155, in <module>
from spyderlib.utils.environ import WinUserEnvDialog
File "/usr/lib/python2.7/dist-packages/spyderlib/utils/environ.py", line 17, in <module>
from spyderlib.widgets.dicteditor import DictEditor
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/dicteditor.py", line 39, in <module>
from spyderlib.widgets.dicteditorutils import (sort_against, get_size,
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/dicteditorutils.py", line 78, in <module>
import bs4
File "/usr/lib/python2.7/dist-packages/bs4/__init__.py", line 30, in <module>
from .builder import builder_registry, ParserRejectedMarkup
File "/usr/lib/python2.7/dist-packages/bs4/builder/__init__.py", line 314, in <module>
from . import _html5lib
File "/usr/lib/python2.7/dist-packages/bs4/builder/_html5lib.py", line 70, in <module>
class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):
AttributeError: 'module' object has no attribute '_base'
How to solve this and what could be the reason for the error.

Python not starting due to failed import site module google_auth-1.1.1

I am using Windows and was running Python 3.5.4 from the Anaconda distribution.
I was trying to install PyQt5 on my computer and I believe I ended up disrupting Python startup.
Now when I attempt to open python or ipython or pip, I get the following error:
Error processing line 1 of C:\Users\George\Anaconda3\lib\site-packages\google_auth-1.1.1-py2.7-nspkg.pth:
Failed to import the site module
Traceback (most recent call last):
File "C:\Users\George\Anaconda3\lib\site.py", line 167, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "C:\Users\George\Anaconda3\lib\types.py", line 166, in <module>
import functools as _functools
File "C:\Users\George\Anaconda3\lib\functools.py", line 23, in <module>
from weakref import WeakKeyDictionary
File "C:\Users\George\Anaconda3\lib\weakref.py", line 12, in <module>
from _weakref import (
ImportError: cannot import name '_remove_dead_weakref'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\George\Anaconda3\lib\site.py", line 570, in <module>
main()
File "C:\Users\George\Anaconda3\lib\site.py", line 550, in main
known_paths = addsitepackages(known_paths)
File "C:\Users\George\Anaconda3\lib\site.py", line 327, in addsitepackages
addsitedir(sitedir, known_paths)
File "C:\Users\George\Anaconda3\lib\site.py", line 206, in addsitedir
addpackage(sitedir, name, known_paths)
File "C:\Users\George\Anaconda3\lib\site.py", line 177, in addpackage
import traceback
File "C:\Users\George\Anaconda3\lib\traceback.py", line 5, in <module>
import linecache
File "C:\Users\George\Anaconda3\lib\linecache.py", line 8, in <module>
import functools
File "C:\Users\George\Anaconda3\lib\functools.py", line 23, in <module>
from weakref import WeakKeyDictionary
File "C:\Users\George\Anaconda3\lib\weakref.py", line 12, in <module>
from _weakref import (
ImportError: cannot import name '_remove_dead_weakref'
I would prefer not to reinstall Anaconda as I had some files saved and other packages installed, yet don't quite know what to do.

Categories

Resources