Rhino 6.0, error: No module name numpy

When trying to run for instance :

https://compas-dev.github.io/main/examples/network-shortest-path.html

The error message appears: Message:

No module named numpy

Traceback:
line 1, in , “C:\Users\gabri\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas\plotters\core\helpers.py”
line 5, in , “C:\Users\gabri\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas\plotters\core_init_.py”
line 26, in , “C:\Users\gabri\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas\plotters_init_.py”
line 8, in , “C:\Users\gabri\AppData\Local\Temp\TempScript.py”

If have installed Compas through anconda and have tried the script externally on Spyder were it seems to work.

The question is: why dosen’t it work on Rhino (6.0) Python editor for me?

hi gborg,

Rhino uses IronPython. In IronPython packages such as numpy, scipy, matplotlib are not available. this is not a COMPAS problem but rather a limitation of IronPython itself. therefore examples that use these libraries directly will not work in Rhino. the shortest path plotter is such an example.

you are not the first to be confused by this so perhaps we should point this out more explicitly in the docs.

note that COMPAS provides an RPC server and an “XFunc” object to overcome the limitations of IronPython…

best,
tom

Hi,

I am working together with gborg.
We tested the “XFunc” by running the given example on:

https://compas-dev.github.io/main/api/generated/compas.utilities.XFunc.html#compas.utilities.XFunc

Unfortunatly we got the following error message:

Message: Traceback (most recent call last):
File “C:\ProgramData\Anaconda3\lib\site-packages\numpy\core_init_.py”, line 16, in
from . import multiarray
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 “”, line 51, in
File “C:\ProgramData\Anaconda3\lib\importlib_init_.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 967, in find_and_load_unlocked
File “”, line 677, in load_unlocked
File “”, line 728, in exec_module
File “”, line 219, in call_with_frames_removed
File "C:\ProgramData\Anaconda3\lib\site-packages\compas\numerical_init
.py", line 109, in
from .linalg import *
File “C:\ProgramData\Anaconda3\lib\site-packages\compas\numerical\linalg.py”, line 36, in
compas.raise_if_not_ironpython()
File “C:\ProgramData\Anaconda3\lib\site-packages\compas\numerical\linalg.py”, line 11, in
from numpy import array
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy_init
.py", line 142, in
from . import add_newdocs
File “C:\ProgramData\Anaconda3\lib\site-packages\numpy\add_newdocs.py”, line 13, in
from numpy.lib import add_newdoc
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib_init
.py", line 8, in
from .type_check import *
File “C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\type_check.py”, line 11, in
import numpy.core.numeric as nx
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core_init
.py", line 26, in
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you’re working with a numpy git repo, try git clean -xdf (removes all
files not under version control). Otherwise reinstall numpy.

Original error was: DLL load failed: The specified module could not be found.

Traceback:
line 410, in call, “C:\Users\Albin\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas\utilities\xfunc.py”
line 26, in , “C:\Users\Albin\Documents\master-thesis\Exempel_Albin\xFunc_Test.py”

It seems to be a problem with numpy. However, numpy works when running the example as gborg mentioned externally in Spyder. Running another example for rhino which does not require numpy works fine, we tested:

https://compas-dev.github.io/main/examples/delaunay-with-boundary.html

Is it because we are running Rhino 6.0 and is it possible to solve?

Best regards, Albin

hi,

can you check the version of numpy in the Anaconda Prompt?

>>> import numpy
>>> numpy.__version__

thanks,
tom

and maybe (for my information) the version of COMPAS, although it is unrelated…

>>> import compas
>>> compas.__version__

Here are the versions:

import numpy
numpy.version
‘1.15.4’
import compas
compas.version
‘0.5.0’

thanks, Albin

no nothing to do with Rhino.
for whatever reason this sometimes happens…

try the following in Anaconda Prompt

conda remove numpy scipy
conda install numpy=1.16 scipy=1.2

