MahmoudAbdelRahman / GH_CPython

CPython plugin for Rhino-Grasshopper
BSD 2-Clause "Simplified" License
175 stars 38 forks source link

Python (SPYDER) Import modules #41

Open loooo94 opened 4 years ago

loooo94 commented 4 years ago

Hi, I've just tried to import numpy or matplotlib in grasshopper with GH_CPython. I have Spyder 3 (ANACONDA), Python standalone, Microsoft Visual studio. My operating system is Windows 10.

It gives me a long errors messages and gives me some advise like:

  1. D:\anaconda3\lib\site-packages\numpy__init__.py:140: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service "

    from . import _distributor_init Traceback (most recent call last): File "D:\anaconda3\lib\site-packages\numpy\core__init__.py", line 24, in from . import multiarray File "D:\anaconda3\lib\site-packages\numpy\core\multiarray.py", line 14, in from . import overrides File "D:\anaconda3\lib\site-packages\numpy\core\overrides.py", line 7, in from numpy.core._multiarray_umath import ( ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\GH_CPython\PythonFileWritten_6.py", line 24, in import numpy as np File "D:\anaconda3\lib\site-packages\numpy__init.py", line 142, in from . import core File "D:\anaconda3\lib\site-packages\numpy\core\init__.py", line 54, in raise ImportError(msg) ImportError:

"

So, I don't knwo how can I figure out this issue! My goal is be able to use the whole python libraries on Grasshopper.

Thanks!

MahmoudAbdelRahman commented 4 years ago

Hi @loooo94 , Are you able to import numpy and matplotlib using D:\anaconda3\Python.exe ?

loooo94 commented 4 years ago

Yes I use it in Anaconda3. Maybe should be this: mkl-service but I don't understand where I need to check for this.

chirth commented 2 years ago

Hi, is this resolved yet? I had a similar problem when trying to use the interpreter from a conda environment. Seems like the environment's interpreter was used but outside the environment.

Is there a way to run GH_CPython within a specific environment?