-1
使用命令virtualenv myvenv
創建虛擬環境時,出現以下錯誤:-bash: virtualenv: command not found
。什麼是問題?爲python創建虛擬環境
ADITIs-MacBook-Air:~ aditinarware$ pip install virtualenv
Requirement already satisfied: virtualenv in /Library/Python/2.7/site-packages
ADITIs-MacBook-Air:~ aditinarware$ cd Desktop/Python_projects/
ADITIs-MacBook-Air:Python_projects aditinarware$ virtualenv myvenv
-bash: virtualenv: command not found
ADITIs-MacBook-Air:Python_projects aditinarware$ virtualenv -p /usr/bin/python2.7 venv
-bash: virtualenv: command not found
請不要將文字發佈爲圖片。將其複製粘貼到帖子中。 –
看來/Library/Python/2.7/site-packages目錄不在你的$ PATH變量中。嘗試將它添加到.bashrc中的$ PATH中並重新加載bash。或者你可以在該目錄下運行virtualenv – lyang