I’m very new to Python, only used a few commands before. I’m using CumulusCI for building an application on the Salesforce platform, and I’m running into the following errors every time I use a cci (Cumulus) command. I uninstalled & installed again Cumulus and Python, and several other dependencies to see if that will fix the issue, but I hit the wall now. I understand these errors are very specific to my environment, and there are hints in them, but if anyone could help me understand and navigate what I need to do now, that would be great! I’m on MacOS Monterey v 12.5.1.
Traceback (most recent call last):
File "/Users/username/.local/bin/cci", line 5, in <module>
from cumulusci.cli.cci import main
File "/Users/username/.local/pipx/venvs/cumulusci/lib/python3.10/site-packages/cumulusci/cli/cci.py", line 17, in <module>
from cumulusci.utils import get_cci_upgrade_command
File "/Users/username/.local/pipx/venvs/cumulusci/lib/python3.10/site-packages/cumulusci/utils/__init__.py", line 17, in <module>
from .xml import ( # noqa
File "/Users/username/.local/pipx/venvs/cumulusci/lib/python3.10/site-packages/cumulusci/utils/xml/__init__.py", line 5, in <module>
from lxml import etree as lxml_etree
ImportError: dlopen(/Users/username/.local/pipx/venvs/cumulusci/lib/python3.10/site-packages/lxml/etree.cpython-310-darwin.so, 0x0002): tried: '/Users/usernamel/.local/pipx/venvs/cumulusci/lib/python3.10/site-packages/lxml/etree.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
The error indicates that you are on a system with Apple Silicon (M1/M2) using a Python that natively supports this CPU, and that the lxml extension only supports the Intel architecture.
You could try using arch -x86_64 cci to start the script, that should run it in Intel mode assuming that your Python installation supports this.
A proper fix is to reinstall the lxml package into the virtual environment used by pipx.
Ronald, I used pipx to uninstall & install lxml with the following result:
$ pipx uninstall lxml
Nothing to uninstall for lxml 😴
$ pipx install lxml
No apps associated with package lxml or its dependencies. If you are attempting to install a library, pipx should not be used. Consider using pip or a similar tool instead.
Then I re-installed lxml with pip with successful output, but when I run cci, initial errors remain.
Starting script with arch -x86_64 cci also, unfortunately, didn’t work for me, example:
arch -x86_64 cci version
arch: posix_spawnp: cci: Bad CPU type in executable
My teammate helped me resolve the issue. We found out that for some reason I had homebrew installed twice, on both x86_64 and arm64e - most likely because I had a check for “Open using Rosetta” checked in my terminal, so I had to install homebrew before, and after checking the checkbox. Running it in both environments caused the mismatch and the errors above. We needed to re-install all my dependencies, eventually resolving the issue.
@paulini Could you please help me with step by step process you did to eliminate this error. I am with this error from some days now, trying to figure out a solution.