i'm trying to solve this problem for a week now and it seems i did all i could.
this is the error message i'm getting:
Traceback (most recent call last):
File "C:\Users\\anaconda3\envs\pygdal38\lib\site-packages\osgeo\__init__.py", line 29, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\\anaconda3\envs\pygdal38\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 657, in _load_unlocked
File "<frozen importlib._bootstrap>", line 556, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 1166, in create_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed while importing _gdal: Não foi possível encontrar o procedimento especificado.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:/Users//Desktop/Python/começando true color.py", line 8, in <module>
from remap import remap # Import the Remap function
File "c:\Users\\Desktop\Python\remap.py", line 6, in <module>
from osgeo import gdal
File "C:\Users\\anaconda3\envs\pygdal38\lib\site-packages\osgeo\__init__.py", line 45, in <module>
_gdal = swig_import_helper()
File "C:\Users\\anaconda3\envs\pygdal38\lib\site-packages\osgeo\__init__.py", line 41, in swig_import_helper
raise ImportError(traceback_string + '\n' + msg)
ImportError: Traceback (most recent call last):
File "C:\Users\\anaconda3\envs\pygdal38\lib\site-packages\osgeo\__init__.py", line 29, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\\anaconda3\envs\pygdal38\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 657, in _load_unlocked
File "<frozen importlib._bootstrap>", line 556, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 1166, in create_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed while importing _gdal: Não foi possível encontrar o procedimento especificado.
On Windows, with Python >= 3.8, DLLs are no longer imported from the PATH.
If gdalXXX.dll is in the PATH, then set the USE_PATH_FOR_GDAL_PYTHON=YES environment variable
to feed the PATH into os.add_dll_directory().
at first i thought it could be a problem with GDAL, so i uninstalled through conda and reinstalled but didn't work. So i went in the anaconda cmd and opened python shell in it
when i tried to import GDAL it showed the same thing
Python 3.9.12 (main, Apr 4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from osgeo import gdal
Traceback (most recent call last):
File "C:\Users\\anaconda3\lib\site-packages\osgeo\__init__.py", line 29, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\\anaconda3\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 666, in _load_unlocked
File "<frozen importlib._bootstrap>", line 565, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 1173, in create_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
ImportError: DLL load failed while importing _gdal: Não foi possível encontrar o módulo especificado.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\ire0052\anaconda3\lib\site-packages\osgeo\__init__.py", line 45, in <module>
_gdal = swig_import_helper()
File "C:\Users\ire0052\anaconda3\lib\site-packages\osgeo\__init__.py", line 41, in swig_import_helper
raise ImportError(traceback_string + '\n' + msg)
ImportError: Traceback (most recent call last):
File "C:\Users\ire0052\anaconda3\lib\site-packages\osgeo\__init__.py", line 29, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\ire0052\anaconda3\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 666, in _load_unlocked
File "<frozen importlib._bootstrap>", line 565, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 1173, in create_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
ImportError: DLL load failed while importing _gdal: Não foi possível encontrar o módulo especificado.
On Windows, with Python >= 3.8, DLLs are no longer imported from the PATH.
If gdalXXX.dll is in the PATH, then set the USE_PATH_FOR_GDAL_PYTHON=YES environment variable
to feed the PATH into os.add_dll_directory().
What almost helped was creating a new environment for GDAL with a downgraded python version (3.8.13).
This is how it went:
>>> from osgeo import gdal
>>>
no error message. But when running the code i want in VS CODE it appears again...
Does anyone have a way to solve this?
Related
I am currently following a book(Trading Evolved) for learning the algorithmic trading but got **stuck on ingesting quandal what should I do now. I have tried to find the answer but can not get any solution for the same. PLEASE HELP
'''(zip35) C:\Users\jayan>zipline ingest -b quandl
Traceback (most recent call last):
File "C:\Users\jayan\anaconda3\envs\zip35\Scripts\zipline-script.py", line 33, in <module>
sys.exit(load_entry_point('zipline==1.4.1', 'console_scripts', 'zipline')())
File "C:\Users\jayan\anaconda3\envs\zip35\Scripts\zipline-script.py", line 25, in
importlib_load_entry_point
return next(matches).load()
File "C:\Users\jayan\anaconda3\envs\zip35\lib\site-packages\importlib_metadata\__init__.py", line
100, in load
module = import_module(match.group('module'))
File "C:\Users\jayan\anaconda3\envs\zip35\lib\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 941, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
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 "C:\Users\jayan\anaconda3\envs\zip35\lib\site-packages\zipline\__init__.py", line 29, in
<module>
from .utils.run_algo import run_algorithm
File "C:\Users\jayan\anaconda3\envs\zip35\lib\site-packages\zipline\utils\run_algo.py", line 20, in
<module>
from zipline.data import bundles
File "C:\Users\jayan\anaconda3\envs\zip35\lib\site-packages\zipline\data\bundles\__init__.py", line
2, in <module>
from . import quandl # noqa
File "C:\Users\jayan\anaconda3\envs\zip35\lib\site-packages\zipline\data\bundles\quandl.py", line
16, in <module>
from . import core as bundles
File "C:\Users\jayan\anaconda3\envs\zip35\lib\site-packages\zipline\data\bundles\core.py", line 15,
in <module>
from ..minute_bars import (
File "C:\Users\jayan\anaconda3\envs\zip35\lib\site-packages\zipline\data\minute_bars.py", line 30, in
<module>
import tables
File "C:\Users\jayan\anaconda3\envs\zip35\lib\site-packages\tables\__init__.py", line 99, in <module>
from .utilsextension import (
ImportError: DLL load failed: The specified module could not be found.'''
Thank you to whoever replies to this.
Typically when there is a missing DLL in a Python package it's due to the absence of the C++ redistributable:
https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads
system: windows 10,
language: python 3.6.5
I installed the quickfix 1.15.1 by pip install quickfix-1.15.1-cp36-cp36m-win_amd64.whl downloaded from web.
When I try like:
import quickfix
errors:
*Connected to pydev debugger (build 202.6948.78)
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\quickfix.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\ProgramData\Anaconda3\lib\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 658, in _load_unlocked
File "<frozen importlib._bootstrap>", line 571, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 922, in create_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
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 "C:\ProgramData\Anaconda3\lib\site-packages\quickfix.py", line 21, in <module>
_quickfix = swig_import_helper()
File "C:\ProgramData\Anaconda3\lib\site-packages\quickfix.py", line 20, in swig_import_helper
return importlib.import_module('_quickfix')
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: The specified module could not be found.
Process finished with exit code 1*
And I had installed .Net 5.0
If you are sure that quickfix is correctly installed in your environment and the PYTHONPATH has access to this environment, then you can try to check the option 'Load conda env vars before run?' on Window -> Preferences -> PyDev -> Interpreters -> Python Interpreter.
It's possible that the import is failing because that package is using an environment variable to load the modules, and PyDev by default is not loading this variable before running the script.
I'm having trouble importing the nlopt library in Python 3.7.4.
I'm using anaconda, but as nlopt isn't available through conda install, I've installed nlopt with pip.
Here is the error message:
>>> import nlopt
Traceback (most recent call last):
File "C:\Users\nick.rhodes\AppData\Local\Continuum\anaconda3\lib\site-packages\nlopt\nlopt.py", line 22, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\nick.rhodes\AppData\Local\Continuum\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 670, in _load_unlocked
File "<frozen importlib._bootstrap>", line 583, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 1043, in create_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
File "<stdin>", line 1, in <module>
File "C:\Users\nick.rhodes\AppData\Local\Continuum\anaconda3\lib\site-packages\nlopt\__init__.py", line 1, in <module>
from .nlopt import *
File "C:\Users\nick.rhodes\AppData\Local\Continuum\anaconda3\lib\site-packages\nlopt\nlopt.py", line 25, in <module>
_nlopt = swig_import_helper()
File "C:\Users\nick.rhodes\AppData\Local\Continuum\anaconda3\lib\site-packages\nlopt\nlopt.py", line 24, in swig_import_helper
return importlib.import_module('_nlopt')
File "C:\Users\nick.rhodes\AppData\Local\Continuum\anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_nlopt'
Since you are using conda, You should install nlopt using conda
conda install -c conda-forge nlopt
Installed nlopt: pip install nlopt on Windows 10.
Python: Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32.
command import nlopt fails with message
>>> import nlopt
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\nlopt\nlopt.py", line 22, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\user\AppData\Local\Continuum\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 670, in _load_unlocked
File "<frozen importlib._bootstrap>", line 583, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 1043, in create_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\nlopt\__init__.py", line 1, in <module>
from .nlopt import *
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\nlopt\nlopt.py", line 25, in <module>
_nlopt = swig_import_helper()
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\nlopt\nlopt.py", line 24, in swig_import_helper
return importlib.import_module('_nlopt')
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_nlopt'
when added 2 commands
>>> import sys
>>> sys.path.append(r'C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\nlopt')
fails with other message:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\nlopt\nlopt.py", line 22, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\user\AppData\Local\Continuum\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 670, in _load_unlocked
File "<frozen importlib._bootstrap>", line 583, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 1043, in create_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\nlopt\__init__.py", line 1, in <module>
from .nlopt import *
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\nlopt\nlopt.py", line 25, in <module>
_nlopt = swig_import_helper()
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\nlopt\nlopt.py", line 24, in swig_import_helper
return importlib.import_module('_nlopt')
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: The specified module could not be found.
I am trying to run a voice program in Python 3.7.4 and with pyttsx library. But I've faced up with lots of problems while converting the file into an .exe file from .py file. Initially the program as executed in python runs fine. But when i converted the .py file to.exe using pyinstaller it gives me the following error while running :
File "site-packages\pyttsx3\__init__.py", line 20, in init
File "c:\users\s som\appdata\local\programs\python\python37-32\lib\weakref.py", line 137, in __getitem__
o = self.data[key]()
KeyError: 'sapi5'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "DesktopAi.py", line 22, in <module>
File "site-packages\pyttsx3\__init__.py", line 22, in init
File "site-packages\pyttsx3\engine.py", line 30, in __init__
File "site-packages\pyttsx3\driver.py", line 50, in __init__
File "importlib\__init__.py", line 127, in import_module
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pyttsx3.drivers'
[11180] Failed to execute script DesktopAi ```
You can try the following:
pyinstaller --hidden-import=pyttsx3.drivers DesktopAi.py