Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'cow_csvw.converter' has no attribute 'csvw' #120

Open
matiasf opened this issue Oct 21, 2021 · 2 comments
Open

AttributeError: module 'cow_csvw.converter' has no attribute 'csvw' #120

matiasf opened this issue Oct 21, 2021 · 2 comments

Comments

@matiasf
Copy link

matiasf commented Oct 21, 2021

Hi COW team!

I have been trying to execute the CLI on a file to transform a CSV to Turtle but I couldn't install it properly following the instruction on the page. Also digging the repository found this quick tutorial https://github.com/clariah/cow_tutorial but have the same results. I think I need some dependency I'm missing but can't understand wich one.

This is the stacktrace:

Traceback (most recent call last):
  File "/home/vector/.local/lib/python3.6/site-packages/cow_csvw/csvw_tool.py", line 5, in <module>
    from converter.csvw import CSVWConverter, build_schema, extensions
ModuleNotFoundError: No module named 'converter'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vector/.local/lib/python3.6/site-packages/cow_csvw/converter/util/__init__.py", line 5, in <module>
    import converter.csvw as csvw
ModuleNotFoundError: No module named 'converter'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vector/.local/bin/cow_tool", line 7, in <module>
    from cow_csvw.csvw_tool import main
  File "/home/vector/.local/lib/python3.6/site-packages/cow_csvw/csvw_tool.py", line 8, in <module>
    from cow_csvw.converter.csvw import CSVWConverter, build_schema, extensions
  File "/home/vector/.local/lib/python3.6/site-packages/cow_csvw/converter/csvw.py", line 15, in <module>
    from .util import patch_namespaces_to_disk, process_namespaces, get_namespaces, Nanopublication, validateTerm, parse_value, CSVW, PROV, DC, SKOS, RDF
  File "/home/vector/.local/lib/python3.6/site-packages/cow_csvw/converter/util/__init__.py", line 8, in <module>
    import cow_csvw.converter.csvw as csvw
AttributeError: module 'cow_csvw.converter' has no attribute 'csvw'

I try also installing this one pip3 install converter, but is installed on a python 2 version and doesn't work, probably isn't the correct one.

Any help will be appreciated :)

@rlzijdeman
Copy link
Member

hi Matthias,

sorry for the CoW moohing at you.

Just to make sure:

  • you yourself have python 3?
  • you ran pip3 install cow-csvw?
  • next you ran cow_tool --version and that did not provide you 1.0.2?

I'm not sure if I understand you correctly, but indeed CoW ceased to work under Python 2.

@matiasf
Copy link
Author

matiasf commented Oct 21, 2021

Hi Richard, thanks for your quick response.

Checking your recommended list I have this results:

"you yourself have python 3?"
It, is installed

➜  cow_tutorial git:(main) python3 -h  
usage: python3 [option] ... [-c cmd | -m mod | file | -] [arg] ...

"you ran pip3 install cow-csvw?"
I run it, here the installation log:

➜  cow_tutorial git:(main) pip3 install cow-csvw
Collecting cow-csvw
Collecting tzlocal==1.5.1 (from cow-csvw)
Collecting rfc3987==1.3.8 (from cow-csvw)
  Using cached https://files.pythonhosted.org/packages/65/d4/f7407c3d15d5ac779c3dd34fbbc6ea2090f77bd7dd12f207ccf881551208/rfc3987-1.3.8-py2.py3-none-any.whl
Collecting iribaker==0.2 (from cow-csvw)
Collecting isodate==0.6.0 (from cow-csvw)
  Using cached https://files.pythonhosted.org/packages/9b/9f/b36f7774ff5ea8e428fdcfc4bb332c39ee5b9362ddd3d40d9516a55221b2/isodate-0.6.0-py2.py3-none-any.whl
Collecting unicodecsv==0.14.1 (from cow-csvw)
Collecting Js2Py==0.66 (from cow-csvw)
Collecting PyYAML==5.1.1 (from cow-csvw)
Collecting pytz==2019.1 (from cow-csvw)
  Using cached https://files.pythonhosted.org/packages/3d/73/fe30c2daaaa0713420d0382b16fbb761409f532c56bdcc514bf7b6262bb6/pytz-2019.1-py2.py3-none-any.whl
Collecting rdflib==4.2.2 (from cow-csvw)
  Using cached https://files.pythonhosted.org/packages/3c/fe/630bacb652680f6d481b9febbb3e2c3869194a1a5fc3401a4a41195a2f8f/rdflib-4.2.2-py3-none-any.whl
Collecting rdflib-jsonld==0.4.0 (from cow-csvw)
Collecting Jinja2==2.10.1 (from cow-csvw)
  Using cached https://files.pythonhosted.org/packages/1d/e7/fd8b501e7a6dfe492a433deb7b9d833d39ca74916fa8bc63dd1a4947a671/Jinja2-2.10.1-py2.py3-none-any.whl