by the way, when did you install COMPAS?
was this before last week Friday?

Hey Tom! We installed compas last Friday. Now we tried to reinstall numpy and scipy as you recommended:

(base) C:\Windows\system32>conda remove numpy scipy
Collecting package metadata: done
Solving environment: done

Package Plan

environment location: C:\Users\gabri\Anaconda3

removed specs:
- numpy
- scipy

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
ca-certificates-2019.3.9   |       hecc5488_0         184 KB  conda-forge
certifi-2019.3.9           |           py37_0         149 KB  conda-forge
openssl-1.1.1b             |       hfa6e2cd_1         4.7 MB  conda-forge
------------------------------------------------------------
                                       Total:         5.1 MB

The following packages will be REMOVED:

anaconda-2018.12-py37_0
astropy-3.1-py37he774522_0
bkcharts-0.2-py37_0
blaze-0.11.3-py37_0
bokeh-1.0.2-py37_0
bottleneck-1.2.1-py37h452e1ab_1
compas-0.5.0-py37_0
dask-1.0.0-py37_0
datashape-0.5.4-py37_1
h5py-2.8.0-py37h3bdd7fb_2
imageio-2.4.1-py37_0
matplotlib-3.0.2-py37hc8f65d3_0
numba-0.41.0-py37hf9181ef_0
numexpr-2.6.8-py37hdce8814_0
numpy-1.15.4-py37h19fb1c0_0
odo-0.5.1-py37_0
pandas-0.23.4-py37h830ac7b_0
patsy-0.5.1-py37_0
pytables-3.4.4-py37he6f6034_0
pytest-arraydiff-0.3-py37h39e3cac_0
pytest-astropy-0.5.0-py37_0
pytest-doctestplus-0.2.0-py37_0
pywavelets-1.0.1-py37h8c2d366_0
scikit-image-0.14.1-py37ha925a31_0
scikit-learn-0.20.1-py37h343c172_0
scipy-1.1.0-py37h29ff71c_2
seaborn-0.9.0-py37_0
statsmodels-0.9.0-py37h452e1ab_0

The following packages will be UPDATED:

ca-certificates pkgs/main::ca-certificates-2018.03.07~ → conda-forge::ca-certificates-2019.3.9-hecc5488_0
certifi pkgs/main::certifi-2018.11.29-py37_0 → conda-forge::certifi-2019.3.9-py37_0
openssl pkgs/main::openssl-1.1.1a-he774522_0 → conda-forge::openssl-1.1.1b-hfa6e2cd_1

Proceed ([y]/n)? y

Downloading and Extracting Packages
ca-certificates-2019 | 184 KB | ############################################################################ | 100%
certifi-2019.3.9 | 149 KB | ############################################################################ | 100%
openssl-1.1.1b | 4.7 MB | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(base) C:\Windows\system32>conda install numpy=1.16 scipy=1.2
Collecting package metadata: done
Solving environment: done

Package Plan

environment location: C:\Users\gabri\Anaconda3

added / updated specs:
- numpy=1.16
- scipy=1.2

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
numpy-1.16.2               |   py37h19fb1c0_0          49 KB
numpy-base-1.16.2          |   py37hc3f5095_0         4.1 MB
scipy-1.2.1                |   py37h29ff71c_0        14.0 MB
------------------------------------------------------------
                                       Total:        18.2 MB

The following NEW packages will be INSTALLED:

numpy pkgs/main/win-64::numpy-1.16.2-py37h19fb1c0_0
scipy pkgs/main/win-64::scipy-1.2.1-py37h29ff71c_0

The following packages will be UPDATED:

numpy-base 1.15.4-py37hc3f5095_0 → 1.16.2-py37hc3f5095_0

Proceed ([y]/n)? y

