Error when importing compas_ghpython and installing compas for Rhino

Hi everyone,

I’m getting started with compas here, but I haven’t been able to make it past the installation instructions thus far. I’m using conda to install the package, and that runs without hurdles. However, when I try to import the compas_ghpython module to verify that the installation was successful, I encounter the following error message:

>>> import compas_ghpython
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\danhaive\AppData\Local\Continuum\Anaconda3\envs\compas_env2\lib\site-packages\compas_ghpython\__init__.py", line 17, in <module>
from .utilities import *
  File "C:\Users\danhaive\AppData\Local\Continuum\Anaconda3\envs\compas_env2\lib\site-packages\compas_ghpython\utilities\__init__.py", line 57, in <module>
from .drawing import *
  File "C:\Users\danhaive\AppData\Local\Continuum\Anaconda3\envs\compas_env2\lib\site-packages\compas_ghpython\utilities\drawing.py", line 37, in <module>
compas.raise_if_ironpython()
**AttributeError: 'module' object has no attribute 'raise_if_ironpython'**

Given import compas_rhino yielded no error, I ran the rhino installation command, but that also returned an error:

(compas_env2) C:\>python -m compas_rhino.install   
C:\Users\danhaive\AppData\Local\Continuum\Anaconda3\envs\compas_env2\python.exe: **No module named compas_rhino.install**

I looked around the site-packages of my environment, and everything seems to be there, so I’m a little puzzled as to why this isn’t working.
Has anyone encountered these issues before?

Thanks!

Note that I tried on my laptop, and I was able to install compas successfully. To the best of my knowledge, I did not proceed differently on my desktop.

just to help tracing the source of the problem, could you do the following and report back:

  • run Anaconda Prompt as administrator
  • activate whatever environment you installed COMPAS in (judging from your posts compas_env2 ?!)
  • start an interactive Python session
  • import compas
  • import compas_rhino
  • import compas_ghpython

in any case, based on the error messages, it seems your problem might be related to the location where Anaconda is installed, which is non-standard (...\AppData\Local\Continuum\...) and seems to indicate that you don’t have admin rights to your computer.

we highly recommend to not register Anaconda on PATH, to use Anaconda Prompt (“as administrator”) rather than Command Prompt, and to install Anaconda in the standard location: %USERPROFILE%\Anaconda3

keep us posted!