12

I installed bootstrap3 with

$ pip install django-bootstrap3

It is being installed in this directory

/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/

Django seems to be looking at this directory

/Users/shawnpike/anaconda/lib/python2.7/site-packages/django/

When I put 'bootstrap3' in the INSTALLED_APPS = ('bootstrap3') variable and then run

$ python manage.py runserver

I get this error

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/shawnpike/anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/Users/shawnpike/anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute
    django.setup()
  File "/Users/shawnpike/anaconda/lib/python2.7/site-packages/django/__init__.py", line 21, in setup
apps.populate(settings.INSTALLED_APPS)
  File "/Users/shawnpike/anaconda/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/Users/shawnpike/anaconda/lib/python2.7/site-packages/django/apps/config.py", line 87, in create
    module = import_module(entry)
  File "/Users/shawnpike/anaconda/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named bootstrap3

I installed bootstrap3 in the django folder by using copy and paste and that did not work. Any help would be greatly appreciated.

Thank You!

spike74
  • 185
  • 1
  • 1
  • 7
  • in the django shell, can you import bootstrap3 successfully ? – karthikr Sep 19 '14 at 20:38
  • no I get '--------------------------------------------------------------------------- ImportError Traceback (most recent call last) in () ----> 1 import bootstrap3 ImportError: No module named bootstrap3' – spike74 Sep 19 '14 at 20:49
  • LOoks like you have 2 installations of python. Would highly encourage you to use virtualenvironments. http://stackoverflow.com/questions/1534210/use-different-python-version-with-virtualenv That way, the installation would point to the current version of python – karthikr Sep 19 '14 at 20:56

5 Answers5

10

Just see which python version your Django environment is using with:

python -V

If it is using Python 2.7 run:

pip install django-bootstrap3

Otherwise, if your Django environment is using version Python 3 use:

pip3 install django-bootstrap3
tread
  • 10,133
  • 17
  • 95
  • 170
Vikas Kumar
  • 121
  • 1
  • 5
5

Try using

$pip2 install django-bootstrap3

I'm using ubuntu 14.04 and and the pip command installs packages to lib/python3.3/site-packages/ and not to lib/python2.7/site-packages/

Sentient07
  • 1,270
  • 1
  • 16
  • 24
2

You have to install Requirements.txt and it will be ok.

Run this command:

pip install -r requirements.txt
Maryam Homayouni
  • 905
  • 9
  • 16
  • This assumes the necessary packages have already been specified in the requirements.txt file, and that the file is present, otherwise this wouldn't fix his issue I guess. – JWL May 21 '16 at 13:15
0

Try using:

pip install django-bootstrap3

Instead of:

pip3 install django-bootstrap3

I found out even using just plain old pip just works (even in a python3 environment )when you're using a virtual environment (I was using anaconda). For some reason pip3 doesn't work.

Smilez
  • 113
  • 7
0

If Using Conda Virtual Environment First, check conda list

If django-bootstrap3 is not there then install using python -m pip install django-bootstrap3

After this try migrating once again.

I hope this solution works!