Windows 0.8.2237 Version mismatch error

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
nosneros
Posts: 6
Joined: Fri Apr 24, 2009 2:23 am

Windows 0.8.2237 Version mismatch error

Post by nosneros »

Hi All,

I recently installed FreeCAD 0.8.2237 on a Windows laptop using the .msi installer. I previously had 0.7 on it, but I did the uninstall through the Windows control panel before installing the new version. After installing, I'm getting the following error in the python console:

('Version number mismatch', '1.0.2', '1.0.3')

Unfortunately, I'm not sure which module this error is coming from. Is there any way to debug this problem on Windows (I'm more familiar with Linux these days)? Anyone else seeing the same problem?

Thanks very much!

Best regards,
nos
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Windows 0.8.2237 Version mismatch error

Post by jriegel »

I've not seen such an error so far. And Im not aware which kind of lib has this Version numbers...
If you start FreeCAD with the -l command line switch it write a log file, or you paste the content of the console
to this forum, so we can may be see whats happening!

Cheers Jürgen
Stop whining - start coding!
nosneros
Posts: 6
Joined: Fri Apr 24, 2009 2:23 am

Re: Windows 0.8.2237 Version mismatch error

Post by nosneros »

Hi Juergen,

Please find the log file pasted below (the forum won't let me attach the file, keeps telling me the extension is not allowed). The error occurs after the loading of the Mesh GUI module. I tried running the tests in the Test framework workbench. It is failing the "Workbench" test in Test Commands -> TestToolsGui -> Self-test with a dialog that pops up with the title "Workbench failure" and the message "('Version number mismatch', '1.0.2', '1.0.3')". If I double click the failure, I get a popup with a traceback and the bottom message reads "AssertionError: Test on activating workbench failed". Sorry I can't copy and paste the traceback, but maybe I can take a screenshot if needed. But anyway, seems like maybe something just needs to get updated to match the rest of FreeCAD?

Thanks!
nos

Code: Select all

Msg: FreeCAD 0.7, Libs: 0.8R2237
(c) Juergen Riegel, Werner Mayer 2001-2009
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Log: Time = Thu Jul 30 16:31:32 2009
Log: AppDataSkipVendor = true
Log: AppHomePath = C:/Program Files/FreeCAD0.8/
Log: AppIcon = FCIcon
Log: BinPath = C:/Program Files/FreeCAD0.8/bin\
Log: BuildCurrentDate = Fri Jul 10 19:48:23 2009
Log: BuildRepositoryURL = https://free-cad.svn.sourceforge.net/svnroot/free-cad/branches/Version-0-8
Log: BuildRevision = 2237
Log: BuildVersionMajor = 0
Log: BuildVersionMinor = 8
Log: CSF_GraphicShr = C:\OpenCASCADE6.3.0\ros\win32\bin\TKOpenGl.dll
Log: CSF_IGESDefaults = C:\OpenCASCADE6.3.0\ros\src\XSTEPResource
Log: CSF_LANGUAGE = us
Log: CSF_MDTVFontDirectory = C:\OpenCASCADE6.3.0\ros\src\FontMFT
Log: CSF_MDTVTexturesDirectory = C:\OpenCASCADE6.3.0\ros\src\Textures
Log: CSF_PluginDefaults = C:\OpenCASCADE6.3.0\ros\src\StdResource
Log: CSF_SHMessage = C:\OpenCASCADE6.3.0\ros\src\SHMessage
Log: CSF_STEPDefaults = C:\OpenCASCADE6.3.0\ros\src\XSTEPResource
Log: CSF_StandardDefaults = C:\OpenCASCADE6.3.0\ros\src\StdResource
Log: CSF_UnitsDefinition = C:\OpenCASCADE6.3.0\ros\src\UnitsAPI\Units.dat
Log: CSF_UnitsLexicon = C:\OpenCASCADE6.3.0\ros\src\UnitsAPI\Lexi_Expr.dat
Log: CSF_XCAFDefaults = C:\OpenCASCADE6.3.0\ros\src\StdResource
Log: ConsoleBanner = (c) Juergen Riegel, Werner Mayer 2001-2009
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##


Log: Debug = 0
Log: DocPath = C:/Program Files/FreeCAD0.8/doc\
Log: ExeName = FreeCAD
Log: ExeVendor = FreeCAD
Log: ExeVersion = 0.7
Log: LoggingFile = 1
Log: LoggingFileName = C:\Documents and Settings\lsorenso\Application Data\FreeCAD\FreeCAD.log
Log: MaintainerUrl = http://apps.sourceforge.net/mediawiki/free-cad/index.php?title=Main_Page
Log: PATH = C:\OpenCASCADE6.3.0\3rdparty\win32\vs;C:\OpenCASCADE6.3.0\3rdparty\win32\tcltk\bin;C:\OpenCASCADE6.3.0\ros\win32\bin;C:\PROGRAM FILES\THINKPAD\UTILITIES;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\Support Tools\;C:\Program Files\QuickTime\QTSystem\;C:\Python25;C:\Python25\DLLs;C:\Python25\Scripts;C:\Python25\Lib\site-packages\PyQt4;C:\Python25\gtk\bin;C:\Python25\gnuplot\bin;C:\Python25\Lib\site-packages\vtk;C:\Python25\OpenCV\bin;C:\Python25\GDAL\bin;C:\Program Files\pythonxy\console;C:\Program Files\pythonxy\SciTE-1.77.2;C:\Program Files\pythonxy\mingw\bin;C:\Program Files\pythonxy\swig;C:\Program Files\pythonxy\gettext\bin;C:\WINDOWS\System32;C:\Documents and Settings\lsorenso\Desktop\miktex\miktex\bin;C:\Documents and Settings\lsorenso\Desktop\windows_tools\sysinternals;C:\OpenCASCADE6.3.0\3rdparty\win32\vs;C:\OpenCASCADE6.3.0\3rdparty\win32\tcltk\bin;C:\OpenCASCADE6.3.0\ros\win32\bin;C:\PROGRAM FILES\THINKPAD\UTILITIES;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\Support Tools\;C:\Program Files\QuickTime\QTSystem\;C:\Python25;C:\Python25\DLLs;C:\Python25\Scripts;C:\Python25\Lib\site-packages\PyQt4;C:\Python25\gtk\bin;C:\Python25\gnuplot\bin;C:\Python25\Lib\site-packages\vtk;C:\Python25\OpenCV\bin;C:\Python25\GDAL\bin;C:\Program Files\pythonxy\console;C:\Program Files\pythonxy\SciTE-1.77.2;C:\Program Files\pythonxy\mingw\bin;C:\Program Files\pythonxy\swig;C:\Program Files\pythonxy\gettext\bin;C:\Program Files\CVS Suite\CVSNT Tools\;C:\Elmer6.0\lib;C:\Elmer6.0\bin;C:\Program Files\gmsh;C:\program files\Vim\vim72;C:\program files\Mozilla Firefox
Log: PythonSearchPath = C:\Program Files\FreeCAD0.8\bin\python25.zip;C:\Python25\Lib;C:\Python25\DLLs;C:\Python25\Lib\lib-tk;;C:\Program Files\FreeCAD0.8\bin
Log: RunMode = Gui
Log: SplashAlignment = Bottom|Left
Log: SplashPicture = FreeCADSplasher
Log: SplashTextColor = #000000
Log: StartWorkbench = CompleteWorkbench
Log: SystemParameter = C:\Documents and Settings\lsorenso\Application Data\FreeCAD\system.cfg
Log: TCLLIBPATH = C:\OpenCASCADE6.3.0\3rdparty\win32\tcltk\lib
Log: TCL_LIBRARY = C:\OpenCASCADE6.3.0\3rdparty\win32\tcltk\lib\tcl8.4
Log: UserAppData = C:\Documents and Settings\lsorenso\Application Data\FreeCAD\
Log: UserHomePath = C:\Documents and Settings\lsorenso\My Documents
Log: UserParameter = C:\Documents and Settings\lsorenso\Application Data\FreeCAD\user.cfg
Log: Verbose = 
Log: Create Application
Log: Init: starting App::FreeCADInit.py
Log: Using C:\Program Files\FreeCAD0.8\Mod as module path!
Log: Init:   Searching for modules...
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Sketcher... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\MeshPart... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Complete... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Image... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\PartDesign... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Raytracing... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Mesh... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Draft... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Cam... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Test... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Part... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Drawing... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Points... done
Log: System path after init:
Log:    C:\Program Files\FreeCAD0.8\bin
Log:    C:\Program Files\FreeCAD0.8\Mod\Sketcher
Log:    C:\Program Files\FreeCAD0.8\Mod\MeshPart
Log:    C:\Program Files\FreeCAD0.8\Mod\Complete
Log:    C:\Program Files\FreeCAD0.8\Mod\Image
Log:    C:\Program Files\FreeCAD0.8\Mod\PartDesign
Log:    C:\Program Files\FreeCAD0.8\Mod\Raytracing
Log:    C:\Program Files\FreeCAD0.8\Mod\Mesh
Log:    C:\Program Files\FreeCAD0.8\Mod\Draft
Log:    C:\Program Files\FreeCAD0.8\Mod\Cam
Log:    C:\Program Files\FreeCAD0.8\Mod\Test
Log:    C:\Program Files\FreeCAD0.8\Mod\Part
Log:    C:\Program Files\FreeCAD0.8\Mod\Drawing
Log:    C:\Program Files\FreeCAD0.8\Mod\Points
Log:    C:\OpenCASCADE6.3.0\3rdparty\win32\vs
Log:    C:\OpenCASCADE6.3.0\3rdparty\win32\tcltk\bin
Log:    C:\OpenCASCADE6.3.0\ros\win32\bin
Log:    C:\PROGRAM FILES\THINKPAD\UTILITIES
Log:    C:\WINDOWS\system32
Log:    C:\WINDOWS
Log:    C:\WINDOWS\System32\Wbem
Log:    C:\Program Files\ATI Technologies\ATI Control Panel
Log:    C:\Program Files\Support Tools\
Log:    C:\Program Files\QuickTime\QTSystem\
Log:    C:\Python25
Log:    C:\Python25\DLLs
Log:    C:\Python25\Scripts
Log:    C:\Python25\Lib\site-packages\PyQt4
Log:    C:\Python25\gtk\bin
Log:    C:\Python25\gnuplot\bin
Log:    C:\Python25\Lib\site-packages\vtk
Log:    C:\Python25\OpenCV\bin
Log:    C:\Python25\GDAL\bin
Log:    C:\Program Files\pythonxy\console
Log:    C:\Program Files\pythonxy\SciTE-1.77.2
Log:    C:\Program Files\pythonxy\mingw\bin
Log:    C:\Program Files\pythonxy\swig
Log:    C:\Program Files\pythonxy\gettext\bin
Log:    C:\WINDOWS\System32
Log:    C:\Documents and Settings\lsorenso\Desktop\miktex\miktex\bin
Log:    C:\Documents and Settings\lsorenso\Desktop\windows_tools\sysinternals
Log:    C:\OpenCASCADE6.3.0\3rdparty\win32\vs
Log:    C:\OpenCASCADE6.3.0\3rdparty\win32\tcltk\bin
Log:    C:\OpenCASCADE6.3.0\ros\win32\bin
Log:    C:\PROGRAM FILES\THINKPAD\UTILITIES
Log:    C:\WINDOWS\system32
Log:    C:\WINDOWS
Log:    C:\WINDOWS\System32\Wbem
Log:    C:\Program Files\ATI Technologies\ATI Control Panel
Log:    C:\Program Files\Support Tools\
Log:    C:\Program Files\QuickTime\QTSystem\
Log:    C:\Python25
Log:    C:\Python25\DLLs
Log:    C:\Python25\Scripts
Log:    C:\Python25\Lib\site-packages\PyQt4
Log:    C:\Python25\gtk\bin
Log:    C:\Python25\gnuplot\bin
Log:    C:\Python25\Lib\site-packages\vtk
Log:    C:\Python25\OpenCV\bin
Log:    C:\Python25\GDAL\bin
Log:    C:\Program Files\pythonxy\console
Log:    C:\Program Files\pythonxy\SciTE-1.77.2
Log:    C:\Program Files\pythonxy\mingw\bin
Log:    C:\Program Files\pythonxy\swig
Log:    C:\Program Files\pythonxy\gettext\bin
Log:    C:\Program Files\CVS Suite\CVSNT Tools\
Log:    C:\Elmer6.0\lib
Log:    C:\Elmer6.0\bin
Log:    C:\Program Files\gmsh
Log:    C:\program files\Vim\vim72
Log:    C:\program files\Mozilla Firefox
Log: Init: App::FreeCADInit.py done
Log: Init: Creating Gui::Application and QApplication
Log: Object::connect: No such slot Gui::DockWnd::TaskPanelView::task1()
Log: Init: Running FreeCADGuiInit.py start script...
Log: Init:   Searching modules...
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Sketcher... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\MeshPart... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Complete... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Image... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\PartDesign... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Raytracing... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Mesh... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Draft... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Cam... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Test... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Part... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Drawing... done
Log: Init:      Initializing C:\Program Files\FreeCAD0.8\Mod\Points... done
Log: Init: Loading FreeCAD GUI
Log: Init: Running FreeCADGuiInit.py start script... done
Log: Init: Activating default workbench CompleteWorkbench
Log: Loading Part module... done
Log: Loading GUI of Part module... done
Log: The class 'class PartGui::DlgSettingsGeneral' lacks of Q_OBJECT macro
Log: Loading Mesh module... done
Log: Loading GUI of Mesh module... done
Err: ('Version number mismatch', '1.0.2', '1.0.3')
Log: Init: Showing main window
Log: Main window restored
Log: Show main window
Log: Toolbars restored
Log: Init: Processing command line files
Log: Init: Entering event loop
Log: Hide main window
Log: Finish: Event loop left
Log: Destruct Gui::Application
Log: FreeCAD terminating...
Log: Saving system parameter...
Log: Saving system parameter...done
Log: Saving user parameter...
Log: Saving user parameter...done
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Windows 0.8.2237 Version mismatch error

Post by wmayer »

Hi,

googling for the message 'Version number mismatch', '1.0.2', '1.0.3' I found out that it must have to do something with Python's ctypes module. Having a look on the file __init__.py in the folder ctypes in the installed python25.zip file you'll find the block:

Code: Select all

######################################################################
#  This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
"""create and manipulate C data types in Python"""

import os as _os, sys as _sys

__version__ = "1.0.1"

from _ctypes import Union, Structure, Array
from _ctypes import _Pointer
from _ctypes import CFuncPtr as _CFuncPtr
from _ctypes import __version__ as _ctypes_version
from _ctypes import RTLD_LOCAL, RTLD_GLOBAL
from _ctypes import ArgumentError

from struct import calcsize as _calcsize

if __version__ != _ctypes_version:
    raise Exception, ("Version number mismatch", __version__, _ctypes_version)
...
I guess the _ctypes extension module is not delivered with the FreeCAD installer and it tries to load that from your Python installation. Apparently the expected and the given version don't match.

But the basic question is still why it tries to load the ctypes stuff at all? According to the log file this must happen somewhere inside the MeshGui module. At least on my system it doesn't!?

To narrow the problem a bit more you can define another default workbench e.g. the Part workbench (Preferences->General->Startup workbench). Then close and restart FreeCAD and try to load the listed workbenches in the combo box step by step. Note for which workbench you get that error.

Cheers,
Werner
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Windows 0.8.2237 Version mismatch error

Post by jriegel »

We could fix such a error by removing the ctype.py from the zip file we distribute on Windows...

Jürgen
Stop whining - start coding!
nosneros
Posts: 6
Joined: Fri Apr 24, 2009 2:23 am

Re: Windows 0.8.2237 Version mismatch error

Post by nosneros »

Hi Werner and Juergen,

Ah, the ctypes mismatch seems to make sense. I have the python(x,y) distribution installed on my Windows laptop in addition to FreeCAD 0.8. I tried switching through the workbenches according to your suggestion and it seems isolated to the "Complete" and "Points" workbenches.

I removed the ctypes folder from python25.zip per Juergen's suggestion and can confirm that this suppresses the error.

Please let me know if I can provide any more information!

Thanks!
nos
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Windows 0.8.2237 Version mismatch error

Post by jriegel »

Thanks,
its actually a bug on our side, I must not deliver the ctypes.py file if I not deliver the corresponding
PYD file. So far it works, but actually its a bug which go of late.

We will change that.

Cheers Jürgen
Stop whining - start coding!
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Windows 0.8.2237 Version mismatch error

Post by wmayer »

Hi,

since you have installed quite a lot of Python stuff on your system there might be a collision with one of the modules there with a FreeCAD Python module -- the Points module. If you start a normal Python text console (from your Python installation) is it possible to import a module "Points"?

Anyway, a problem I think is the Python search path for extra modules.
PythonSearchPath = C:\Program Files\FreeCAD0.8\bin\python25.zip;C:\Python25\Lib;C:\Python25\DLLs;C:\Python25\Lib\lib-tk;;C:\Program Files\FreeCAD0.8\bin
They come before the FreeCAD module paths and thus could cause some problems. For me the basic question is still why FreeCAD tried to load the ctypes module and why does it work to remove it.

Cheers,
Werner
nosneros
Posts: 6
Joined: Fri Apr 24, 2009 2:23 am

Re: Windows 0.8.2237 Version mismatch error

Post by nosneros »

Hi Werner,

Sorry for the slow reply. I was a little busy over the weekend.

I tried "import Points" from my regular python console, and it imported successfully. So I wanted to find out where it was located so I did "print Points.__file__" and I was surprised to find out that the module belongs to PyDSTools and not FreeCAD. So I removed PyDSTools from my module path and now everything is okay with FreeCAD, even with the original python25.zip!

It looks like it is a module collision problem, where the Points module from PyDSTools was loading ctypes. What's the standard method of avoiding module collisions in python? Should the Points modules and others belong to a separate namespace?

Thanks!
nos
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Windows 0.8.2237 Version mismatch error

Post by wmayer »

Hi,

of course the name "Points" for a Python module is not that unusual that's why I guessed there must be a collision. In our current developer version of FreeCAD I have fixed this issue by prepending the FreeCAD module paths to sys.path. This means that when importing Points it now first looks in the FreeCAD folders. This solution should be satisfactory for now, I think.

To avoid future problems -- because we could get name collisions in FreeCAD itself-- we also could use namespaces as you said. For instance we could do it then like: from FreeCAD.Mod import Points. This way it makes it also much easier to use FreeCAD as a library in another application.

Cheers,
Werner
Post Reply