python virtualenv报错-bash: virtualenv: command not found

在python安装完virtualenv,调用命令报错,找不到对应的命令。

  1. [root@mysqlserver ~]# virtualenv
  2. -bash: virtualenv: command not found
  3. [root@mysqlserver ~]# find / -name virtualenv
  4. /usr/local/python36/bin/virtualenv


# 使用的是CentOS 6.3版本,之前在其他新的Linux版本没有发现这个问题。
# 解决方法,使用完整路径来创建虚拟环境。

  1. [root@mysqlserver data1]# /usr/local/python36/bin/virtualenv venv4archer
  2. Using base prefix ‘/usr/local/python36’
  3. New python executable in /data1/venv4archer/bin/python3.6
  4. Also creating executable in /data1/venv4archer/bin/python
  5. Installing setuptools, pip, wheel...done.
  6. [root@mysqlserver ~]# cat /etc/redhat-release
  7. CentOS release 6.3 (Final)
    原文作者:feelpurple
    原文地址: http://blog.itpub.net/26506993/viewspace-2157241/
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