I am trying to install python packages to a venv using poetry - on BigSur macos.
I have pyenv on stable python.
pyenv which python
/Users/josh/.pyenv/versions/3.8.6/bin/python
When I exec.
poetry shell && poetry install
I get this error but do not know what to do with it.
  AttributeError
  module 'virtualenv.create.via_global_ref.builtin.cpython.mac_os' has no attribute 
'CPython2macOsArmFramework'
  at ~/.pyenv/versions/3.8.2/lib/python3.8/importlib/metadata.py:79 in load
       75│         """
       76│         match = self.pattern.match(self.value)
       77│         module = import_module(match.group('module'))
       78│         attrs = filter(None, (match.group('attr') or '').split('.'))
       79│         return functools.reduce(getattr, attrs, module)
       80│ 
       81│     @property
       82│     def extras(self):
       83│         match = self.pattern.match(self.value)
Any ideas of what to troubleshoot welcome!
I got this error today. I'm on Ubuntu, python 3.8.10 (pyenv managed). So seeing an error with mac_os in the message felt weird. On further debugging, found that the reason behind the issue was that some other package had installed virtualenv as a dependency in my local venv. We need to get rid of it.
And the culprit package was pre-commit. Uninstalled it from local venv for now. Installing rest of the packages works without any error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With