Open davidbgk opened 10 years ago
I work with a virtualenv too so I'm sure it's not the problem.
Try to install babel before the make dist.
It worked once babel is installed but now I'm blocked at the next command (build_assets). I guess that's because webassets
is not yet installed and used in weckan.commands
?
Well, my guess was wrong, my config:
$ pip --version
pip 1.5.4 from /Users/david/.virtualenvs/weckan/lib/python2.7/site-packages (python 2.7)
$ python
Python 2.7.6 (default, Dec 5 2013, 15:15:16)
[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.60))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
>>> setuptools.__version__
'2.2'
Yes, you're right. But like you said, in #3 you can install it directly from PyPI now (but there may be a pinned version)
Even installing webassets
from your fork doesn't resolve the issue, the build_assets
command is still invalid. I'm investigating.
Try:
$ bower install
$ make assets
The bower install part works but you need to install almost all Python dependencies to be able to import the command, try this:
>>> from weckan.commands import BuildAssets
I'm not familiar with setuptools' entrypoints but I guess that reading dependencies from an external requirements.txt file would work and allow to install dependencies prior to launch commands?
I'm now facing an ImportError related to paste:
>>> from weckan.commands import BuildAssets
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "weckan/commands.py", line 11, in <module>
from weckan.templates import get_webassets_env
File "weckan/templates/__init__.py", line 40, in <module>
from .. import conf, contexts, auth
File "weckan/auth.py", line 24, in <module>
from weckan.model import User, Member, Role, Group, Package, meta
File "weckan/model.py", line 32, in <module>
from ckan.model import *
File "/Users/david/.virtualenvs/weckan/lib/python2.7/site-packages/ckan/model/__init__.py", line 12, in <module>
import meta
File "/Users/david/.virtualenvs/weckan/lib/python2.7/site-packages/ckan/model/meta.py", line 3, in <module>
from paste.deploy.converters import asbool
ImportError: No module named deploy.converters
and my current pip freeze
is:
Babel==1.3
-e git+https://github.com/etalab/biryani.git@5fa34c85573fbe059cc9308251ff1d8cf766c08e#egg=Biryani1-biryani1
Jinja2==2.7.2
MarkupSafe==0.19
Paste==1.7.5.1
PyYAML==3.11
Pygments==1.6
SQLAlchemy==0.7.0
Tempita==0.5.2
WTForms==1.0.5
WebError==0.10.3
WebHelpers==1.3
WebOb==1.3.1
bleach==1.2.2
ckan==2.2
cssmin==0.2.0
deploy==1.9.0
futures==2.1.6
html5lib==0.95
pycoffee==1.0.0
pytz==2014.2
requests==2.2.1
six==1.6.1
vdm==0.12
webassets==0.9.dev
wsgiref==0.1.2
I guess that's because I didn't install the right version of Paste to be compatible with the ckan module. I'll dig deeper tomorrow.
After trying to guess which packages/versions are right I'm giving up until I got both requirements.txt
and package.json
files. My current freeze:
Babel==1.3
Beaker==1.6.4
-e git+https://github.com/etalab/biryani.git@5fa34c85573fbe059cc9308251ff1d8cf766c08e#egg=Biryani1-biryani1
FormEncode==1.2.6
Jinja2==2.7.2
Mako==0.9.1
MarkupSafe==0.19
Paste==1.7.5.1
PasteDeploy==1.5.2
PasteScript==1.7.5
PyUtilib==4.6.3215
PyYAML==3.11
Pygments==1.6
Pylons==0.9.7
Routes==2.0
SQLAlchemy==0.7.0
Tempita==0.5.2
WTForms==1.0.5
WebError==0.10.3
WebHelpers==1.3
WebOb==1.0.8
WebTest==2.0.14
beautifulsoup4==4.3.2
bleach==1.2.2
ckan==2.1
cssmin==0.2.0
decorator==3.4.0
deploy==1.9.0
futures==2.1.6
html5lib==0.95
nose==1.3.1
pycoffee==1.0.0
pytz==2014.2
pyutilib.R==3.1
pyutilib.autotest==2.0.1
pyutilib.common==3.0.7
pyutilib.component.app==3.2
pyutilib.component.config==3.6.1
pyutilib.component.core==4.6
pyutilib.component.executables==3.5
pyutilib.component.loader==3.4.1
pyutilib.dev==2.4
pyutilib.enum==1.2
pyutilib.excel==3.1.2
pyutilib.math==3.3.1
pyutilib.misc==5.7
pyutilib.ply==3.0.8
pyutilib.pyro==3.6
pyutilib.services==3.4
pyutilib.subprocess==3.6.1
pyutilib.svn==1.5
pyutilib.th==5.4.1
pyutilib.virtualenv==4.2
pyutilib.workflow==3.5
repoze.lru==0.6
requests==2.2.1
simplejson==3.3.3
six==1.6.1
vdm==0.12
virtualenv==1.9.1
waitress==0.8.8
webassets==0.9.dev
wsgiref==0.1.2
The initial import of the command works now but the make command still fails and if I manually attempt to launch it in Python:
>>> from weckan.commands import BuildAssets
>>> from distutils.dist import Distribution
>>> BuildAssets(Distribution()).run()
Building bundle: css/search.min.css
Building bundle: css/home.min.css
Building bundle: js/organization.min.js
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "weckan/commands.py", line 46, in run
cmdenv.build()
File "/Users/david/.virtualenvs/weckan/lib/python2.7/site-packages/webassets/script.py", line 172, in __call__
disable_cache=no_cache)
File "/Users/david/.virtualenvs/weckan/lib/python2.7/site-packages/webassets/bundle.py", line 567, in build
disable_cache=disable_cache))
File "/Users/david/.virtualenvs/weckan/lib/python2.7/site-packages/webassets/bundle.py", line 504, in _build
force, disable_cache=disable_cache, extra_filters=extra_filters)
File "/Users/david/.virtualenvs/weckan/lib/python2.7/site-packages/webassets/bundle.py", line 459, in _merge_and_apply
return filtertool.apply(final, selected_filters, 'output')
File "/Users/david/.virtualenvs/weckan/lib/python2.7/site-packages/webassets/merge.py", line 272, in apply
return self._wrap_cache(key, func)
File "/Users/david/.virtualenvs/weckan/lib/python2.7/site-packages/webassets/merge.py", line 219, in _wrap_cache
content = func().getvalue()
File "/Users/david/.virtualenvs/weckan/lib/python2.7/site-packages/webassets/merge.py", line 252, in func
getattr(filter, type)(data, out, **kwargs_final)
File "/Users/david/.virtualenvs/weckan/lib/python2.7/site-packages/webassets/filter/uglifyjs.py", line 32, in output
self.subprocess(args, out, _in)
File "/Users/david/.virtualenvs/weckan/lib/python2.7/site-packages/webassets/filter/__init__.py", line 494, in subprocess
stderr=subprocess.PIPE)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 709, in __init__
errread, errwrite)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1326, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
I'm probably missing something here…
Maybe worth trying to fix it before the OpenDataCamp?
I'll review this this week-end (I will provide a package.json too ease the npm install part). I had it working on Mac OSX with Homebrew and right now in Linux (arch) so it must be a details missing. For the next Open Data Camp (I believe you mean the Paris Conference techday), we will be working on a brand new code base.
Here is the complete log:
It happened while running the command in a virtualenv (I'm not sure that's relevant but that's the only thing that differs from the README instructions).