Collecting pyjsparser==2.7.1 (from cow-csvw)
Collecting chardet==3.0.4 (from cow-csvw)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting Werkzeug>=0.14.1 (from cow-csvw)
  Using cached https://files.pythonhosted.org/packages/1e/73/51137805d1b8d97367a8a77cae4a792af14bb7ce58fbd071af294c740cf0/Werkzeug-2.0.2-py3-none-any.whl
Collecting six (from isodate==0.6.0->cow-csvw)
  Using cached https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl
Collecting pyparsing (from rdflib==4.2.2->cow-csvw)
  Using cached https://files.pythonhosted.org/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from Jinja2==2.10.1->cow-csvw)
  Using cached https://files.pythonhosted.org/packages/fc/d6/57f9a97e56447a1e340f8574836d3b636e2c14de304943836bd645fa9c7e/MarkupSafe-2.0.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting dataclasses; python_version < "3.7" (from Werkzeug>=0.14.1->cow-csvw)
  Using cached https://files.pythonhosted.org/packages/fe/ca/75fac5856ab5cfa51bbbcefa250182e50441074fdc3f803f6e76451fab43/dataclasses-0.8-py3-none-any.whl
Installing collected packages: pytz, tzlocal, rfc3987, iribaker, six, isodate, unicodecsv, pyjsparser, Js2Py, PyYAML, pyparsing, rdflib, rdflib-jsonld, MarkupSafe, Jinja2, chardet, dataclasses, Werkzeug, cow-csvw
Successfully installed Jinja2-2.10.1 Js2Py-0.66 MarkupSafe-2.0.1 PyYAML-5.1.1 Werkzeug-2.0.2 chardet-3.0.4 cow-csvw-1.0.2 dataclasses-0.8 iribaker-0.2 isodate-0.6.0 pyjsparser-2.7.1 pyparsing-2.4.7 pytz-2019.1 rdflib-4.2.2 rdflib-jsonld-0.4.0 rfc3987-1.3.8 six-1.16.0 tzlocal-1.5.1 unicodecsv-0.14.1

"next you ran cow_tool --version and that did not provide you 1.0.2?"
Here I have the same trouble

➜  cow_tutorial git:(main) cow_tool --version                                    
Traceback (most recent call last):
  File "/home/vector/.local/lib/python3.6/site-packages/cow_csvw/csvw_tool.py", line 5, in <module>
    from converter.csvw import CSVWConverter, build_schema, extensions
ModuleNotFoundError: No module named 'converter'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vector/.local/lib/python3.6/site-packages/cow_csvw/converter/util/__init__.py", line 5, in <module>
    import converter.csvw as csvw
ModuleNotFoundError: No module named 'converter'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vector/.local/bin/cow_tool", line 7, in <module>
    from cow_csvw.csvw_tool import main
  File "/home/vector/.local/lib/python3.6/site-packages/cow_csvw/csvw_tool.py", line 8, in <module>
    from cow_csvw.converter.csvw import CSVWConverter, build_schema, extensions
  File "/home/vector/.local/lib/python3.6/site-packages/cow_csvw/converter/csvw.py", line 15, in <module>
    from .util import patch_namespaces_to_disk, process_namespaces, get_namespaces, Nanopublication, validateTerm, parse_value, CSVW, PROV, DC, SKOS, RDF
  File "/home/vector/.local/lib/python3.6/site-packages/cow_csvw/converter/util/__init__.py", line 8, in <module>
    import cow_csvw.converter.csvw as csvw
AttributeError: module 'cow_csvw.converter' has no attribute 'csvw'

All is correctly installed with python3, after seeing this error I thought it was a dependency issue with converter library for the message ModuleNotFoundError: No module named 'converter'

In that moment I run pip3 install converter

➜  cow_tutorial git:(main) pip3 install converter
Collecting converter
Installing collected packages: converter
Successfully installed converter-1.0.0

But this package doesn't work because is old python2 package for the this error:


➜  cow_tutorial git:(main) cow_tool --version    
Traceback (most recent call last):
  File "/home/vector/.local/bin/cow_tool", line 7, in <module>
    from cow_csvw.csvw_tool import main
  File "/home/vector/.local/lib/python3.6/site-packages/cow_csvw/csvw_tool.py", line 5, in <module>
    from converter.csvw import CSVWConverter, build_schema, extensions
  File "/home/vector/.local/lib/python3.6/site-packages/converter.py", line 1
    print " This is the metric converter "
                                         ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(" This is the metric converter ")?

After that I uninstall this converter package, but return to the first error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants