简体   繁体   English

bash: mkvirtualenv: 命令未找到

[英]bash: mkvirtualenv: command not found

After following the instructions on Doug Hellman's virtualenvwrapper post , I still could not fire up a test environment.按照Doug Hellman 的virtualenvwrapper帖子中的说明进行操作,我仍然无法启动测试环境。

[mpenning@tsunami ~]$ mkvirtualenv test
-bash: mkvirtualenv: command not found
[mpenning@tsunami ~]$

It should be noted that I'm using WORKON_HOME that is not in my $HOME .应该注意的是,我使用的WORKON_HOME不在我的$HOME I tried looking for /usr/local/bin/virtualenvwrapper.sh as shown in thevirtualenvwrapper installation docs , but it does not exist.我尝试查找/usr/local/bin/virtualenvwrapper.sh ,如virtualenvwrapper安装文档中所示,但它不存在。

I'm running CentOS 6 and python 2.6.6, if this matters.如果这很重要,我正在运行 CentOS 6 和 python 2.6.6。


# File: ~/.bash_profile
# ...

export WORKON_HOME="/opt/virtual_env/"
source "/opt/virtual_env/bin/virtualenvwrapper_bashrc"

After following the instructions on Doug Hellman's virtualenvwrapper post , I still could not fire up a test environment.按照Doug Hellman的virtualenvwrapper帖子中的说明进行操作,我仍然无法启动测试环境。

[mpenning@tsunami ~]$ mkvirtualenv test
-bash: mkvirtualenv: command not found
[mpenning@tsunami ~]$

It should be noted that I'm using WORKON_HOME that is not in my $HOME .应该注意的是,我正在使用WORKON_HOME $HOME WORKON_HOME I tried looking for /usr/local/bin/virtualenvwrapper.sh as shown in thevirtualenvwrapper installation docs , but it does not exist.我尝试查找/usr/local/bin/virtualenvwrapper.sh ,如virtualenvwrapper安装文档所示,但它不存在。

I'm running CentOS 6 and python 2.6.6, if this matters.如果这很重要,我正在运行CentOS 6和python 2.6.6。


# File: ~/.bash_profile
# ...

export WORKON_HOME="/opt/virtual_env/"
source "/opt/virtual_env/bin/virtualenvwrapper_bashrc"

After following the instructions on Doug Hellman's virtualenvwrapper post , I still could not fire up a test environment.按照Doug Hellman的virtualenvwrapper帖子中的说明进行操作,我仍然无法启动测试环境。

[mpenning@tsunami ~]$ mkvirtualenv test
-bash: mkvirtualenv: command not found
[mpenning@tsunami ~]$

It should be noted that I'm using WORKON_HOME that is not in my $HOME .应该注意的是,我正在使用WORKON_HOME $HOME WORKON_HOME I tried looking for /usr/local/bin/virtualenvwrapper.sh as shown in thevirtualenvwrapper installation docs , but it does not exist.我尝试查找/usr/local/bin/virtualenvwrapper.sh ,如virtualenvwrapper安装文档所示,但它不存在。

I'm running CentOS 6 and python 2.6.6, if this matters.如果这很重要,我正在运行CentOS 6和python 2.6.6。


# File: ~/.bash_profile
# ...

export WORKON_HOME="/opt/virtual_env/"
source "/opt/virtual_env/bin/virtualenvwrapper_bashrc"

After following the instructions on Doug Hellman's virtualenvwrapper post , I still could not fire up a test environment.按照Doug Hellman的virtualenvwrapper帖子中的说明进行操作,我仍然无法启动测试环境。

[mpenning@tsunami ~]$ mkvirtualenv test
-bash: mkvirtualenv: command not found
[mpenning@tsunami ~]$

It should be noted that I'm using WORKON_HOME that is not in my $HOME .应该注意的是,我正在使用WORKON_HOME $HOME WORKON_HOME I tried looking for /usr/local/bin/virtualenvwrapper.sh as shown in thevirtualenvwrapper installation docs , but it does not exist.我尝试查找/usr/local/bin/virtualenvwrapper.sh ,如virtualenvwrapper安装文档所示,但它不存在。

I'm running CentOS 6 and python 2.6.6, if this matters.如果这很重要,我正在运行CentOS 6和python 2.6.6。


# File: ~/.bash_profile
# ...

export WORKON_HOME="/opt/virtual_env/"
source "/opt/virtual_env/bin/virtualenvwrapper_bashrc"

After following the instructions on Doug Hellman's virtualenvwrapper post , I still could not fire up a test environment.按照Doug Hellman的virtualenvwrapper帖子中的说明进行操作,我仍然无法启动测试环境。

[mpenning@tsunami ~]$ mkvirtualenv test
-bash: mkvirtualenv: command not found
[mpenning@tsunami ~]$

It should be noted that I'm using WORKON_HOME that is not in my $HOME .应该注意的是,我正在使用WORKON_HOME $HOME WORKON_HOME I tried looking for /usr/local/bin/virtualenvwrapper.sh as shown in thevirtualenvwrapper installation docs , but it does not exist.我尝试查找/usr/local/bin/virtualenvwrapper.sh ,如virtualenvwrapper安装文档所示,但它不存在。

I'm running CentOS 6 and python 2.6.6, if this matters.如果这很重要,我正在运行CentOS 6和python 2.6.6。


# File: ~/.bash_profile
# ...

export WORKON_HOME="/opt/virtual_env/"
source "/opt/virtual_env/bin/virtualenvwrapper_bashrc"

After following the instructions on Doug Hellman's virtualenvwrapper post , I still could not fire up a test environment.按照Doug Hellman的virtualenvwrapper帖子中的说明进行操作,我仍然无法启动测试环境。

[mpenning@tsunami ~]$ mkvirtualenv test
-bash: mkvirtualenv: command not found
[mpenning@tsunami ~]$

It should be noted that I'm using WORKON_HOME that is not in my $HOME .应该注意的是,我正在使用WORKON_HOME $HOME WORKON_HOME I tried looking for /usr/local/bin/virtualenvwrapper.sh as shown in thevirtualenvwrapper installation docs , but it does not exist.我尝试查找/usr/local/bin/virtualenvwrapper.sh ,如virtualenvwrapper安装文档所示,但它不存在。

I'm running CentOS 6 and python 2.6.6, if this matters.如果这很重要,我正在运行CentOS 6和python 2.6.6。


# File: ~/.bash_profile
# ...

export WORKON_HOME="/opt/virtual_env/"
source "/opt/virtual_env/bin/virtualenvwrapper_bashrc"

After following the instructions on Doug Hellman's virtualenvwrapper post , I still could not fire up a test environment.按照Doug Hellman的virtualenvwrapper帖子中的说明进行操作,我仍然无法启动测试环境。

[mpenning@tsunami ~]$ mkvirtualenv test
-bash: mkvirtualenv: command not found
[mpenning@tsunami ~]$

It should be noted that I'm using WORKON_HOME that is not in my $HOME .应该注意的是,我正在使用WORKON_HOME $HOME WORKON_HOME I tried looking for /usr/local/bin/virtualenvwrapper.sh as shown in thevirtualenvwrapper installation docs , but it does not exist.我尝试查找/usr/local/bin/virtualenvwrapper.sh ,如virtualenvwrapper安装文档所示,但它不存在。

I'm running CentOS 6 and python 2.6.6, if this matters.如果这很重要,我正在运行CentOS 6和python 2.6.6。


# File: ~/.bash_profile
# ...

export WORKON_HOME="/opt/virtual_env/"
source "/opt/virtual_env/bin/virtualenvwrapper_bashrc"

After following the instructions on Doug Hellman's virtualenvwrapper post , I still could not fire up a test environment.按照Doug Hellman的virtualenvwrapper帖子中的说明进行操作,我仍然无法启动测试环境。

[mpenning@tsunami ~]$ mkvirtualenv test
-bash: mkvirtualenv: command not found
[mpenning@tsunami ~]$

It should be noted that I'm using WORKON_HOME that is not in my $HOME .应该注意的是,我正在使用WORKON_HOME $HOME WORKON_HOME I tried looking for /usr/local/bin/virtualenvwrapper.sh as shown in thevirtualenvwrapper installation docs , but it does not exist.我尝试查找/usr/local/bin/virtualenvwrapper.sh ,如virtualenvwrapper安装文档所示,但它不存在。

I'm running CentOS 6 and python 2.6.6, if this matters.如果这很重要,我正在运行CentOS 6和python 2.6.6。


# File: ~/.bash_profile
# ...

export WORKON_HOME="/opt/virtual_env/"
source "/opt/virtual_env/bin/virtualenvwrapper_bashrc"

After following the instructions on Doug Hellman's virtualenvwrapper post , I still could not fire up a test environment.按照Doug Hellman的virtualenvwrapper帖子中的说明进行操作,我仍然无法启动测试环境。

[mpenning@tsunami ~]$ mkvirtualenv test
-bash: mkvirtualenv: command not found
[mpenning@tsunami ~]$

It should be noted that I'm using WORKON_HOME that is not in my $HOME .应该注意的是,我正在使用WORKON_HOME $HOME WORKON_HOME I tried looking for /usr/local/bin/virtualenvwrapper.sh as shown in thevirtualenvwrapper installation docs , but it does not exist.我尝试查找/usr/local/bin/virtualenvwrapper.sh ,如virtualenvwrapper安装文档所示,但它不存在。

I'm running CentOS 6 and python 2.6.6, if this matters.如果这很重要,我正在运行CentOS 6和python 2.6.6。


