miniconda安装了本地虚拟环境,在执行django创建新项目时候,提示报错 -bash: django-admin.py: 未找到命令
解决方案:
- 切换到环境的虚拟环境, 查看conda的site-packages的路径地址
$ /path/miniconda3/bin/python
Python 3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils.sysconfig import get_python_lib
>>> print(get_python_lib())
/path/miniconda3/envs/myenv36/lib/python3.6/site-packages
/path/miniconda3/envs/envname/bin/python /path/miniconda3/envs/envname/lib/python3.6/site-packages/django/bin/django-admin.py startproject project .