Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   pythonOCC examples doesn't work? (http://www.velocityreviews.com/forums/t952090-pythonocc-examples-doesnt-work.html)

Jayden 09-12-2012 04:02 AM

pythonOCC examples doesn't work?
 
I installed
(1) pythonxy2.7.2.3 (with python2.7) and
(2) pythonOCC-0.5-all-in-one.win32.py26
on windows 7 64 bit computer.

I try run pythonOCC examples in its example folder, such as the helloworld.py and got errors as follows:

ImportantError: DLL load failed: The specified module could not be found.

The error come from the line of code:

from OCC.BrepPrimAPI import *

How to fix the error? Thanks a lot!!

Marco Nawijn 09-12-2012 04:42 AM

Re: pythonOCC examples doesn't work?
 
On Wednesday, September 12, 2012 6:02:14 AM UTC+2, Jayden wrote:
> I installed
>
> (1) pythonxy2.7.2.3 (with python2.7) and
>
> (2) pythonOCC-0.5-all-in-one.win32.py26
>
> on windows 7 64 bit computer.
>
>
>
> I try run pythonOCC examples in its example folder, such as the helloworld.py and got errors as follows:
>
>
>
> ImportantError: DLL load failed: The specified module could not be found.
>
>
>
> The error come from the line of code:
>
>
>
> from OCC.BrepPrimAPI import *
>
>
>
> How to fix the error? Thanks a lot!!


Hi Jayden,

It has been some time ago that I used PythonOCC and I used it on Linux, so I cannot be of much help here. It sounds like you have to tell Windows where to look for the installed libraries (environment variables?). Anyhow, I recommend to post the question to the PythonOCC mailinglist. They are quite responsive.

One last suggestion. OCC itself comes with a small utility called DRAWEXE. It is a tcl/tk program that can be used to play around with a lot of the functionality provided by OCC.

Good luck!

Marco

Mark Lawrence 09-12-2012 06:41 AM

Re: pythonOCC examples doesn't work?
 
On 12/09/2012 05:02, Jayden wrote:
> I installed
> (1) pythonxy2.7.2.3 (with python2.7) and
> (2) pythonOCC-0.5-all-in-one.win32.py26


Can you safely mix these?

> on windows 7 64 bit computer.
>
> I try run pythonOCC examples in its example folder, such as the helloworld.py and got errors as follows:
>
> ImportantError: DLL load failed: The specified module could not be found.
>
> The error come from the line of code:
>
> from OCC.BrepPrimAPI import *
>
> How to fix the error? Thanks a lot!!
>


See above, I hope, I don't actually know :)

--
Cheers.

Mark Lawrence.


Mark Lawrence 09-12-2012 07:37 AM

Re: pythonOCC examples doesn't work?
 
On 12/09/2012 08:19, Dwight Hutto wrote:
> So used to google, forgot to check the python docs:
>
> http://docs.python.org/faq/windows.html
>
> and this should be useful as well, which is from:
>
> http://stackoverflow.com/questions/5...encv-in-python
>
> "I suspect you have the same problem I've run into. If you have a 64-bit
> version of Python, it cannot load 32-bit DLLs. OpenCV currently only ships
> 32-bit binaries. If you want 64-bit .pyd and .dll files, you have to
> compile them yourself. There are some
> instructions<http://opencv.willowgarage.com/wiki/VisualC%2B%2B>on the
> OpenCV Wiki, but it's not for the faint of heart. Expect to have a
> substantial time investment.
>
> The easiest solution is to:
>
> 1. Uninstall 64-bit Python
> 2. Install a 32-bit distribution.
>
> The PythonXY distribution includes pyopencv -- a good set of OpenCV hooks.
> The only limitation is that it's 32-bit, so don't make plans to process
> gigapixel astronomy data with it! ;)
>
> If you *must* have the 64-bit version, follow these
> instructions<http://redkiing.wordpress.com/2010/10/03/opencv-and-visual-studio-2010-with-cmake/>to
> get it OpenCV to compile with Visual Studio 2010. There's a discussion
> on stackoverflow that describes building 64-bit apps with VC Express."
>
>
> And again, check on the pywin mailing list
>
>


All very impressive, but as Dennis Lee Bieber has pointed out and which
I suspected there is a binary incompatibility between the OP's Python
version and pythonOCC version. Others would be able to see this for
themselves but you insist on sending email without context. Please
don't do this.


--
Cheers.

Mark Lawrence.


Dwight Hutto 09-12-2012 08:12 AM

Re: pythonOCC examples doesn't work?
 
