How to install the third party library in VC ?

I want to use Python third-party libraries in component’s PythonScript behavior. But when I tried to install the related library, It didn’t succeed, and return an error.

My installation process is as follows:
First, I installed the 2.7.15 version of Python on Windows.
Secondly, the numpy .whl installation package is downloaded, and the numpy third-party library is successfully installed on windows via “pip install numpy-1.15.4+mkl-cp27-cp27m-win_amd64.whl”;
Finally, copy and paste the numpy folder under C:\Python27\Lib\site-packages\ into the C:\Program Files\Visual Components\Visual Components Premium 4.1\Python\lib\site-packages directory.

Then,when I write the code in the PythonScript behavior of a component,I got an error as below.

I don’t know why this error occur.

Can you help me answer this question?Thanks very much!


I tried to install a few other python third-party libraries, most of which were successful, but the rest will always report this error.

Can someone help me with this question?

Hi wwn_h,

Did you already solve this problem? I have the same problem when I import docx library. It always show the DLL load error. My method is same with you. I used pip to install docx and lxml library in my windows system. And then copy docx and lxml folder to VC4.1premium\Python\lib\site-packages. I’m curious why can I use these library in my system, but can’t use in Visual Components?

If you solve it, please teach me how to solve it.

Thank you very much!!

I guess its not solved. Now its an headache to implement probability, distribution. For weighted average I was able to find a workaround with python>random library. At least I can create faulty parts with some weighted average. Have a look below.

my_list = [100] * 5 + [112] * 5 + [124] * 20 + [122] * 20 + [120.5] * 20 + [118.5] * 30
partHeight = random.choice(my_list)
#print "partHeight: ",partHeight
part.getProperty(‘CylinderHeight’).Value = partHeight