Downloading and Extracting Packages
scipy-1.2.1 | 14.0 MB | ################################################################################################################################################# | 100%
numpy-1.16.2 | 49 KB | ################################################################################################################################################# | 100%
numpy-base-1.16.2 | 4.1 MB | ################################################################################################################################################# | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(base) C:\Windows\system32>conda install COMPAS
Collecting package metadata: done
Solving environment: done

Package Plan

environment location: C:\Users\gabri\Anaconda3

added / updated specs:
- compas

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
compas-0.5.0               |           py37_2         2.0 MB  conda-forge
matplotlib-3.0.3           |           py37_0           6 KB  conda-forge
matplotlib-base-3.0.3      |   py37h3e3dc42_0         6.5 MB  conda-forge
------------------------------------------------------------
                                       Total:         8.6 MB

The following NEW packages will be INSTALLED:

compas conda-forge/win-64::compas-0.5.0-py37_2
matplotlib conda-forge/win-64::matplotlib-3.0.3-py37_0
matplotlib-base conda-forge/win-64::matplotlib-base-3.0.3-py37h3e3dc42_0
numba pkgs/main/win-64::numba-0.41.0-py37hf9181ef_0

(base) C:\Windows\system32>python -m compas_rhino.install
Installing COMPAS packages to Rhino 6.0 IronPython lib:
compas OK
compas_rhino OK
compas_ghpython OK
compas_bootstrapper OK

Completed.



