在python安装完virtualenv,调用命令报错,找不到对应的命令。
- [root@mysql–server ~]# virtualenv
- -bash: virtualenv: command not found
- [root@mysql–server ~]# find / -name virtualenv
- /usr/local/python36/bin/virtualenv
# 使用的是CentOS 6.3版本,之前在其他新的Linux版本没有发现这个问题。
# 解决方法,使用完整路径来创建虚拟环境。
- [root@mysql–server data1]# /usr/local/python36/bin/virtualenv venv4archer
- Using base prefix ‘/usr/local/python36’
- New python executable in /data1/venv4archer/bin/python3.6
- Also creating executable in /data1/venv4archer/bin/python
- Installing setuptools, pip, wheel...done.
- [root@mysql–server ~]# cat /etc/redhat-release
- CentOS release 6.3 (Final)