模块' virtualenv.create.via_global_ref.builtin.cpython.mac_os'没有属性' cpython2macosarmframework
我正在尝试将Python软件包安装到venv
使用诗歌
- 在Bigsur Macos上。
我在稳定的python上有pyenv
。
pyenv which python
/Users/josh/.pyenv/versions/3.8.6/bin/python
当我执行时。
诗歌外壳&&诗歌安装
我会收到此错误,但不知道该怎么办。
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)
任何要对什么进行故障排除的想法!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
当我遇到问题时,已经很晚了,然后我就放弃了,直到几天后才回到它。
就我而言,我认为发生的是我相信我试图从非管理员终端升级
virtualenv
。问题在于,本来应该失败的部分成功,使我的系统处于无效状态。我认为发生的事情与多年来在各种情况和各种操作系统的不同版本和PIP的不同版本和发行版有关。只是尝试重新安装
Virtualenv
不起作用。我不得不将其卸载两次。然后安装新鲜。观察它被卸载的位置。您自己的系统可能需要删除更多实例。
It was late when I hit the problem, and I gave up afterward, only coming back to it a few days later.
What I think happened, in my case, is that I believe I attempted to upgrade
virtualenv
from a non-administrator terminal. The problem is that what should have failed had partially succeeded, leaving my system in an invalid state. I think what happened has to do with where different versions and releases of Python and Pip have been putting site-packages in various cases and various operating systems over the years.Simply attempting to re-install
virtualenv
did not work. I had to uninstall it twice. Then install it fresh.Watch where it is being uninstalled from. Your own system may need even more instances removed.
在我的情况下,诗歌也缺少python的可执行文件(
诗歌env Info
)。重新安装Virtualenv,添加新的Python版本,并将Pyenv和诗歌联系起来。我的步骤:
In my case poetry was also missing the python executable (
poetry env info
).Reinstalling virtualenv, adding a new python version, and linking pyenv and poetry worked fine. My steps:
在将Python从3.9.5升级到3.9.12之后,我遇到了这个问题
,我通过从已弃用的在线安装程序切换到通过
pip
进行安装来解决
:
I faced this issue after upgrading python from 3.9.5 to 3.9.12
I resolved it by switching from the online installer, which is deprecated, to installing through
pip
Before:
After:
我今天有这个错误。我在Ubuntu,Python 3.8.10(Pyenv Manded)。因此,在消息中看到
mac_os
的错误感到很奇怪。在进一步的调试中,发现问题背后的原因是其他一些软件包已经安装了virtualenv
作为我本地VENV中的依赖性。我们需要摆脱它。罪魁祸首是
pre-commit
。目前,从当地的VENV卸载了它。安装其余的软件包工作没有任何错误。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 installedvirtualenv
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.我能够通过更新Virtualenv版本来解决这个问题。在这篇文章时,即20.24.5。我希望它也适用于其他任何问题
I was able to get around this issue by updating the version of virtualenv. At the time of this post, that was 20.24.5. I hope it works for anyone else having this issue as well