ceumicrodata / mETL

mito ETL tool
161 stars 41 forks source link

mETL tutorial example 18_new_transformation.yml not works #22

Open ramonrxven opened 10 years ago

ramonrxven commented 10 years ago

Hi, I'm practicing with the examples of the tutorials, but the file 18_new_transformation.yml throws me the following error, thanks: Traceback (most recent call last):    File "/ usr / local / bin / metl", line 9, in      load_entry_point ('Metl 1.0.1dev ==', 'console_scripts', 'metl') ()    File "/usr/local/lib/python2.7/dist-packages/mETL-1.0.1dev-py2.7.egg/metl/script.py", line 101, in main      source_resource = options.source    File "/usr/local/lib/python2.7/dist-packages/mETL-1.0.1dev-py2.7.egg/metl/configparser.py", line 61, in init      self.init ()    File "/usr/local/lib/python2.7/dist-packages/mETL-1.0.1dev-py2.7.egg/metl/configparser.py", line 65, in init      self.loadSource ()    File "/usr/local/lib/python2.7/dist-packages/mETL-1.0.1dev-py2.7.egg/metl/configparser.py", line 155, in loadSource      self.readers = [self.loadSourceObject (self.config.get ('source'), base = True)]    File "/usr/local/lib/python2.7/dist-packages/mETL-1.0.1dev-py2.7.egg/metl/configparser.py", line 191, in loadSourceObject      transforms = self.loadTransforms (fcfg.get ('transforms', []))    File "/usr/local/lib/python2.7/dist-packages/mETL-1.0.1dev-py2.7.egg/metl/configparser.py", line 319, in loadTransforms      transforms.append (self.getObject (ttype, transform_config))    File "/usr/local/lib/python2.7/dist-packages/mETL-1.0.1dev-py2.7.egg/metl/configparser.py", line 214, in getObject      obj = self.lookupClass (transformConfig [transformType.lower ()], transformType)    File "/usr/local/lib/python2.7/dist-packages/mETL-1.0.1dev-py2.7.egg/metl/configparser.py", line 90, in lookupClass      'Not found class:% s or% s'% (inner_path, name) metl.exception.ClassNotFoundException: Not found class: metl.transform.formatphonenumbertransform.formatPhoneNumberTransform or formatPhoneNumber

bfaludi commented 10 years ago

Did you check the run.sh file for the correct command? In that example you need to execute like this:

metl -p . [config.yaml]

-p parameter will add the given route to the path. This is necessary when you write your own scripts that are not installed packages.

ramonrxven commented 10 years ago

i tried using -p parameter like the example in the run.sh, but throw the same error.

bfaludi commented 10 years ago

The 18th example requires the phonenumbers package.

Please execute the following command:

python material/__init__.py

If you get an exception like this,

Traceback (most recent call last):
  File "material/__init__.py", line 2, in <module>
    import phonenumbers
ImportError: No module named phonenumbers

please install the package.

easy_install phonenumbers

After that it have to work.

(If you use the mETL's -d paramter you can get the same exception, but be careful because it will be multiple exceptions and hard to find)