spike74
spike74

Reputation: 185

ImportError: No module named bootstrap3

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!

Upvotes: 12

Views: 31628

Answers (5)

Vinay Singh
Vinay Singh

Reputation: 1

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!

Upvotes: 0

Smilez
Smilez

Reputation: 111

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.

Upvotes: 0

Vikas Kumar
Vikas Kumar

Reputation: 131

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

Upvotes: 10

Maryam Homayouni
Maryam Homayouni

Reputation: 943

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

Run this command:

pip install -r requirements.txt

Upvotes: 2

Sentient07
Sentient07

Reputation: 1290

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/

Upvotes: 5

Related Questions