w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Django set up help in venv : Attribute error: 'module' object has no attribute 'get_version'

I think you are not using a virtualenv, or your venv has access to system packages, which somehow defeats one of the advantages of using them.

To create a virtualenv use

$ virtualenv --no-site-packages --distribute -p python2.4
~/my_venv

This will create a virtualenv in your home folder giving no access to system packages. The -p switch let you select your python version: if you have a more recent python version installed you should use it, or you will only be able to use Django 1.3. See here.

Next you need to activate it

$ source ~/my_venv/bin/activate
(my_venv) $

That new prompt shows you that you are now using your virtualenv. You can then install Django (replace that version which one you need or can use) and everything you need

$ pip install Django==1.3

Everytime you want to use your virtualenv, you will need to activate it. To ise again you default python installation use deactivate.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.