Problem with virtualenv in Mac OS X(Mac OS X 中的 virtualenv 问题)
问题描述
我已经通过 pip 安装了 virtualenv 并在创建新环境后出现此错误:
I've installed virtualenv via pip and get this error after creating a new environment:
selenium:~ auser$ virtualenv new
New python executable in new/bin/python
ERROR: The executable new/bin/python is not functioning
ERROR: It thinks sys.prefix is u'/System/Library/Frameworks/Python.framework/ Versions/2.6' (should be '/Users/user/new')
ERROR: virtualenv is not compatible with this system or executable
在我的环境中:
PYTHONPATH=/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
PATH=/System/Library/Frameworks/Python.framework/Versions/2.6/bin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
我该如何修复这个问题?
How can I repair this?
谢谢.
推荐答案
如果您仍然遇到 virtualenv 问题,您可以尝试 pythonbrew,而不是.这是同一问题的替代解决方案.它的工作方式更像 Ruby 的 rvm:它在 $HOME/下构建并创建一个完整的 Python 实例.pythonbrew,然后设置一些 bash 函数,让您可以轻松地在版本之间切换.virtualenv 隐藏 Python 的系统版本,使用符号链接作为其解决方案的一部分,pythonbrew 构建完全独立的 Python 安装.
If you continue to have trouble with virtualenv, you might try pythonbrew, instead. It's an alternate solution to the same problem. It works more like Ruby's rvm: It builds and creates an entire instance of Python, under $HOME/.pythonbrew, and then sets up some bash functions that allow you to switch easily between versions. Where virtualenv shadows the system version of Python, using symbolic links as part of its solution, pythonbrew builds entirely self-contained installations of Python.
我多年来一直使用 virtualenv.这是一个不错的解决方案,但我最近改用 pythonbrew.拥有完全自包含的 Python 实例意味着安装新实例需要一段时间(因为 pythonbrew 实际上是从头开始编译 Python),但每个安装的自包含性质对我很有吸引力.而且磁盘很便宜.
I used virtualenv for years. It's a decent solution, but I've switched to pythonbrew lately. Having completely self-contained Python instances means that installing a new one takes awhile (since pythonbrew actually compiles Python from scratch), but the self-contained nature of each installation appeals to me. And disk is cheap.
这篇关于Mac OS X 中的 virtualenv 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Mac OS X 中的 virtualenv 问题
- 使用Heroku上托管的Selenium登录Instagram时,找不到元素';用户名'; 2022-01-01
- 如何在 Python 的元组列表中对每个元组中的第一个值求和? 2022-01-01
- python check_output 失败,退出状态为 1,但 Popen 适用于相同的命令 2022-01-01
- pytorch 中的自适应池是如何工作的? 2022-07-12
- 分析异常:路径不存在:dbfs:/databricks/python/lib/python3.7/site-packages/sampleFolder/data; 2022-01-01
- 如何将一个类的函数分成多个文件? 2022-01-01
- 如何在 python3 中将 OrderedDict 转换为常规字典 2022-01-01
- 沿轴计算直方图 2022-01-01
- python-m http.server 443--使用SSL? 2022-01-01
- padding='same' 转换为 PyTorch padding=# 2022-01-01