On Wed, Sep 12, 2012 at 3:37 AM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
> On 12/09/2012 08:19, Dwight Hutto wrote:
>>
>> So used to google, forgot to check the python docs:
>>
>> http://docs.python.org/faq/windows.html
>>
>> and this should be useful as well, which is from:
>>
>> http://stackoverflow.com/questions/5...encv-in-python
>>
>> "I suspect you have the same problem I've run into. If you have a
>> 64-bit
>> version of Python, it cannot load 32-bit DLLs. OpenCV currently only ships
>> 32-bit binaries. If you want 64-bit .pyd and .dll files, you have to
>> compile them yourself. There are some
>> instructions<http://opencv.willowgarage.com/wiki/VisualC%2B%2B>on the
>>
>> OpenCV Wiki, but it's not for the faint of heart. Expect to have a
>> substantial time investment.
>>
>> The easiest solution is to:
>>
>> 1. Uninstall 64-bit Python
>> 2. Install a 32-bit distribution.
>>
>>
>> The PythonXY distribution includes pyopencv -- a good set of OpenCV hooks.
>> The only limitation is that it's 32-bit, so don't make plans to process
>> gigapixel astronomy data with it! ;)
>>
>> If you *must* have the 64-bit version, follow these
>>
>> instructions<http://redkiing.wordpress.com/2010/10/03/opencv-and-visual-studio-2010-with-cmake/>to
>>
>> get it OpenCV to compile with Visual Studio 2010. There's a discussion
>> on stackoverflow that describes building 64-bit apps with VC Express."
>>
>>
>> And again, check on the pywin mailing list
>>
>>

>
> All very impressive, but as Dennis Lee Bieber has pointed out and which I
> suspected there is a binary incompatibility between the OP's Python version
> and pythonOCC version.


DIdn't see this, I was too busy helping the OP search for an answer,
and educate us both at the same time.

Others would be able to see this for themselves but
> you insist on sending email without context. Please don't do this.



How are my emails without context? I'm referring the OP to the docs,
as well as posts related to their question. It goes to use google, and
RTFM, and putting it politely to them.

I could summarize, but they have to do the real reading. I'm not
researching this, and if I was, I'd charge for the time. This is to
show that things can get complex if you don't use google, or read the
docs.

Why does the OP keep asking here, when there are answers out there.
especially on the pywin list, which Windows users are usually referred
to.

Please point out what's out of context. The links and references place
it into context if the OP finds them useful, and I believe I searched
well for them.

Would the OP like to tell me I wasn't helpful? Because now they're
probably on a search to figure out how to make these compatible, which
means more questions, and more reading.

Plus the OP said he's on 64. Read the quote from stackoverflow:


"I suspect you have the same problem I've run into. If you have a 64-bit
version of Python, it cannot load 32-bit DLLs. OpenCV currently only ships
32-bit binaries. If you want 64-bit .pyd and .dll files, you have to
compile them yourself. "

A different program, but roughly the same in analogy, I do believe.

And where in here was the OP referenced to the python docs on windows:

>> http://docs.python.org/faq/windows.html


Was that out of context as well?

Let's not argue about this, I was pointing them to what I saw as the
best possible resources to overcome his current problem, and it was
all in context of the conversation as far as I'm concerned.

--
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com

jelle 09-12-2012 03:12 PM

Re: pythonOCC examples doesn't work?
 
You installed python 2.7 and expect a 2.6 module to work with it.
That won't work. Finally, you need to install the OpenCasCade libs to be able to run PythonOCC.

-jelle

Jayden 09-12-2012 05:03 PM

Re: pythonOCC examples doesn't work?
 
On Wednesday, September 12, 2012 11:12:55 AM UTC-4, jelle wrote:
> You installed python 2.7 and expect a 2.6 module to work with it.
>
> That won't work. Finally, you need to install the OpenCasCade libs to be able to run PythonOCC.
>
>
>
> -jelle


I think that is the reason. Thanks a lot!!

Terry Reedy 09-12-2012 08:58 PM

Re: pythonOCC examples doesn't work?
 
> On 12/09/2012 08:19, Dwight Hutto wrote:

>> The easiest solution is to:
>>
>> 1. Uninstall 64-bit Python


No need to do this, at least not on windows.

>> 2. Install a 32-bit distribution.


in a separate directory. I have had both on my win7 machine so I could
run (test) python code on both. One can put python-code-dir.pth in the
site-packages directories of both.

--
Terry Jan Reedy


Prasad, Ramit 09-13-2012 11:26 PM

RE: pythonOCC examples doesn't work?
 
Dwight Hutto wrote:

[snip]


> On Wed, Sep 12, 2012 at 3:37 AM, Mark Lawrence <breamoreboy@yahoo.co.uk>
> wrote:


[snip]


> Others would be able to see this for themselves but

> > you insist on sending email without context. Please don't do this.

>
> How are my emails without context? I'm referring the OP to the docs,
> as well as posts related to their question. It goes to use google, and
> RTFM, and putting it politely to them.
>



I have noticed that you do not always quote what youare talking about.
Sometimes I can guess or look at another messageand see what you
are talking about, but not always. This list philosophy seems to be
"quote what is relevant and trim what is not". Not on a
"go lookup the previous message to find context".


> I could summarize, but they have to do the real reading. I'm not
> researching this, and if I was, I'd charge for the time. This is to
> show that things can get complex if you don't use google, or read the
> docs.



Context is not the same as explaining absolutely everything.
It means that I, the reader, can see *what* youare talking about
and what you are responding *to*.

