#quickfix import failed in windows10 - python

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.

Related

Error message when trying to run a code with GDAL

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?

ModuleNotFoundError: No module named 'PySide2' while trying to use poetry env

i'm trying to use slicereg (https://github.com/brainglobe/slicereg) for data registration.
after import code from github page and install poetry to run slicereg i keep getting the following error :
The virtual environment found in ~\.conda\envs\sliceregenv seems to be broken.
Recreating virtualenv slicereg-6kSWvOuc-py3.8 in ~\AppData\Local\pypoetry\Cache\virtualenvs\slicereg-6kSWvOuc-py3.8
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "~\.conda\envs\sliceregenv\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 843, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "~\slicereg\slicereg\main.py", line 3, in <module>
from PySide2.QtWidgets import QApplication
ModuleNotFoundError: No module named 'PySide2'
Pyside2 is already installed in my env using pip.
Any advice on how to resolve this issue ?
Thx
Seems to be an issue, poetry fails to recognize conda environments as valid
see more at https://github.com/python-poetry/poetry/issues/4566
Remain unresolved for the current release (1.1.12)
Update : https://github.com/python-poetry/poetry/issues/5907

ModuleNotFoundError: No module named '_nlopt'

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

ModuleNotFoundError: No module named 'pyttsx3.drivers'

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

pyInstaller having trouble bundling a package containing SWIG modules

I’m running into an issue getting pyInstaller to bundle a module that contains SWIG modules. I have followed each of the guidelines listed in the pyInstaller doc which details SWIG support.
I get the following error when running the exe:
# sphinxbase._ad_win32 not found in PYZ
Traceback (most recent call last):
File "StartListening.py", line 10, in <module>
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 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 "c:\users\allen\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\sphinxbase\__init__.py", line 35, in <module>
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 "c:\users\allen\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\sphinxbase\ad_win32.py", line 32, in <module>
File "site-packages\sphinxbase\ad_win32.py", line 31, in swig_import_helper
File "importlib\__init__.py", line 126, in import_module
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'sphinxbase._ad_win32'
However, sphinxbase._ad_win32 does exists as a pyd file. I’m running Windows 10; why is pyInstaller having trouble bundling this module?
The third-party package I’m ultimately trying to import is SpeechRecognition which depends on pocketsphinx which depends on sphinxbase which is the module that is having issues.
Here is the object reference returned by
importlib.import_module('sphinxbase._ad_win32')
in the SWIG-generated python wrapper if that is helpful to someone:
<module 'sphinxbase._ad_win32' from 'C:\\Users\\bob\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\site-packages\\sphinxbase\\_ad_win32.pyd'>
Python version: 3.6.5
Edit: After some more research, I tried adding the .pyd to the 'binaries' list in the .spec file as well as adding 'sphinxbase._ad_win32' to the 'hidden-imports' list and combinations there-between, but this did not work either. The binary is there, in the correct location, I can't figure out why the bundled app can't find it.

Categories

Resources