jstacoder / flask-cms

a minimal CMS built on the pythonic MTV (model / template / view) pattern, implemented using the flask webframework
136 stars 37 forks source link

Odd exception when trying to test. #13

Closed cstrutton closed 9 years ago

cstrutton commented 9 years ago

I built a fresh virtual enviroment (python 2.7) and ran python setup.py in it. Everything seems to install without a hitch. I add local_settings.py. When I run python manage.py db update I get the following error:

Traceback (most recent call last):
    File "manage.py", line 11, in <module>
     from app import app
  File "/home/chris/devops/rodandfly/flask-cms/flask_cms/app.py", line 12, in <module>
     app = AppFactory(DevelopmentConfig).get_app(__name__)
  File "/home/chris/devops/rodandfly/flask-cms/flask_cms/main/factory.py", line 40, in get_app
     self._register_blueprints()
  File "/home/chris/devops/rodandfly/flask-cms/flask_cms/main/factory.py", line 91, in _register_blueprints
     module, b_name = self._get_imported_stuff_by_path(blueprint_path)
   File "/home/chris/devops/rodandfly/flask-cms/flask_cms/main/factory.py", line 49, in _get_imported_stuff_by_path
         module = import_string(module_name)
  File "/home/chris/.virtualenvs/venv/local/lib/python2.7/site-packages/Werkzeug-0.9.6-py2.7.egg/werkzeug/utils.py", line 426, in import_string
    sys.exc_info()[2])
  File "/home/chris/.virtualenvs/venv/local/lib/python2.7/site-packages/Werkzeug-0.9.6-py2.7.egg/werkzeug/utils.py", line 408, in import_string
     return __import__(import_name)
  File "/home/chris/devops/rodandfly/flask-cms/flask_cms/core/__init__.py", line 12, in <module>
     from views import *
   File "/home/chris/devops/rodandfly/flask-cms/flask_cms/core/views.py", line 10, in <module>
     from flask_cms.blog.models import Category,Tag
    File "/home/chris/devops/rodandfly/flask-cms/flask_cms/blog/models.py", line 9, in <module>
     from flask_xxl.basemodels import BaseMixin
   File "/home/chris/.virtualenvs/venv/local/lib/python2.7/site-packages/flask_xxl-0.6.6-py2.7.egg/flask_xxl/basemodels.py", line 11, in <module>
     from flask.ext.sqlalchemy import SQLAlchemy, _BoundDeclarativeMeta, _QueryProperty, sessionmaker
   File "/home/chris/.virtualenvs/venv/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/exthook.py", line 87, in load_module
    raise ImportError('No module named %s' % fullname)
 werkzeug.utils.ImportStringError: import_string() failed for 'core'. Possible reasons are:

  - missing __init__.py in a package;
  - package or module path not included in sys.path;
  - duplicated package or module name taking precedence in sys.path;
  - missing module, class, function or variable;

 Debugged import:

 - 'core' not found.

 Original exception:

 ImportError: No module named flask.ext.sqlalchemy.sessionmaker

Am I missing something?

jstacoder commented 9 years ago

ahh, that still had an old version of flask-xxl in the requirements.txt, ive been refactoring that library, pulling out its dependency on flask-sqlalchemy. so just update your repo,

git pull

then update the dependencys

pip install -r flask_cms/requirements.txt -I

make sure to add the -I so it ignores the fact that flask-xxl is already installed. that should fix that error.

cstrutton commented 9 years ago

Thanks for the quick response. Unfortunately, I am still having problems. I was able to reproduce as follows:

git clone https://github.com/jstacoder/flask-cms.git
...
cd flask-cms
virtualenv venv
. venv/bin/activate
which python  
    flask-cms/venv/bin/python
python setup.py develop

This gives me a conflict:
error: Installed distribution Markdown 2.5.2 conflicts with requirement Markdown==2.5.1 I fixed that by changing requirements.txt to Markdown==2.5.2 Now I am stuck at: error: Installed distribution flask-codemirror 0.0.4 conflicts with requirement flask-codemirror==0.0.3

I started an issue at flask-xxl for this one (does flask-xxl require code-mirror?)

Let me know when I can try again. I'm looking forward to seeing this working.

cstrutton commented 9 years ago

got around codemirror by requiring 0.0.3

now its complaining about Pygments==1.6 (from flask-cms) conflicting with installed version 2.0.1

cstrutton commented 9 years ago

also had to fix debugbar the same way with flask-cms wanting 0.9.0 and flask-xxl wanting 0.9.2

this gets me through setup.py.

If I find the time and I like the project, I will look at stripping down requirements.txt to the bare minimum and maybe removing a lot of the spcific version (changing == to >= where appropriate).