Differences in Freecad between 32 bit windows and 64 bit windows

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Differences in Freecad between 32 bit windows and 64 bit windows

Post by wmayer »

Now to see why this makes FreeCAD to quit could you please test this test code?

Code: Select all

try:
    import assembly2lib
except Exception, inst:
    print('Error: ' + str(inst))
The expected behaviour is that a UnicodeDecodeError or UnicodeEncodeError is raised in the Python console.

Afterwards test this, please:

Code: Select all

import sys,os,traceback,cStringIO
try:
    import assembly2lib
except Exception, inst:
    output=cStringIO.StringIO()
    traceback.print_exc(file=output)
    print (output.getvalue())
    etype, value, tb = sys.exc_info()
    print('Error: ' + str(value))
The expected behaviour is that the ImportError is reported in the Report view but in the Python console no exception is raised.

Afterwards I can tell you how to fix the issue.
rasomei
Posts: 19
Joined: Fri May 01, 2015 11:54 am

Re: Differences in Freecad between 32 bit windows and 64 bit windows

Post by rasomei »

Hi again,

>>> try:
... import assembly2lib
... except Exception, inst:
... print('Error: ' + str(inst))
File "<input>", line 4
print('Error: ' + str(inst))
^
IndentationError: expected an indented block
>>> import sys,os,traceback,cStringIO
>>> try:
... import assembly2lib
... except Exception, inst:
... output=cStringIO.StringIO()
... traceback.print_exc(file=output)
... print (output.getvalue())
... etype, value, tb = sys.exc_info()
... print('Error: ' + str(value))
...
Traceback (most recent call last):
File "<input>", line 2, in <module>
File "E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\FreeCAD_assembly2-master\assembly2lib.py", line 11, in <module>
import numpy, os
File "E:\Software\FreeCAD_0.16.6124_x86_dev_bin\bin\lib\site-packages\numpy\__init__.py", line 170, in <module>
from . import add_newdocs
File "E:\Software\FreeCAD_0.16.6124_x86_dev_bin\bin\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "E:\Software\FreeCAD_0.16.6124_x86_dev_bin\bin\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "E:\Software\FreeCAD_0.16.6124_x86_dev_bin\bin\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "E:\Software\FreeCAD_0.16.6124_x86_dev_bin\bin\lib\site-packages\numpy\core\__init__.py", line 6, in <module>
from . import multiarray
ImportError: DLL load failed: Diese Anwendung konnte nicht gestartet werden, da die Side-by-Side-Konfiguration ung�ltig ist. Weitere Informationen finden Sie im Anwendungsereignisprotokoll. Weitere Details k�nnen auch mit dem Befehlszeilentool sxstrace.exe angezeigt w

Error: DLL load failed: Diese Anwendung konnte nicht gestartet werden, da die Side-by-Side-Konfiguration ung�ltig ist. Weitere Informationen finden Sie im Anwendungsereignisprotokoll. Weitere Details k�nnen auch mit dem Befehlszeilentool sxstrace.exe angezeigt w
>>>
rasomei
Posts: 19
Joined: Fri May 01, 2015 11:54 am

Re: Differences in Freecad between 32 bit windows and 64 bit windows

Post by rasomei »

Hi,
in the report view there is only this message directly after starting FreeCAD.
Cannot find icon: :/assembly2/icons/workBenchIcon.svg

But nothing else after the python commands.

Ralf
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Differences in Freecad between 32 bit windows and 64 bit windows

Post by wmayer »

IndentationError: expected an indented block
When using FF it always adds an extra space. You have to manually adjust the script. In front of "try" and "except" there must be no space and for the others two might be fine.
But nothing else after the python commands.
In this case you have to enable Python redirection. Go to the preferences > Output window and then on the bottom enable both "Redirect internal Python output/errors to report view".
rasomei
Posts: 19
Joined: Fri May 01, 2015 11:54 am

Re: Differences in Freecad between 32 bit windows and 64 bit windows

Post by rasomei »

Hallo,
I tried again:

Python 2.7.8 (default, Dec 4 2014, 10:05:50) [MSC v.1500 32 bit (Intel)] on win32
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> try:
... import assembly2lib
... except Exception, inst:
... print('Error: ' + str(inst))
...
Error: DLL load failed: Diese Anwendung konnte nicht gestartet werden, da die Side-by-Side-Konfiguration ung�ltig ist. Weitere Informationen finden Sie im Anwendungsereignisprotokoll. Weitere Details k�nnen auch mit dem Befehlszeilentool sxstrace.exe angezeigt w
>>> import sys,os,traceback,cStringIO
>>> try:
... import assembly2lib
... except Exception, inst:
... output=cStringIO.StringIO()
... traceback.print_exc(file=output)
... print (output.getvalue())
... etype, value, tb = sys.exc_info()
... print('Error: ' + str(value))
...
Traceback (most recent call last):
File "<input>", line 2, in <module>
File "E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Assembly2Workbench\assembly2lib.py", line 11, in <module>
import numpy, os
File "E:\Software\FreeCAD_0.16.6124_x86_dev_bin\bin\lib\site-packages\numpy\__init__.py", line 170, in <module>
from . import add_newdocs
File "E:\Software\FreeCAD_0.16.6124_x86_dev_bin\bin\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "E:\Software\FreeCAD_0.16.6124_x86_dev_bin\bin\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "E:\Software\FreeCAD_0.16.6124_x86_dev_bin\bin\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "E:\Software\FreeCAD_0.16.6124_x86_dev_bin\bin\lib\site-packages\numpy\core\__init__.py", line 6, in <module>
from . import multiarray
ImportError: DLL load failed: Diese Anwendung konnte nicht gestartet werden, da die Side-by-Side-Konfiguration ung�ltig ist. Weitere Informationen finden Sie im Anwendungsereignisprotokoll. Weitere Details k�nnen auch mit dem Befehlszeilentool sxstrace.exe angezeigt w

Error: DLL load failed: Diese Anwendung konnte nicht gestartet werden, da die Side-by-Side-Konfiguration ung�ltig ist. Weitere Informationen finden Sie im Anwendungsereignisprotokoll. Weitere Details k�nnen auch mit dem Befehlszeilentool sxstrace.exe angezeigt w
>>>

and the report view:

Run Gui init script
Init: Running FreeCADGuiInit.py start script...
Init: Searching modules...
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Sketcher... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\ReverseEngineering... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Image... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\PartDesign... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Ship... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Plot... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\MeshPart... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\OpenSCAD... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Fem... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Spreadsheet... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Start... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Points... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Draft... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Test... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Import... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Assembly2Workbench... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Complete... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Web... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Material... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Raytracing... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Mesh... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Path... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Arch... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Robot... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Part... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Idf(InitGui.py not found)... ignore
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Inspection... done
Init: Initializing E:\Software\FreeCAD_0.16.6124_x86_dev_bin\Mod\Drawing... done
Init: Loading FreeCAD GUI
Cannot find icon: :/assembly2/icons/workBenchIcon.svg
Init: Running FreeCADGuiInit.py start script... done
Init: Activating default workbench StartWorkbench
Wizard shaft module cannot be loaded
Module: Part
Loading Part module... done
Loading GUI of Part module... done
Loading Sketcher module... done
Loading GUI of Sketcher module... done
Loading GUI of PartDesign module... done
Loading PartDesign module... done
Init: Showing main window
Main window restored
Show main window
Toolbars restored
Init: Entering event loop
Init: Processing command line files
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Differences in Freecad between 32 bit windows and 64 bit windows

Post by wmayer »

Thanks for testing.

For me it's now quite unclear why the first test doesn't raise a second exception in the "except" branch because this is what happens when the InitGui.py file of the Assembly2 module is executed. So, I have to dig a bit more...

Now I see why the messages don't appear in the report view but in the Python console -- my fault.


And now to the solution:
1. As very first step you have to get the tool dependency walker. Extract the downloaded zip file and start depends.exe

2. Go to your numpy directory and drag and drop the file multiarray.pyd to dependecy walker. In the list of dependent files you should see one with a yellow bubble of the form MSVCR<number>.dll. Dependent on the used compiler this number can be 90, 100, 110, 120 and so on.

Can you tell me this number, please?
rasomei
Posts: 19
Joined: Fri May 01, 2015 11:54 am

Re: Differences in Freecad between 32 bit windows and 64 bit windows

Post by rasomei »

Hi,
there are a lot of errors. Please see the attached screenshot. I saved the file and zipped to multiarray,zip

regards
Attachments
multiarray.zip
(976.29 KiB) Downloaded 46 times
Dependency.JPG
Dependency.JPG (209.48 KiB) Viewed 2090 times
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Differences in Freecad between 32 bit windows and 64 bit windows

Post by wmayer »

Somewhere it lists the file msvcr90.dll, all the API-MS-WIN* files can be ignored. So, apparently the redistributable for VisualStudio 2008, 32-bit is missing on your system. Therefore go to https://www.microsoft.com/de-de/downloa ... aspx?id=29 and download the file vcredist_x86.exe and install it.

A side note: According to the output you have installed a file python27.dll into c:\windows\system32\. This directory is reserved for system libraries but the Python dll is not a system library. Having this file there could lead to problems.
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Differences in Freecad between 32 bit windows and 64 bit windows

Post by wmayer »

With git commit e9e9a38 FreeCAD now no longer quits with the error you have.
rasomei
Posts: 19
Joined: Fri May 01, 2015 11:54 am

Re: Differences in Freecad between 32 bit windows and 64 bit windows

Post by rasomei »

Hi,
I installed the vcredist_x86.exe and I deleted the Python.dll.
Could I do something in the moment?

Ralf
Post Reply