qgisred / QGISRed

GNU General Public License v2.0
23 stars 8 forks source link

OSError when importing data #32

Open qnmai opened 3 years ago

qnmai commented 3 years ago

When attempting to import data, I get the error below. This is the case for both inp and shp imports.

An error has occurred while executing Python code:

OSError: [WinError 193] %1 n’est pas une application Win32 valide

Traceback (most recent call last): File "C:/PROGRA~2/QGIS3~1.10/apps/qgis-ltr/./python/plugins\QGISRed\ui\qgisred_import_dialog.py", line 204, in importInpProject if not self.createProject(): File "C:/PROGRA~2/QGIS3~1.10/apps/qgis-ltr/./python/plugins\QGISRed\ui\qgisred_import_dialog.py", line 128, in createProject resMessage = GISRed.CreateProject(self.ProjectDirectory, self.NetworkName, epsg) File "C:/PROGRA~2/QGIS3~1.10/apps/qgis-ltr/./python/plugins\QGISRed\tools\qgisred_dependencies.py", line 263, in CreateProject mydll = WinDLL(QGISRedUtils().getCurrentDll()) File "C:\PROGRA~2\QGIS3~1.10\apps\Python37\lib\ctypes__init.py", line 356, in init__ self._handle = _dlopen(self._name, mode) OSError: [WinError 193] %1 n’est pas une application Win32 valide

Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] QGIS version: 3.10.7-A Coruña A Coruña, 7b4ca4c8d0

Python Path:

· C:/PROGRA~2/QGIS3~1.10/apps/qgis-ltr/./python

· C:/Users/admin.SPEED/AppData/Roaming/QGIS/QGIS3\profiles\default/python

· C:/Users/admin.SPEED/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins

· C:/PROGRA~2/QGIS3~1.10/apps/qgis-ltr/./python/plugins

· C:\PROGRA~2\QGIS3~1.10\apps\Python37

· C:\PROGRA~2\QGIS3~1.10\apps\Python37\Scripts

· C:\Program Files (x86)\QGIS 3.10\bin\python37.zip

· C:\PROGRA~2\QGIS3~1.10\apps\Python37\DLLs

· C:\PROGRA~2\QGIS3~1.10\apps\Python37\lib

· C:\Program Files (x86)\QGIS 3.10\bin

· C:\PROGRA~2\QGIS3~1.10\apps\Python37\lib\site-packages

· C:\PROGRA~2\QGIS3~1.10\apps\Python37\lib\site-packages\win32

· C:\PROGRA~2\QGIS3~1.10\apps\Python37\lib\site-packages\win32\lib

· C:\PROGRA~2\QGIS3~1.10\apps\Python37\lib\site-packages\Pythonwin

· C:/Users/admin.DOMAIN/AppData/Roaming/QGIS/QGIS3\profiles\default/python

Extra info: -offline environment (manual plugin and dependency installation) -French locale

neslerel commented 3 years ago

Hi @qnmai, Nice to see you in GitHub!

This error is new for us. Please, tell me if this computer is x64 or x86. I sent you the link dependencies for x64... If the computer is x86, I think you can change it in the link and download the new dependencies. Please, uninstall QGISRed dependencies from Programs and Features in the Control Panel of Window. To do it, close before all QGis instances.

If it is not the problem, we'll try another options...

qnmai commented 3 years ago

@neslerel Excuse me for the late reply. The computer is x64 Windows 7.

neslerel commented 3 years ago

We never tested the plugin in Windows 7, only in Windows 10 (x64 and x86). The only request is net framework 4.5... I'll try to investigate it.

neslerel commented 3 years ago

I have an idea.... In "C:/Users/admin.SPEED/AppData/Roaming/QGISRed/dlls" should be 2 dlls: ucrtbased.dll vcruntime140d.dll

These dlls maybe only work in Windows 10. You could try:

I'll continue thinking options

qnmai commented 3 years ago

@neslerel Here are the steps I took -- unfortunately I still get the same error when importing an inp file.

  1. Closed QGIS
  2. Renamed ucrtbased.dll and vcruntime140d.dll to ucrtbased.dll and vcruntime140d.dll
  3. Opened QGIS
  4. Import data (.inp)
neslerel commented 3 years ago

Other test:

Do you get the same error? If yes, it could discard previous tests.

neslerel commented 3 years ago

One more question: Installed QGis is x64 or x86 (I know that Windows is x64)? You can check it in Qgis help menu.

qnmai commented 3 years ago

@neslerel After moving all dlls starting with QGISRed.QGisPlugins.dll to another folder, I receive the message requiring dependency downloads. I had previously received this message when first installing the plugin, but it disappeared when manually installing the dependencies using the following link: http://www.redhisp.webs.upv.es/files/QGISRed/1.0.10.0/Installation_x64_en-US.msi

I did not have access to import the .inp and I did not receive any Python errors.

Here is the information listed under the help menu: image001 (3)

neslerel commented 3 years ago

Ok @qnmai. As you can see in the screenshot, in the window title specify that installed QGis is 32 bits (x86). You need to follow next steps:

  1. Close all Qgis instances.
  2. Go to Programs and Features of Windows (in Control Panel) and uninstall QGISRed.
  3. Go to "C:/Users/admin.SPEED/AppData/Roaming/QGISRed/". If dlls folder exists, remove it.
  4. Download in other computer the correct dependencies: http://www.redhisp.webs.upv.es/files/QGISRed/1.0.10.0/Installation_x86_en-US.msi
  5. Install these dependencies.
  6. Open QGis and try to use the plugin.

I hope these steps were the solution.

qnmai commented 3 years ago

@neslerel It turns out, I shouldn't have had the x86 version of QGIS installed to begin with. Now, after installing the 64-bit version of QGIS 3.10, on windows 7, with the 64-bit version dependencies, I have a different error (ImportError--I'll post the traceback depending on your response). Would you prefer me to open a different ticket, or revise this one?

neslerel commented 3 years ago

We can revise this one. If I see it is a big error, we can create new one.

neslerel commented 3 years ago

I changed of idea, please, create a new issue and we can close it.