我在本地计算机上使用 Virtualenv 和 VirtualenvWrapper,并发现它们是很棒的工具。我正在尝试在运行 Ubuntu 12.04 服务器和 Apache 的虚拟机上为我的生产 Python 应用程序设置相同的设置。
Virtualenv 工作正常。但我在配置 VirtualenvWrapper 时遇到问题。我已经通过 pip 安装了它。 pip freeze
给了我
virtualenv==1.7.1.2
virtualenvwrapper==2.11.1
我已按照 documentation 上的说明进行操作
$ pip install virtualenvwrapper
注意:请参阅下面的编辑 virtualenvwrapper 实际上是通过 apt-get 安装的。不过,我确实遵循了其余的说明。
...
$ export WORKON_HOME=~/Envs
$ mkdir -p $WORKON_HOME
但是当我尝试下一步
$ source /usr/local/bin/virtualenvwrapper.sh
我收到错误
-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory
我的/usr/local/bin/
里面只有一个文件django-admin.py
文档说明
First, some initialization steps. Most of this only needs to be done one time. You will want to add the command to source /usr/local/bin/virtualenvwrapper.sh to your shell startup file, changing the path to virtualenvwrapper.sh depending on where it was installed by pip.
如何找到该文件的位置?
使用find/-name "virtualenvwrapper.sh"
只会输出权限被拒绝
错误列表
运行 find/-name virtualenvwrapper
给我
/usr/share/doc/virtualenvwrapper
/usr/share/pyshared/virtualenvwrapper
/usr/share/doc-base/virtualenvwrapper
/usr/share/python/ns/virtualenvwrapper
/usr/lib/python2.7/dist-packages/virtualenvwrapper
任何有关如何查找该文件的建议都会很棒
编辑:
由于代理问题,我实际上通过 apt-get 安装了 virtualenvwrapper
sudo apt-get install virtualenvwrapper
这可能会使 virtualenvwrapper.sh
陷入不同的位置吗?
最佳答案
阅读README.Debian
您安装的软件包的名称(通常是在您安装不熟悉的软件包时)。它位于 /usr/share/doc/virtualenvwrapper
它告诉您您正在查找的文件安装在/etc/bash_completion.d/virtualenvwrapper
中.
另请参阅https://askubuntu.com/questions/251378/where-is-virtualenvwrapper-sh
关于ubuntu - 在 Ubuntu 12.04 : Location of virtualenvwrapper. sh 上设置 VirtualenvWrapper?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24085226/