Strange behavior of py 2.7 in r17

On 03/09/2015 at 01:49, xxxxxxxx wrote:

Hello
I use Python.win64.framework as main environment for 2.7... > any install command executed in root: pip install numpy and etc.

if i use windows command line and check module:
_python -c "import numpy; print numpy.__version__, numpy.__file__"
_ or execute scripts >> all are ok _
_
if in c4d: some libs are not loaded, numerous errors and bla-bla ... i read in net about virtual environment _(has c4d r17 such?!) :angry:

_ i several times reinstall modules: numpy, scipy, cython. After such clean-up and reinstall, modules work over session. Next session will not _

_Modules are for py 2.7
Test at windows os - win 8 x64 _

wheels of modules:
Cython-0.22.1-cp27-none-win_amd64.whl
numpy-1.10.0b1+mkl-cp27-none-win_amd64.whl
scipy-0.16.0-cp27-none-win_amd64.whl
_ Pillow-2.9.0-cp27-none-win_amd64.whl - for scipy

On 03/09/2015 at 03:35, xxxxxxxx wrote:

Caught such minutes ago, at such simple init:

import c4d  
import numpy as np  
  
def main() :  
  x = np.array([1, 2, 3])  
  print x  
  
if __name__=='__main__':  
  main()

got in c4d console:

Traceback (most recent call last) :  
  File "'scriptmanager'", line 2, in <module>  
  File "J:\maxon\C4DR17D\resource\modules\python\Python.win64.framework\lib\site-packages\numpy\__init__.py", line 195, in <module>  
  from . import add_newdocs  
  File "J:\maxon\C4DR17D\resource\modules\python\Python.win64.framework\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>  
  from numpy.lib import add_newdoc  
  File "J:\maxon\C4DR17D\resource\modules\python\Python.win64.framework\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>  
  from .type_check import *  
  File "J:\maxon\C4DR17D\resource\modules\python\Python.win64.framework\lib\site-packages\numpy\lib	ype_check.py", line 11, in <module>  
  import numpy.core.numeric as _nx  
  File "J:\maxon\C4DR17D\resource\modules\python\Python.win64.framework\lib\site-packages\numpy\core\__init__.py", line 14, in <module>  
  from . import multiarray  
ImportError: DLL load failed: ....

Result in r16:
[1 2 3]

On 03/09/2015 at 10:34, xxxxxxxx wrote:

Does it possible if something be wrong with vars PYTHONPATH /PYTHONHOME inside c4d?

I test examples for modules in root of Python.win64.framework - all are work _
_

On 04/09/2015 at 02:32, xxxxxxxx wrote:

Hi Ilya,

as stated in the announcement of the Python integration change, Python C-modules need to be recompiled with VS2012 SP4 and/or Xcode (latest version). From the "ImportError: DLL load failed" I'm guessing, this might be the issue here.

On 04/09/2015 at 03:36, xxxxxxxx wrote:

Originally posted by xxxxxxxx

Hi Ilya,

as stated in the announcement of the Python integration change, Python C-modules need to be recompiled with VS2012 SP4 and/or Xcode (latest version). From the "ImportError: DLL load failed" I'm guessing, this might be the issue here.

Awesome finding! Thank you... I put this reminder in front of me as billboard

I download compiled builds from http://www.lfd.uci.edu/~gohlke/pythonlibs
They have:

Many binaries depend on NumPy-1.9+MKL and the Microsoft Visual C++ 2008 (x64, x86, and SP1 for CPython 2.6 and 2.7 ), Visual C++ 2010 (x64, x86, for CPython 3.3 and 3.4), or the Windows 10 Universal C Runtime redistributable packages.

Probably they using http://www.microsoft.com/en-us/download/details.aspx?id=44266

And recompiled numpy, it works...

On 06/09/2015 at 06:36, xxxxxxxx wrote:

Alternative(or even one of standard) scheme or solution to compile or using "old dll" * module - use of anaconda mingwpy or modules base at mingwpy from anaconda, mingw64 compiler.

i compile numpy and several c-extensions, linking and etc. to vs2012.
I only could not to compile scipy for py.27_vc11, got numerous errors.
Ok i make test with mingwpy, compile and it works

* - used msvcr90.dll