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 ...
随机推荐
- 阿里云物联网 .NET Core 客户端 | CZGL.AliIoTClient:4. 设备上报属性
文档目录: 说明 1. 连接阿里云物联网 2. IoT 客户端 3. 订阅Topic与响应Topic 4. 设备上报属性 4.1 上报位置信息 5. 设置设备属性 6. 设备事件上报 7. 服务调用 ...
- Luogu P4892 GodFly的寻宝之旅【状压dp】By cellur925
题目传送门 又是一道状压+计数类好题hh(真香).数据范围非常友好,告诉我们\(n<=18\),非常符合状压的性质. 其实感觉和\(Hamilton\)路径那题还是有些相似的,我们可以类似地设计 ...
- TensorFlow数据集(一)——数据集的基本使用方法
参考书 <TensorFlow:实战Google深度学习框架>(第2版) 例子:从一个张量创建一个数据集,遍历这个数据集,并对每个输入输出y = x^2 的值. #!/usr/bin/en ...
- idea下载
- JS中一个new到底做了哪些事情?
1.https://www.cnblogs.com/faith3/p/6209741.html 2.https://www.cnblogs.com/AaronNotes/p/6529492.html
- Java | 基础归纳 | JPA
https://www.javacodegeeks.com/2015/04/jpa%E5%85%A5%E9%97%A8%E6%95%99%E7%A8%8B.html JPA 全称====>Jav ...
- 基于http的软件仓库
这是企业中常用的方法 比如一台服务器准备好了,公司必然要安装一些应用 这时可以用这种方法批量安装应用 运行一条命令,服务器就会自己去连接软件仓库,去下载来安装. [root@webmaster htm ...
- Java中 Collection 、 List 、 Set 、 Map详解
一.容器( Collection ) 接口 容器( Collection )是最基本的集合接口,一个容器( Collection )保存一组对象( Object ),即对象是容器的元素( Ele ...
- Bridges Gym - 100712H 无向图的边双连通分量,Tarjan缩点
http://codeforces.com/gym/100712/attachments 题意是给定一个无向图,要求添加一条边,使得最后剩下的桥的数量最小. 注意到在环中加边是无意义的. 那么先把环都 ...
- 报错:Error: ENOENT, no such file or directory 'c:\Users\Administrator\WebstormProjects\blogtest\views\footer.ejs'
这是我在index上引用<%- include footer %>,找不到该文件 所以报错 建立文件footer.ejs