I do agree with the stance not to spoon feed OP(s).


>
> Why does the OP keep asking here, when there are answers out there.
> especially on the pywin list, which Windows users are usually referred
> to.


I was not aware that Windows users were "usually" referred anywhere.
Most referrals are on a case-by-case basis as many problems or
questions from Windows Python developers are Python questions and
not specific to pywin.


>
> Please point outwhat's out of context. The links and references place
> it into context if the OP finds them useful, and I believe I searched
> well for them.
>
> Would the OP like to tell me I wasn't helpful? Because now they're
> probably on a search to figure out how to make these compatible, which
> means more questions, and more reading.


Nobody is claiming you are not helpful. I appreciate your effort,
I just do not always know what is going on in a thread especially
if I see the thread jump to something I can contribute to but now have
no context with which to help. Not to mention that the archive for
this list is searchable. Your answer is much more useful for future
searchers if you leave some context for someone reading this.

[snip]


>
> Let's not argue about this, I was pointing them to what I saw as the
> best possible resources to overcome his current problem, and it was
> all in context of the conversation as far as I'm concerned.
>


It is in context of the "thread", but the context of the
"conversation" was lost.


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legalprivilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.

Dwight Hutto 09-14-2012 01:11 AM

Re: pythonOCC examples doesn't work?
 
On Thu, Sep 13, 2012 at 7:26 PM, Prasad, Ramit
<ramit.prasad@jpmorgan.com> wrote:
> Dwight Hutto wrote:
>
> [snip]
>
>> On Wed, Sep 12, 2012 at 3:37 AM, Mark Lawrence <breamoreboy@yahoo.co.uk>
>> wrote:

>
> [snip]
>
>> Others would be able to see this for themselves but
>> > you insist on sending email without context. Please don't do this.

>>
>> How are my emails without context? I'm referring the OP to the docs,
>> as well as posts related to their question. It goes to use google, and
>> RTFM, and putting it politely to them.
>>

>
>
> I have noticed that you do not always quote what you are talking about.
> Sometimes I can guess or look at another message and see what you
> are talking about, but not always. This list philosophy seems to be
> "quote what is relevant and trim what is not". Not on a
> "go lookup the previous message to find context".
>
>> I could summarize, but they have to do the real reading. I'm not
>> researching this, and if I was, I'd charge for the time. This is to
>> show that things can get complex if you don't use google, or read the
>> docs.

>
>
> Context is not the same as explaining absolutely everything.
> It means that I, the reader, can see *what* you are talking about
> and what you are responding *to*.
>
> I do agree with the stance not to spoon feed OP(s).
>
>>
>> Why does the OP keep asking here, when there are answers out there.
>> especiThey would still need to process transactions like cash while offline, and they would also need access to their inventory.ally on the pywin list, which Windows users are usually referred
>> to.

>
> I was not aware that Windows users were "usually" referred anywhere.
> Most referrals are on a case-by-case basis as many problems or
> questions from Windows Python developers are Python questions and
> not specific to pywin.
>
>>
>> Please point out what's out of context. The links and references place
>> it into context if the OP finds them useful, and I believe I searched
>> well for them.
>>
>> Would the OP like to tell me I wasn't helpful? Because now they're
>> probably on a search to figure out how to make these compatible, which
>> means more questions, and more reading.

>
> Nobody is claiming you are not helpful. I appreciate your effort,
> I just do not always know what is going on in a thread especially
> if I see the thread jump to something I can contribute to but now have
> no context with which to help. Not to mention that the archive for
> this list is searchable. Your answer is much more useful for future
> searchers if you leave some context for someone reading this.
>
> [snip]
>
>>
>> Let's not argue about this, I was pointing them to what I saw as the
>> best possible resources to overcome his current problem, and it was
>> all in context of the conversation as far as I'm concerned.
>>

>
> It is in context of the "thread", but the context of the
> "conversation" was lost.
>
>
> This email is confidential and subject to important disclaimers and
> conditions including on offers for the purchase or sale of
> securities, accuracy and completeness of information, viruses,
> confidentiality, legal privilege, and legal entity disclaimers,
> available at http://www.jpmorgan.com/pages/disclosures/email.
> --
> http://mail.python.org/mailman/listinfo/python-list


Your point is taken. Most of the time, if it's in an in line response
I would write the email line by line, with the referenced text shown
above my response.

However, when it seems like a conversation, I just trim the above, and
respond. That's how I view an e-mail, like an ongoing conversation.

>From now on, I'll leave the mailing I'm responding to above, and

delete the point's I'm not talking about, which is about what I
usually do.

So being attacked about no context(which was an attack out of context,
based on a few messages one night), when the whole conversation is in
the topic reader/gmail/etc seemed a little ignorant to reading
through. All he had to do was look back up to the email s just above
my response, and see, or read just through mine, not read everyone.

But anyway, I'll be more informative as to exactly what I was
referencing, instead of treating it like an ongoing conversation where
everyone was present, and paying attention to the whole of the topic.


--
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com


All times are GMT. The time now is 02:34 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.