ubuntu - 在 Ubuntu 12.04 : Location of virtualenvwrapper. sh 上设置 VirtualenvWrapper?

标签 ubuntu ubuntu-12.04 virtualenvwrapper

我在本地计算机上使用 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/

相关文章:

linux - 无法从同一局域网中的另一台主机 ping docker 容器

bash - 如何以编程方式编辑 pg_hba.conf?

unix - 从终端更改 unix 文件权限

android - "List of devices attached"在 Ubuntu 12.04 上是空的

windows - 在 msysgit 中使用 virtualenvwrapper-win (sh.exe": mkvirtualenv: command not found), 在正常的 cmd 中工作

python - 如何在 Ubuntu 上构建 PyQt5

php - 为什么 laravel View 显示空白页?

linux - 查看为bash进程分配了多少虚拟内存

python - mkvirtualenv : command not found

ubuntu - 为什么 virtualenv workon 不带我到 env 目录