mark
mark

Reputation: 371

Trying to import the flask Admin module in pycharm

from flask import Flask
from flask.ext.admin import Admin



app = Flask(__name__)

admin = Admin(app)
# Add administrative views here

app.run(debug=True)

using python 3.3

getting error: "ImportError: No module named 'flask_admin'" when

I have already set up an interpreter and downloaded the latest flask & flask_admin

I am new to pycharm and python in general so I'm sure it is something stupid I am doing wrong.

Upvotes: 2

Views: 3346

Answers (2)

Uma Shankar Pandey
Uma Shankar Pandey

Reputation: 59

Check if project developed using makefile

if makefile is there just follow readme.md

make install
make run

Otherwise bellow steps

First Create Virtual ENV:

virtualenv env

Put Project Inside env:

anywhere parallel to bin,lib,etc

Then Activate env:

 source venv/bin/activate

When you inside env run bellow command :

 pip install -r requirements/development.txt 
(use correct file path according your project structure)

For Python 3:

$python3

import flask_admin

quit()

For Python 2:

$python

import flask_admin

quit()

Upvotes: 0

mark
mark

Reputation: 371

figured it out, was running from command line and it was using the default interpreter and not my custom one

Upvotes: 2

Related Questions