在 MacOS 上的 virtualenv 中使用特定的 Python 版本
我的MacOS上安装了三个Python版本:Python 2.7.18,Python 3.9.0和Python 3.10。
Python 2.7.18和Python 3.9.0被添加到路径中,这可以在下面的屏幕截图中看到。
对我来说还可以。我现在想将Python 3.10添加到路径上。但是,我想在虚拟的内部使用它。
Python 3.10以下目录/usr/usr/local/opt/受保护]
。
我的项目位于这里/users/david/david/documents/project
。
我尝试使用以下命令(在我的项目目录内):sudo virtualenv venv -python .usr/local/opt/ [email  preconted]
。不幸的是,它与以下错误RuntimeError:无法找到bython_spec ='。 =“ __ cf_email__” data-cfemail =“ 0D74796562634D3E233C3D”> [email  procearted] '
。
如何创建我的Virtualenv?
I have three Python version installed on my MacOs: Python 2.7.18, Python 3.9.0 and Python 3.10.
Python 2.7.18 and Python 3.9.0 are added into the Path which can be seen in the screenshot below.
That is OK for me. I do now want to add Python 3.10 to path. However I would like to use it inside my virtualenv.
Python 3.10 is installed under the following directory /usr/local/opt/[email protected]
.
My project is located here /Users/David/Documents/Project
.
I tried to use the following command (inside my project's directory): sudo virtualenv venv --python .usr/local/opt/[email protected]
. Unfortunately it didn't work with the following error RuntimeError: failed to find interpreter for Builtin discover of python_spec='.usr/local/opt/[email protected]'
.
How can I create my virtualenv?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来像是
[email protected]
的路径有错误 - 前面有.
指示当前目录,请尝试/usr/local/opt/[电子邮件受保护].
Looks like your path to
[email protected]
has an error - it has.
at the front indicating the current directory, try/usr/local/opt/[email protected]
.