Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
 

Problems using PythonOCC with Python2.6

Problems using PythonOCC with Python2.6
Heil 2009/11/03 16:22
Hello guys,

i downloaded and installed PythonOCC like written on the pythonOCC homepage and with simply testing :

from OCC import *

i got this error:

Traceback (most recent call last):
File "<pyshell<a href="http://tracker.dev.opencascade.org/view.php?id=3"; target="blank_">#3>", line 1, in <module>
from OCC import *
File "C:\Python26\lib\site-packages\OCC\Standard.py", line 28, in <module>
_Standard = swig_import_helper()
File "C:\Python26\lib\site-packages\OCC\Standard.py", line 27, in swig_import_helper
return _mod
UnboundLocalError: local variable '_mod' referenced before assignment


i already searched for help a lot of places, but found nothing. I think there is an error in load_module, cause on removing try and finally commands i get another error about a wrong dll version. I reached my horizon and hope someone can help me with this.

Thanks a lot
jelle 2009/11/03 16:37
> i already searched for help a lot of places

Well, you didn't find pythonocc.org ;') ( the pythonocc.org mailing list is a more appropriate place to talk pythonocc )
Have a look at the ( many ) samples that come with pythonocc!
The samples do provide you a great place to get familiar with pythonocc.

You'll see in the examples that you should import a submodule of the OCC module ( OCC is _huge_ you don't want to import it all at once ). So try "from OCC.gp import * " than you will find gp_Pnt for example.

examples:
http://download.gna.org/pythonocc/source_release/pythonOCC-0.3-samples.tgz

Thanks for your interest in pythonocc.

-jelle



Thomas Paviot 2009/11/03 17:51
Hi Heil,

This error generally occurs when shared libraries (.DLL if you run Windows) cannot be loaded (whether they're not in your PATH or there are linkage issues). According to the traceback, you run Python26 on Windows. I suggest you download/install the 'all_in_one' package for pythonOCC-0.3.

Best Regards,

Thomas
Heil 2009/11/04 16:20
thanks for help all,
i've found the pythonocc.org page ;) but it was a windows problem ... after admin reinstallation everything works well ...
jelle 2009/11/04 20:11
terrific! happy to have you on board ;')
Jarkko Nieminen 2013/10/07 16:48
I doubt you will be following this thread after 4 years, but I have exactly the same problem that you have. I have installed the 'all_in_one'- package and I am using python 2.6. Each time I try to use PythonOCC module I get an error message. For example:

from OCC import *
File "C:\Python26\lib\site-packages\OCC\Standard.py", line 28, in <module>
_Standard = swig_import_helper()
File "C:\Python26\lib\site-packages\OCC\Standard.py", line 27, in swig_import_helper
return _mod
UnboundLocalError: local variable '_mod' referenced before assignment

I am using 64-bit windows 7. Could that the cause of problems?
 
 
Latest news
  • Open CASCADE Technology 6.8.0 is available for download!
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map