How to tell if you have multiple Django's installed

|▌冷眼眸甩不掉的悲伤 提交于 2020-02-03 04:35:07

问题


In the process of trying to install django, I had a series of failures. I followed many different tutorials online and ended up trying to install it several times. I think I may have installed it twice (which the website said was not a good thing), so how do I tell if I actually have multiple versions installed? I have a Mac running Lion.


回答1:


open terminal and type python then type import django then type django and it will tell you the path to the django you are importing. Goto that folder [it should look something like this: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/] and look for more than one instance of django(if there is more than one, they will be right next to each other). Delete the one(s) you don't want.




回答2:


You could install yolk - it will list all your python packages if you call it ('yolk -l')

Also it is worth while looking into virtualenv as maxi suggested. It basically allows you to have different python configurations (i.e. packages installed...) and makes it easy to switch between them.

Additionally, it seems you might have been installing django manually. I would suggest checking out pip and setuptools (aka easy_install), two very popular python package management utilities.




回答3:


Check out virtualenv and virtualenvwrapper



来源:https://stackoverflow.com/questions/11166014/how-to-tell-if-you-have-multiple-djangos-installed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!