所以我通过发出以下命令来创建virtualenv
[ 8:37pm ] [ xyz@ZYZ-MBP.local:~/repos/python ]
$ virtualenv projectname
New python executable in /Users/xyz/repos/python/projectname/bin/python
Installing setuptools, pip, wheel...done.
然后我发出以下命令激活环境
[ 8:37pm ] [ xyz@ZYZ-MBP.local:~/repos/python ]
$ source projectname/bin/activate
[ 8:37pm ] [ xyz@ZYZ-MBP.local:~/repos/python ]
但是我没有得到提示(projectname)$ ...
的提示,而是得到了带有$
符号的常规提示。
我在这里缺少什么?我该如何解决这个问题?
更新
这是project -m site
命令的输出。我在静脉注射activating
之后运行了该命令
[ 8:56pm ] [ xyz@xyzs-MBP.local:~/repos/python ]
$ python -m site
sys.path = [
'/Users/xyz/repos/python',
'/Users/xyz/repos/python/projectname/lib/python27.zip',
'/Users/xyz/repos/python/projectname/lib/python2.7',
'/Users/xyz/repos/python/projectname/lib/python2.7/plat-darwin',
'/Users/xyz/repos/python/projectname/lib/python2.7/plat-mac',
'/Users/xyz/repos/python/projectname/lib/python2.7/plat-mac/lib-scriptpackages',
'/Users/xyz/repos/python/projectname/lib/python2.7/lib-tk',
'/Users/xyz/repos/python/projectname/lib/python2.7/lib-old',
'/Users/xyz/repos/python/projectname/lib/python2.7/lib-dynload',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/Users/xyz/repos/python/projectname/lib/python2.7/site-packages',
]
USER_BASE: '/Users/xyz/.local' (exists)
USER_SITE: '/Users/xyz/.local/lib/python2.7/site-packages' (exists)
ENABLE_USER_SITE: False