續《如何卸載canopy》
卸載canopy之後,重新安裝了MySQLdb,當新建cursor時,會提示以下錯誤:
The Python egg cache directory is currently set to:
/Users/tyre77/.python-eggs
Perhaps your account does not have write access to this directory? You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.
根據提示,原因是目前的用戶沒有權限訪問.python-eggs,而數據庫的緩存目錄就在這裏。
進入python shell時如果使用sudo,那麼就不會提示以上錯誤,更驗證了我的猜想。
先cd到.python-eggs目錄。
cd /Users/tyre77/.python-eggs/
然後修改本文件夾的權限。
sudo chown -R 用戶名
發現錯誤就沒有了。
————————————————————
github主頁:https://github.com/gt11799
E-mail:[email protected]