如何在Mac系统中安装virtualwrapper

发布时间:2021-03-03 17:00:48 作者:Leah
来源:亿速云 阅读:227

这期内容当中小编将会给大家带来有关如何在Mac系统中安装virtualwrapper,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。

1. 安装virtualwrapper

打开终端,输入如下的命令

pip3 install virtualenv
pip3 install virtualenvwrapper

2. 在配置文件~/.bash_profile中添加代码

# Settings for virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh

3. 让配置生效:

source ~/.bash_profile

这时,出现了如下问题:

/usr/bin/python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.

If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.

原因分析

从报错信息中 VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is set properly. 这一句话来看,是环境指向了python2的路径,所以我们只需要将这个环境变量修改为python3的路径即可。

解决办法

打开配置文件 vim ~/.bash_profile 在配置文件中添加一行代码:

export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3

让配置生效:

source ~/.bash_profile

上述就是小编为大家分享的如何在Mac系统中安装virtualwrapper了,如果刚好有类似的疑惑,不妨参照上述分析进行理解。如果想知道更多相关知识,欢迎关注亿速云行业资讯频道。

推荐阅读:
  1. mac系统中如何安装配置mysql 8.0.11
  2. 如何在Mac系统中安装nodejs、npm和cnpm

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

mac virtualwrapper

上一篇:PHP 图片处理的方法

下一篇:怎么在Linux系统中对Python 2.7进行升级

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》