如何找到virtualenv python的路径 [英] how can I find the path of virtualenv python

查看:42
本文介绍了如何找到virtualenv python的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何找到用本教程构建的 virtualenv python 的路径?
(我想在这个环境中找到 python 并在我的 eclipse 中使用它)

how can I find the path of virtualenv python ,built with this tutorial?
(i want to find python in this env and use it in my eclipse)

$ sudo pip install virtualenv virtualenvwrapper
$ export WORKON_HOME=$HOME/.virtualenvs
$ source /usr/local/bin/virtualenvwrapper.sh

$ echo -e "\n# virtualenv and virtualenvwrapper" >> ~/.bashrc
$ echo "export WORKON_HOME=$HOME/.virtualenvs" >> ~/.bashrc
$ echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc

$ source ~/.bashrc

$ mkvirtualenv cv -p python3

推荐答案

您可以使用 which 来找出将执行哪个二进制文件...

You can use which to find out which binary will be executed...

例如:

$ which python3
/home/attie/projects/thing/venv/bin/python3

默认情况下它只显示第一个匹配项,但您可以给 -a 参数以显示全部:

By default it just shows the first match, but you can give the -a argument to show all:

$ which -a python3
/home/attie/projects/thing/venv/bin/python3
/usr/bin/python3

这篇关于如何找到virtualenv python的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