virtualenvwrapper.sh报错: There was a problem running the initialization hooks.解决
由于在ubuntu环境下,将python做与python3.6做了软链接(ln -s python python3.6),并且pip也被我做了软链接,所以导致用pip安装virtualenvwrapper之后,在source启动virtualenvwrapper.sh时以及workon 虚拟环境时总是报错:
./virtualenvwrapper.sh: line : : command not found
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= and that PATH is
set properly.
这是根据提示230行的语句:
"$VIRTUALENVWRAPPER_PYTHON" -m 'virtualenvwrapper.hook_loader' \
结合错误信息与提示找到的语句,猜测应该是VIRTUALENVWRAPPER_PYTHON这里有问题,然后在virtualenvwrapper.sh文件中查找VIRTUALENVWRAPPER_PYTHON,发现了关键点:
# Locate the global Python where virtualenvwrapper is installed.
if [ "${VIRTUALENVWRAPPER_PYTHON:-}" = "" ]
then
VIRTUALENVWRAPPER_PYTHON="$(command \which python3)" # 原本是写的\which python,这里贴出来的是我修改为python3后的。
fi
VIRTUALENVWRAPPER_PYTHON是用来(Locate the global Python where virtualenvwrapper is installed.)定位哪个python下面安装了virtualenvwrapper的。原本指定的位置是python,也就是2.7版本的。鉴于之前我使用python3.6安装的,所以此处要改成python3。然后这个错误就消失了。
使用virtualenvwrapper的好处是不用每次使用source /xxx/虚拟环境/bin/activate来启动虚拟环境了,在~/.bashrc配置一下,日后开启虚拟环境直接可以用workon命令即可,具体操作步骤,前提是你已经安装了python-virtualenv了:
# Setup:
# . Create a directory to hold the virtual environments.
# (mkdir $HOME/.virtualenvs).
# . Add a line like "export WORKON_HOME=$HOME/.virtualenvs"
# to your .bashrc.
# . Add a line like "source /path/to/this/file/virtualenvwrapper.sh"
# to your .bashrc.
# . Run: source ~/.bashrc
# . Run: workon
# . A list of environments, empty, is printed.
# . Run: mkvirtualenv temp
# . Run: workon
# . This time, the "temp" environment is included.
# . Run: workon temp
# . The virtual environment is activated.
virtualenvwrapper.sh报错: There was a problem running the initialization hooks.解决的更多相关文章
- source .bashrc 报错:virtualenvwrapper.sh: There was a problem running the initialization hooks.
在Ubuntu下安装完virtualenv.virtualenvwrapper,然后设置环境文件 .bashrc 接着 source .bashrc,产生错误信息 首先确认了 libpam-mount ...
- virtualenvwrapper.sh: There was a problem running the initialization hooks. If Python could not import the module virtualenvwrapper.hook_loader, check that virtualenvwrapper.........(解决办法)
Linux(ubuntu)上python2与python3共存环境下,安装virtualenvwrapper后, 其环境变量被自动设置为VIRTUALENVWRAPPER_PYTHON=/usr/bi ...
- 11.2.0.4 aix下运行第二个节点root.sh报错处理
第二个节点运行root.sh报错如下 Entries will be added to the /etc/oratab file as needed by Database Configuration ...
- Sphinx/Coreseek 4.1 执行 buildconf.sh 报错,无法生成configure文件
参考的网址: http://blog.csdn.net/jcjc918/article/details/39032689 错误现象: 执行 buildconf.sh 报错,无法生成configure文 ...
- windows中修改catalina.sh上传到linux执行报错This file is needed to run this program解决
windows中修改catalina.sh上传到linux执行报错This file is needed to run this program解决 一.发现问题 由于tomcat内存溢出,在wind ...
- win10 安装nodejs,报错there is a problem in the windows installer package
今天重装了win10系统,开始安装各种软件,装到node的时候我崩溃了,报错there is a problem in the windows installer package··· 度娘了各种安装 ...
- centos 7安装rac 11gR2时运行root.sh报错找不到ohas服务(ohasd failed to start)
单独在linux 7中为ohasd设置一个服务.步骤如下1. 创建服务ohas.service的服务文件并赋予权限touch /usr/lib/systemd/system/ohas.servicec ...
- Linux安装Redis 6.0.5 ./install_server.sh报错
Linux安装Redis 6.0.5 ./install_server.sh报错 linux 安装Redis6.0.5时 进行到./install_server.sh时报错, This systems ...
- 使用git克隆仓库到本地报错:SSL certificate problem: unable to get local issuer certificate
第一次使用Git工具克隆仓库,使用的是HTTPS链接,失败了.发现是因为通过HTTPS访问时,如果服务器上的SSL证书未经过第三方机构认证,Git就会报错. 解决方法:通过命令关闭验证 git con ...
随机推荐
- suse 11 sp4 设置yast 安装源
suse yast 软件管理工具,用户在初始安装系统时,可能会遗漏比较多的库和工具,那么为了方便大家日后可以随时添加,用户可以选择将安装ISO 文件添加到 suse 的yast 安装源上. 用户首先创 ...
- Eclipse mybatis中XML的自动提示
1. 从mybatis-3.1.1.jar中解压出dtd文件 2. 3. 复制红线处内容 4. 将上步中内容粘贴到key中
- typescript学习笔记(一)----基础类型
1.使用typescript前第一个操作就是全局配置typescript环境 ---------------npm install -g typescript 2.typescript(以下称为ts, ...
- PostgreSQL-9-别名与动态表复制
1.列别名 SELECT column_name AS alias_name FROM table_name conditions... ; alias_name: 它指定分配给列的临时名称 SEL ...
- crontab 在unix 没有执行。
Quote: 引用 2 楼 jdwq33 的回复: Quote: 引用 1 楼 mp777323 的回复: 03 * * * * sh /opt/pro_some.sh 我试过了,这样也不行,难道是我 ...
- java 并发容器一之BoundedConcurrentHashMap(基于JDK1.8)
最近开始学习java并发容器,以补充自己在并发方面的知识,从源码上进行.如有不正确之处,还请各位大神批评指正. 前言: 本人个人理解,看一个类的源码要先从构造器入手,然后再看方法.下面看Bounded ...
- nagios的安装配置
主要参考博客:http://www.cnblogs.com/mchina/archive/2013/02/20/2883404.html 实验环境:centos6.4 最小化安装系统 **** ...
- 基于phpExcel写的excel类(导出为Excel)
<?php /* * 类的功能 * 传入二位数组导出excel * 传入excel 导出二位数组 * @author mrwu */ require('PHPExcel.php'); requi ...
- IOS之UIAlertController
你知道 UIAlertView.UIActionSheet (以及它们各自的 delegate protocols) 在 iOS 8 中已经被废弃了吗? 这是真的.在你的代码中按住 ⌘ 点击 UIAl ...
- jmeter中通过命令方式生成结果文件
通过命令的方式将jmeter生成的jtl结果文件生成html文件,以便更直观的分析结果数据,以下命令可以放在1个bat文件中取执行. bat文件可以放到jmeter的根目录下. 步骤1: 通过命令方式 ...