# File: ~/.bash_profile
# ...

export WORKON_HOME="/opt/virtual_env/"
source "/opt/virtual_env/bin/virtualenvwrapper_bashrc"

After following the instructions on Doug Hellman's virtualenvwrapper post , I still could not fire up a test environment.按照Doug Hellman的virtualenvwrapper帖子中的说明进行操作,我仍然无法启动测试环境。

[mpenning@tsunami ~]$ mkvirtualenv test
-bash: mkvirtualenv: command not found
[mpenning@tsunami ~]$

It should be noted that I'm using WORKON_HOME that is not in my $HOME .应该注意的是,我正在使用WORKON_HOME $HOME WORKON_HOME I tried looking for /usr/local/bin/virtualenvwrapper.sh as shown in thevirtualenvwrapper installation docs , but it does not exist.我尝试查找/usr/local/bin/virtualenvwrapper.sh ,如virtualenvwrapper安装文档所示,但它不存在。

I'm running CentOS 6 and python 2.6.6, if this matters.如果这很重要,我正在运行CentOS 6和python 2.6.6。


# File: ~/.bash_profile
# ...

export WORKON_HOME="/opt/virtual_env/"
source "/opt/virtual_env/bin/virtualenvwrapper_bashrc"

open your bashrc file using使用打开你的 bashrc 文件

gedit ~/.bashrc

go to the bottom of the bashrc file and copy these lines and paste it转到 bashrc 文件的底部并复制这些行并粘贴

which python3(gives you the python path) which python3(给你python路径)

export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3


export WORKON_HOME=$HOME/.virtualenvs

which virtualenv (gives you the location of virtualenv) which virtualenv (给你 virtualenv 的位置)

export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv

which virtualenvwrapper.sh(returns the location of virtualenvwrapper.sh) which virtualenvwrapper.sh(返回virtualenvwrapper.sh的位置)

source /usr/local/bin/virtualenvwrapper.sh

please copy these lines in the same order as given above请按照上面给出的相同顺序复制这些行

for more information you can refer to: https://www.freecodecamp.org/news/virtualenv-with-virtualenvwrapper-on-ubuntu-18-04/有关更多信息,您可以参考: https : //www.freecodecamp.org/news/virtualenv-with-virtualenvwrapper-on-ubuntu-18-04/

Alternatively you can use:或者,您可以使用:

create virtual environment :创建虚拟环境:

python3 -m venv <virtual environment name>

virtualenv <virtual environment name>

To activate the virtual environment激活虚拟环境

source <virtual environment name>/bin/activate

To deactivate the virtual environment停用虚拟环境

deactivate

After following the instructions on Doug Hellman's virtualenvwrapper post , I still could not fire up a test environment.按照Doug Hellman的virtualenvwrapper帖子中的说明进行操作,我仍然无法启动测试环境。

[mpenning@tsunami ~]$ mkvirtualenv test
-bash: mkvirtualenv: command not found
[mpenning@tsunami ~]$

It should be noted that I'm using WORKON_HOME that is not in my $HOME .应该注意的是,我正在使用WORKON_HOME $HOME WORKON_HOME I tried looking for /usr/local/bin/virtualenvwrapper.sh as shown in thevirtualenvwrapper installation docs , but it does not exist.我尝试查找/usr/local/bin/virtualenvwrapper.sh ,如virtualenvwrapper安装文档所示,但它不存在。

I'm running CentOS 6 and python 2.6.6, if this matters.如果这很重要,我正在运行CentOS 6和python 2.6.6。


# File: ~/.bash_profile
# ...

export WORKON_HOME="/opt/virtual_env/"
source "/opt/virtual_env/bin/virtualenvwrapper_bashrc"

After following the instructions on Doug Hellman's virtualenvwrapper post , I still could not fire up a test environment.按照Doug Hellman的virtualenvwrapper帖子中的说明进行操作,我仍然无法启动测试环境。

[mpenning@tsunami ~]$ mkvirtualenv test
-bash: mkvirtualenv: command not found
[mpenning@tsunami ~]$

It should be noted that I'm using WORKON_HOME that is not in my $HOME .应该注意的是,我正在使用WORKON_HOME $HOME WORKON_HOME I tried looking for /usr/local/bin/virtualenvwrapper.sh as shown in thevirtualenvwrapper installation docs , but it does not exist.我尝试查找/usr/local/bin/virtualenvwrapper.sh ,如virtualenvwrapper安装文档所示,但它不存在。

I'm running CentOS 6 and python 2.6.6, if this matters.如果这很重要,我正在运行CentOS 6和python 2.6.6。


# File: ~/.bash_profile
# ...

export WORKON_HOME="/opt/virtual_env/"
source "/opt/virtual_env/bin/virtualenvwrapper_bashrc"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM