如何解决无法在bash配置文件中正确设置virtualenvwrapper
我已经使用pip在centos 7中安装了Virtualenvwrapper,但是我无法正确设置bash_profile。当我获取bash_profile时,它会中断。我能够运行mkvirtualenv或workon之类的命令。
我引用了其他类似的questions,说是要导出相关的python解释器。
export const checkMaximumChildren = (hierarchy,maximum) => {
let hasMoreThanMaximumChildren = false;
if (hierarchy.children.length > maximum) {
hasMoreThanMaximumChildren = true;
} else {
const dmaExtractor = (children) => {
children.forEach((child) => {
if (child.children.length > maximum) {
hasMoreThanMaximumChildren = true;
return hasMoreThanMaximumChildren;
}
if (
child &&
child.children &&
Array.isArray(child.children) &&
child.children.length > 0
) {
dmaExtractor(data.children);
}
});
};
if (
hierarchy &&
hierarchy.children &&
Array.isArray(hierarchy.children) &&
data.children.length > 0
) {
dmaExtractor(hierarchy.children);
}
}
return hasMoreThanMaximumChildren;
};
const data = [{
"id": 1,"parentId": null,"selected": false,"children": [{
"id": 2,"parentId": 1,"children": [{
"id": 3,"parentId": 2,"children": [{
"id": 4,"parentId": 3,"children": []
}]
}]
}]
},{
"id": 1,"selected": true,"children": []
},"children": []
}]
输出
source ~/.bash_profile
我的bash_profile conf
bash: tty: command not found...
Similar command is: 'tty'
/usr/libexec/grepconf.sh: line 5: grep: command not found
bash: grep: command not found...
bash: egrep: command not found...
Similar command is: 'grep'
bash: mkdir: command not found...
bash: mktemp: command not found...
bash: touch: command not found...
ERROR: virtualenvwrapper could not create a temporary file name.
bash: grep: command not found...
bash: egrep: command not found...
Similar command is: 'grep'
bash: mkdir: command not found...
bash: mktemp: command not found...
bash: touch: command not found...
ERROR: virtualenvwrapper could not create a temporary file name.
bash: sed: command not found...
“哪个virtualenvwrapper.sh”的输出
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
alias python=python3.6
alias pip=pip3.6
export PATH
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64/jre/
export JRE_HOME=/usr/lib/jvm/jre-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64
#export PATH=$HOME/anaconda3/bin:$PATH
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3.6
export WORKON_HOME=$HOME/.virtualenvs
source /usr/bin/virtualenvwrapper.sh
但它位于“ /usr/bin/virtualenvwrapper.sh”中
当我打开新的bash shell时发出警告
/bin/virtualenvwrapper.sh
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。