i still don’t really understand but here goes
pip -m compas_rhino.install
cannot ever have worked because COMPAS has nothing to do with pip
. the only correct command for installing COMPAS in Rhino is python -m compas_rhino.install
and all of its variations as described in the docs.
with python -m compas_rhino.install -p xxx
you can install all sorts of packages in Rhino (not just COMPAS packages), BUT ONLY IF THOSE PACKAGES ARE COMPATIBLE WITH IRONPYTHON
to install COMPAS packages from a specific environment in Rhino, just activate the environment and run the above-mentioned install command. for example, if you have an environment called “salmo” and in it you have installed COMPAS, but also, for example, compas_cgal
, compas_fab
, and shapely
.
the first step would be to activate the environment
conda activate salmo
then uninstall any previously installed packages just to make sure there is no confusion
python -m compas_rhino.uninstall
then install all the default packages (compas
, compas_rhino
, compas_ghpython
)
python -m compas_rhino.install
finally install all the additional packages you want to be able to use
python -m compas_rhino.install -p compas_fab
note that i did not include compas_cgal
or shapely
because they are wrappers around C/C++
libs so you cannot use them directly in Rhino. however, they are available through compas.rpc
and since you installed COMPAS for Rhino from an environment that contained these two packages, compas.rpc
should not have a problem finding them.
when you restart Rhino, the version of compas
, compas_rhino
, compas_ghpython
, and compas_fab
installed in the “salmo” environment should now be available.
finally, for future reference…
- i assume with “IPython” you mean “IronPython”. however, “IPython” is usually used to refer to Interactive Python, which is a special type of interactive session launched in the terminal.
- make sure to run the above commands from the Anaconda Prompt. if you run them from an IronPython terminal instead, COMPAS might get confused and think that you are actually working inside Rhino, which will make all sorts of conditional imports fail.
- if you have the RhinoPython code listener plugin installed and you run the install commands from the terminal inside VS Code, perhaps this can also confuse COMPAS into thinking that the current environment is actually inside Rhino.