Afterwards I tried runnnng rhino6 again (example: https://compas-dev.github.io/main/api/generated/compas.utilities.XFunc.html#compas.utilities.XFunc)
and got the answer:

Message: Traceback (most recent call last):
File “”, line 51, in
File “C:\Users\gabri\Anaconda3\lib\importlib_init_.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 967, in _find_and_load_unlocked
File “”, line 677, in load_unlocked
File “”, line 728, in exec_module
File “”, line 219, in call_with_frames_removed
File "C:\Users\gabri\Anaconda3\lib\site-packages\compas\numerical_init
.py", line 109, in
from .linalg import *
File “C:\Users\gabri\Anaconda3\lib\site-packages\compas\numerical\linalg.py”, line 36, in
compas.raise_if_not_ironpython()
File “C:\Users\gabri\Anaconda3\lib\site-packages\compas\numerical\linalg.py”, line 11, in
from numpy import array
File "C:\Users\gabri\Anaconda3\lib\site-packages\numpy_init
.py", line 140, in
from . import _distributor_init
File “C:\Users\gabri\Anaconda3\lib\site-packages\numpy_distributor_init.py”, line 34, in
from . import _mklinit
ImportError: DLL load failed: The specified module could not be found.

Traceback:
line 410, in call, “C:\Users\gabri\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas\utilities\xfunc.py”
line 26, in , “C:\Users\gabri\Documents\master-thesis\Example_Xfunc_test.py”


also this from anaconda prompt:

(base) C:\Windows\system32>python
Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type “help”, “copyright”, “credits” or “license” for more information.

import anaconda
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘anaconda’


Is it something wrong with the Paths or do I have to reinstall anaconda packages?
Since it seems like from the log that it removed alot of packages…

Best, Gabriel

A gborg mentioned, anaconda packages were removed but when installing it again the following packages gets downgraded:

conda install anaconda=2018.12
Collecting package metadata: done
Solving environment: done

Package Plan

environment location: C:\ProgramData\Anaconda3

added / updated specs:
- anaconda=2018.12

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
imageio-2.4.1              |           py37_0         3.3 MB  conda-forge
pandas-0.23.4              |   py37h830ac7b_0         8.7 MB  conda-forge
------------------------------------------------------------
                                       Total:        12.0 MB

The following NEW packages will be INSTALLED:

anaconda pkgs/main/win-64::anaconda-2018.12-py37_0
astropy pkgs/main/win-64::astropy-3.1-py37he774522_0
bkcharts pkgs/main/win-64::bkcharts-0.2-py37_0
blaze pkgs/main/win-64::blaze-0.11.3-py37_0
bokeh pkgs/main/win-64::bokeh-1.0.2-py37_0
bottleneck pkgs/main/win-64::bottleneck-1.2.1-py37h452e1ab_1
dask pkgs/main/win-64::dask-1.0.0-py37_0
datashape pkgs/main/win-64::datashape-0.5.4-py37_1
h5py pkgs/main/win-64::h5py-2.8.0-py37h3bdd7fb_2
imageio conda-forge/win-64::imageio-2.4.1-py37_0
numexpr pkgs/main/win-64::numexpr-2.6.8-py37hdce8814_0
odo pkgs/main/win-64::odo-0.5.1-py37_0
pandas conda-forge/win-64::pandas-0.23.4-py37h830ac7b_0
patsy pkgs/main/win-64::patsy-0.5.1-py37_0
pytables pkgs/main/win-64::pytables-3.4.4-py37he6f6034_0
pytest-arraydiff pkgs/main/win-64::pytest-arraydiff-0.3-py37h39e3cac_0
pytest-astropy pkgs/main/win-64::pytest-astropy-0.5.0-py37_0
pytest-doctestplus pkgs/main/win-64::pytest-doctestplus-0.2.0-py37_0
pywavelets pkgs/main/win-64::pywavelets-1.0.1-py37h8c2d366_0
scikit-image pkgs/main/win-64::scikit-image-0.14.1-py37ha925a31_0
scikit-learn pkgs/main/win-64::scikit-learn-0.20.1-py37h343c172_0
seaborn pkgs/main/win-64::seaborn-0.9.0-py37_0
statsmodels pkgs/main/win-64::statsmodels-0.9.0-py37h452e1ab_0

The following packages will be SUPERSEDED by a higher-priority channel:

ca-certificates conda-forge::ca-certificates-2019.3.9~ --> pkgs/main::ca-certificates-2018.03.07-0
certifi conda-forge::certifi-2019.3.9-py37_0 --> pkgs/main::certifi-2018.11.29-py37_0
matplotlib conda-forge::matplotlib-3.0.3-py37_0 --> pkgs/main::matplotlib-3.0.2-py37hc8f65d3_0
openssl conda-forge::openssl-1.1.1b-hfa6e2cd_1 --> pkgs/main::openssl-1.1.1a-he774522_0

The following packages will be DOWNGRADED:

compas 0.5.0-py37_2 --> 0.5.0-py37_0
numpy 1.16.2-py37h19fb1c0_0 --> 1.15.4-py37h19fb1c0_0
numpy-base 1.16.2-py37hc3f5095_0 --> 1.15.4-py37hc3f5095_0
scipy 1.2.1-py37h29ff71c_0 --> 1.1.0-py37h29ff71c_2

Proceed ([y]/n)? y

Downloading and Extracting Packages
imageio-2.4.1 | 3.3 MB | ############################################################################ | 100%
pandas-0.23.4 | 8.7 MB | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

Best, Albin

can you try the following (it seems we updated the requirements of COMPAS after you installed it…)

conda create -n test python=3.7
conda activate test
conda install -c conda-forge COMPAS

this will create a virtual environment called test, activate it and install a fresh copy of Python 3.7 and COMPAS.
with the environment active install COMPAS for Rhino

python -m compas_rhino.uninstall -v 6.0
python -m compas_rhino.install -v 6.0

and then test your scripts again.

the versions of numpy and scipy should be 1.16 and 1.2 or higher… well and it should work :slight_smile:

(base) C:\Windows\system32>conda create -n test python=3.7
Collecting package metadata: done
Solving environment: done

Package Plan

environment location: C:\Users\gabri\Anaconda3\envs\test

added / updated specs:
- python=3.7

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
pip-19.0.3                 |           py37_0         1.8 MB  conda-forge
python-3.7.1               |    h9460c21_1003        20.2 MB  conda-forge
setuptools-40.8.0          |           py37_0         654 KB  conda-forge
vc-14                      |                0          985 B  conda-forge
vs2015_runtime-14.0.25420  |                0         1.9 MB  conda-forge
wheel-0.33.1               |           py37_0          52 KB  conda-forge
wincertstore-0.2           |        py37_1002          13 KB  conda-forge
------------------------------------------------------------
                                       Total:        24.6 MB

The following NEW packages will be INSTALLED:

certifi conda-forge/win-64::certifi-2019.3.9-py37_0
pip conda-forge/win-64::pip-19.0.3-py37_0
python conda-forge/win-64::python-3.7.1-h9460c21_1003
setuptools conda-forge/win-64::setuptools-40.8.0-py37_0
vc conda-forge/win-64::vc-14-0
vs2015_runtime conda-forge/win-64::vs2015_runtime-14.0.25420-0
wheel conda-forge/win-64::wheel-0.33.1-py37_0
wincertstore conda-forge/win-64::wincertstore-0.2-py37_1002

Proceed ([y]/n)? y

Downloading and Extracting Packages
pip-19.0.3 | 1.8 MB | ############################################################################ | 100%
setuptools-40.8.0 | 654 KB | ############################################################################ | 100%
vc-14 | 985 B | ############################################################################ | 100%
wheel-0.33.1 | 52 KB | ############################################################################ | 100%
vs2015_runtime-14.0. | 1.9 MB | ############################################################################ | 100%
python-3.7.1 | 20.2 MB | ############################################################################ | 100%
wincertstore-0.2 | 13 KB | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

To activate this environment, use

$ conda activate test

To deactivate an active environment, use

$ conda deactivate

(base) C:\Windows\system32>conda activate test

(test) C:\Windows\system32>conda install -c conda-forge COMPAS
Collecting package metadata: done
Solving environment: done

Package Plan

environment location: C:\Users\gabri\Anaconda3\envs\test

added / updated specs:
- compas

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
cycler-0.10.0              |             py_1           8 KB  conda-forge
cython-0.29.6              |   py37h6538335_0         1.9 MB  conda-forge
decorator-4.4.0            |             py_0          11 KB  conda-forge
fastcache-1.0.2            |py37hfa6e2cd_1001          30 KB  conda-forge
freetype-2.10.0            |       h5db478b_0         478 KB  conda-forge
icu-58.2                   |           vc14_0        21.8 MB  conda-forge
jpeg-9c                    |    hfa6e2cd_1001         314 KB  conda-forge
kiwisolver-1.0.1           |py37he980bc4_1002          60 KB  conda-forge
libblas-3.8.0              |            4_mkl         3.5 MB  conda-forge
libcblas-3.8.0             |            4_mkl         3.5 MB  conda-forge
liblapack-3.8.0            |            4_mkl         3.5 MB  conda-forge
libpng-1.6.36              |    h7602738_1000         1.3 MB  conda-forge
libtiff-4.0.10             |    h36446d0_1001         1.0 MB  conda-forge
llvmlite-0.24.0            |   py37h6538335_0         9.3 MB
mpmath-1.1.0               |             py_0         432 KB  conda-forge
networkx-2.2               |             py_1         1.1 MB  conda-forge
numba-0.39.0               |   py37h830ac7b_0         2.5 MB
numpy-1.16.2               |   py37h8078771_1         4.0 MB  conda-forge
olefile-0.46               |             py_0          31 KB  conda-forge
openssl-1.0.2r             |       hfa6e2cd_0         5.4 MB  conda-forge
pillow-5.4.1               |py37h9a613e6_1000         658 KB  conda-forge
pyparsing-2.3.1            |             py_0          54 KB  conda-forge
pyqt-5.6.0                 |py37h764d66f_1008         4.5 MB  conda-forge
python-dateutil-2.8.0      |             py_0         219 KB  conda-forge
qt-5.6.2                   |       h2639256_8        54.9 MB  conda-forge
sip-4.18.1                 |py37h6538335_1000         269 KB  conda-forge
six-1.12.0                 |        py37_1000          21 KB  conda-forge
sqlite-3.26.0              |    hfa6e2cd_1001         958 KB  conda-forge
sympy-1.3                  |        py37_1000         9.6 MB  conda-forge
tk-8.6.9                   |    hfa6e2cd_1000         3.9 MB  conda-forge
tornado-6.0.1              |   py37hfa6e2cd_0         638 KB  conda-forge
zlib-1.2.11                |    h2fa13f4_1004         236 KB  conda-forge
------------------------------------------------------------
                                       Total:       136.0 MB

The following NEW packages will be INSTALLED:

blas pkgs/main/win-64::blas-1.0-mkl
ca-certificates conda-forge/win-64::ca-certificates-2019.3.9-hecc5488_0
compas conda-forge/win-64::compas-0.5.0-py37_2
cycler conda-forge/noarch::cycler-0.10.0-py_1
cython conda-forge/win-64::cython-0.29.6-py37h6538335_0
decorator conda-forge/noarch::decorator-4.4.0-py_0
fastcache conda-forge/win-64::fastcache-1.0.2-py37hfa6e2cd_1001
freetype conda-forge/win-64::freetype-2.10.0-h5db478b_0
icc_rt pkgs/main/win-64::icc_rt-2019.0.0-h0cc432a_1
icu conda-forge/win-64::icu-58.2-vc14_0
intel-openmp pkgs/main/win-64::intel-openmp-2019.1-144
jpeg conda-forge/win-64::jpeg-9c-hfa6e2cd_1001
kiwisolver conda-forge/win-64::kiwisolver-1.0.1-py37he980bc4_1002
libblas conda-forge/win-64::libblas-3.8.0-4_mkl
libcblas conda-forge/win-64::libcblas-3.8.0-4_mkl
liblapack conda-forge/win-64::liblapack-3.8.0-4_mkl
libpng conda-forge/win-64::libpng-1.6.36-h7602738_1000
libtiff conda-forge/win-64::libtiff-4.0.10-h36446d0_1001
llvmlite pkgs/main/win-64::llvmlite-0.24.0-py37h6538335_0
matplotlib conda-forge/win-64::matplotlib-3.0.3-py37_0
matplotlib-base conda-forge/win-64::matplotlib-base-3.0.3-py37h3e3dc42_0
mkl pkgs/main/win-64::mkl-2019.1-144
mpmath conda-forge/noarch::mpmath-1.1.0-py_0
networkx conda-forge/noarch::networkx-2.2-py_1
numba pkgs/main/win-64::numba-0.39.0-py37h830ac7b_0
numpy conda-forge/win-64::numpy-1.16.2-py37h8078771_1
olefile conda-forge/noarch::olefile-0.46-py_0
openssl conda-forge/win-64::openssl-1.0.2r-hfa6e2cd_0
pillow conda-forge/win-64::pillow-5.4.1-py37h9a613e6_1000
planarity conda-forge/win-64::planarity-3.0.0.5-hfa6e2cd_1002
pyparsing conda-forge/noarch::pyparsing-2.3.1-py_0
pyqt conda-forge/win-64::pyqt-5.6.0-py37h764d66f_1008
python-dateutil conda-forge/noarch::python-dateutil-2.8.0-py_0
python-planarity conda-forge/win-64::python-planarity-0.4.1-py37hfa6e2cd_2
qt conda-forge/win-64::qt-5.6.2-h2639256_8
scipy pkgs/main/win-64::scipy-1.2.1-py37h29ff71c_0
sip conda-forge/win-64::sip-4.18.1-py37h6538335_1000
six conda-forge/win-64::six-1.12.0-py37_1000
sqlite conda-forge/win-64::sqlite-3.26.0-hfa6e2cd_1001
sympy conda-forge/win-64::sympy-1.3-py37_1000
tk conda-forge/win-64::tk-8.6.9-hfa6e2cd_1000
tornado conda-forge/win-64::tornado-6.0.1-py37hfa6e2cd_0
zlib conda-forge/win-64::zlib-1.2.11-h2fa13f4_1004

Proceed ([y]/n)? y

Downloading and Extracting Packages



Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(test) C:\Windows\system32>python -m compas_rhino.uninstall -v 6.0
Uninstalling COMPAS packages from Rhino 6.0 IronPython lib:
Packages installed from environment: base
compas OK
compas_rhino OK
compas_ghpython OK
compas_bootstrapper OK

Completed.

(test) C:\Windows\system32>python -m compas_rhino.install -v 6.0
Installing COMPAS packages to Rhino 6.0 IronPython lib:
compas OK
compas_rhino OK
compas_ghpython OK
compas_bootstrapper OK

Completed.



We tried to run the following recommendations you gave above, but with still get this error regarding numpy:


RHINO-response

Message: Traceback (most recent call last):
File “C:\Users\gabri\Anaconda3\envs\test\lib\site-packages\numpy\core_init_.py”, line 40, in
from . import multiarray
File “C:\Users\gabri\Anaconda3\envs\test\lib\site-packages\numpy\core\multiarray.py”, line 12, in
from . import overrides
File “C:\Users\gabri\Anaconda3\envs\test\lib\site-packages\numpy\core\overrides.py”, line 6, 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 “”, line 51, in
File “C:\Users\gabri\Anaconda3\envs\test\lib\importlib_init_.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 967, in find_and_load_unlocked
File “”, line 677, in load_unlocked
File “”, line 728, in exec_module
File “”, line 219, in call_with_frames_removed
File "C:\Users\gabri\Anaconda3\envs\test\lib\site-packages\compas\numerical_init
.py", line 109, in
from .linalg import *
File “C:\Users\gabri\Anaconda3\envs\test\lib\site-packages\compas\numerical\linalg.py”, line 36, in
compas.raise_if_not_ironpython()
File “C:\Users\gabri\Anaconda3\envs\test\lib\site-packages\compas\numerical\linalg.py”, line 11, in
from numpy import array
File "C:\Users\gabri\Anaconda3\envs\test\lib\site-packages\numpy_init
.py", line 142, in
from . import core
File "C:\Users\gabri\Anaconda3\envs\test\lib\site-packages\numpy\core_init
.py", line 71, in
raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:

  • If you’re working with a numpy git repository, try git clean -xdf
    (removes all files not under version control) and rebuild numpy.
  • If you are simply trying to use the numpy version that you have installed:
    your installation is broken - please reinstall numpy.
  • If you have already reinstalled and that did not fix the problem, then:
    1. Check that you are using the Python you expect (you’re using C:\Users\gabri\Anaconda3\envs\test\pythonw.exe),
      and that you have no directories in your PATH or PYTHONPATH that can
      interfere with the Python and numpy versions you’re trying to use.

    2. If (1) looks fine, you can open a new issue at
      https://github.com/numpy/numpy/issues. Please include details on:

      • how you installed Python
      • how you installed numpy
      • your operating system
      • whether or not you have multiple versions of Python installed
      • if you built from source, your compiler versions and ideally a build log

      Note: this error has many possible causes, so please don’t comment on
      an existing issue about this - open a new one instead.

Original error was: DLL load failed: The specified module could not be found.

Traceback:
line 410, in call, “C:\Users\gabri\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas\utilities\xfunc.py”
line 26, in , “C:\Users\gabri\Documents\master-thesis\Example_Xfunc_test.py”


We dont really understand what the underlying problem seems to be anymore…

Best, Gab

unfortunately it is a known problem with recent combinations of conda and numpy-scipy. we thought we had solved it with the release of last friday, but apparently that is not the case.

will get back to you when we have a solution…

Okey! Thank you for your time anyway!

hi guys,

could you please try the latest version of COMPAS (0.5.1) and see if that fixes your problems?

thanks,
tom

1 Like

Hi @tomvanmele,

I seem to get the exact copy of this error. I’ve tried your suggestions here for fixing it, but it doesn’t seem to solve anything. As far as I can see, numPy and SciPy are correctly installed (as I can open them outside GH) and I get the same error with both XFunc and Proxy.

Anything you know that I can try?

Would be of great help!

Thanks,
Rick

hi,

could you provide some more information?

  • name of the conda environment in which you installed compas
  • version of compas installed
  • script that you use in GH to call numpy stuff through RPC

could you also try the following on the command line and report back?

  • activate environment in which compas is installed
  • launch python interpreter
  • import compas
  • print version

finally, can you import compas in Rhino/GH?

thanks,
tom

Dear Tom, thanks for reacting.

I installed everything using miniconda, and installed compas in the base environment. (Compas version = 0.11.4), both Numpy and Scipy’s versions can be retrieved.

Within GH I used both Proxy and XFunc to try and get it to work:

from compas.rpc import Proxy

with Proxy(‘compas.numerical’) as numerical:
…topology = numerical.topop()
pass

or with XFunc:

from compas.utilities import XFunc

topop = XFunc(‘compas.numerical.topop_numpy’)
topology = topop()

Both give identical errors, therefore I expect numpy and/or scipy being installed wrongly.
(e.g. compas.numerical.dr works fine!)

print version does not work in my terminal (but compas.__version __) gives 0.11.4

Thank you for taking time!

Rick

hi,

could you post the error?
can you run the topop algorithm from an editor such as VS Code?

it might also be worth updating COMPAS. we have fixed many small bugs in recent releases…
also, just as general feedback, it is a bad idea to install COMPAS (or anything else for that matter) directly into the base environment. even if you plan to have only one working environment, it is still better to create a separate environment for it…

tom

Hi Tom,

The error (by Grasshopper)

Runtime error (Exception): Traceback (most recent call last):
File “C:\Users\Rick\Miniconda3\envs\test\lib\site-packages\compas\rpc\dispatcher.py”, line 94, in dispatch
module = importlib.import_module(modulename)
File "C:\Users\Rick\Miniconda3\envs\test\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1006, in _gcd_import
File “”, line 983, in find_and_load
File “”, line 967, in find_and_load_unlocked
File “”, line 677, in load_unlocked
File “”, line 728, in exec_module
File “”, line 219, in call_with_frames_removed
File "C:\Users\Rick\Miniconda3\envs\test\lib\site-packages\compas\numerical_init
.py", line 110, in
from .linalg import *
File “C:\Users\Rick\Miniconda3\envs\test\lib\site-packages\compas\numerical\linalg.py”, line 30, in
from scipy.sparse.linalg import factorized
File "C:\Users\Rick\Miniconda3\envs\test\lib\site-packages\scipy\sparse\linalg_init
.py", line 116, in
from .eigen import *
File "C:\Users\Rick\Miniconda3\envs\test\lib\site-packages\scipy\sparse\linalg\eigen_init
.py", line 11, in
from .arpack import *
File "C:\Users\Rick\Miniconda3\envs\test\lib\site-packages\scipy\sparse\linalg\eigen\arpack_init
.py", line 22, in
from .arpack import *
File “C:\Users\Rick\Miniconda3\envs\test\lib\site-packages\scipy\sparse\linalg\eigen\arpack\arpack.py”, line 45, in
from . import _arpack
ImportError: DLL load failed: The specified procedure could not be found.

Traceback:
line 333, in proxy, “C:\Users\Rick\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas\rpc\proxy.py”
line 16, in script

VSCode gives an somewhat identical error, at least that NumPy and SciPy can’t be found.

But,
f3d31821b82307b1a6df46d0b89753c2

I’ll first try reinstalling Compas/NumPy and SciPy in another environment :slight_smile: Thanks for that tip.

Rick