问题描述
我不知道什么更令人尴尬:我不知道如何自己找到这个问题的答案,或者首先要问它,但……
where does
apt-get
put thevirtualenvwrapper.sh
script after it installsvirtualenvwrapper
?
我斗智斗勇……
% sudo apt-get install virtualenvwrapper
...
% rehash
% which virtualenvwrapper.sh
virtualenvwrapper.sh not found
% which virtualenvwrapper
virtualenvwrapper not found
% find / -path /media -prune -o -name virtualenvwrapper.sh
/media
% dpkg-query -L virtualenvwrapper | grep 'virtualenvwrapper\.sh'
% sudo apt-get install virtualenvwrapper
Reading package lists...
Building dependency tree...
Reading state information...
virtualenvwrapper is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
我已经完成了尝试:apt-get
已经安装了virtualenvwrapper
,但我找不到virtualenvwrapper.sh
的任何标志。
更新:嗯,我刚发现那个文件
/etc/bash_completion.d/virtualenvwrapper
……看起来非常像virtualenvwrapper.sh。当我运行apt-get安装virtualenvwrapper(文件的mdate是几个月前)时,我无法判断这个文件是否被apt-get放在那里,但是如果是的话,那么我对这种安排的明显愚蠢感到困惑……一件事,不是每个人都使用bash(我碰巧使用zsh)。对于另一个,人们可能想要在启动以外的时间运行virtualenvwrapper.sh …我确定我在这里缺少一些主要的东西,但从表面上看,它确实看起来像virtualenvwrapper的apt-get安装是简单的延迟..无论如何,它浪费了大约三个小时的时间……
最佳解决思路
来自/usr/share/doc/virtualenvwrapper/README.Debian
:
In contrast to the information in
/usr/share/doc/virtualenvwrapper/en/html/index.html this package installs
virtualenvwrapper.sh as /etc/bash_completion.d/virtualenvwrapper.
Virtualenvwrapper is enabled if you install the package bash-completion and
enable bash completion support in /etc/bash.bashrc or your ~/.bashrc.
If you only want to use virtualenvwrapper you may just add
source /etc/bash_completion.d/virtualenvwrapper
to your ~/.bashrc.
是的,有点难找:D