cldf / csvw

CSV on the web
Apache License 2.0
37 stars 6 forks source link

Installation Errors with csvw2json and csvwvalidate #75

Closed megin1989 closed 4 months ago

megin1989 commented 4 months ago

When we attempt to run these commands in the command line, we encounter the following errors:

`╰─ $ csvw2json datapackage.json Command 'csvw2json' not found, did you mean: command 'csv2json' from deb node-d3-dsv (1.1.1-5) Try: sudo apt install

…  WSL  megin  ~  …  csv-sql-schema  csv-old  csvw    299ms   13:25:11  ╰─ $ csvwvalidate datapackage.json csvwvalidate: command not found

…  WSL  megin  ~  …  csv-sql-schema  csv-old  csvw    397ms   13:25:44  ╰─ $ sudo apt install csvw2json [sudo] password for megin: Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package csvw2json

…  WSL  megin  ~  …  csv-sql-schema  csv-old  csvw    4.672s   13:26:38  ╰─ $ which csvw2json

…  WSL  megin  ~  …  csv-sql-schema  csv-old  csvw    0ms   13:27:02  ╰─ $ `

xrotwang commented 4 months ago

Hm. csvw2json is supposed to be installed when the csvw package is installed, see https://github.com/cldf/csvw/blob/90ac48577a659cc435a5bd442a907781317f7547/setup.cfg#L59-L64 How did you install csvw?

megin1989 commented 4 months ago

By using this command - pip install csvw

xrotwang commented 4 months ago

Cannot confirm. Here's what happens when I install csvw in a fresh virtual environment (on Ubuntu):

$ pip install csvw
...
$ which csvw2json
/home/robert/venvs/testcsvw/bin/csvw2json
LinguList commented 4 months ago

I can confirm for a fresh venv with a windows operation system, after having run python -m pip install csvw that csvw2json is also installed / available.

chrzyki commented 4 months ago

Just speculating here but the problem might be the Windows Subsystem for Linux you appear to be running. Maybe the entry points are ill-defined for WSL after the package is installed? Can you call the entry points manually with something like python -m?

/Edit: And, another thought. Maybe the $PATH isn't updated/refreshed during installation and requires a reload of the WSL/environment to recognize the commands?

megin1989 commented 4 months ago

Checked in Linux system got the same error

sudo apt install csv2json Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package csv2json

Python version is 3.10.12

chrzyki commented 4 months ago

Checked in Linux system got the same error

sudo apt install csv2josn [sudo] password for megin: Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package csv2josn

Python version is 3.10.12

$ python --version
Python 3.12.4
$ python -m venv venv
$ source venv/bin/activate
$ pip install csvw
$ which csvw2json 
/home/chrzyki/venv/bin/csvw2json
$ csvw2json
usage: csvw2json [-h] url
csvw2json: error: the following arguments are required: url
megin1989 commented 4 months ago

Thank you. It is working now. I received the message 'FAIL'.

Should we print the error details here?

xrotwang commented 4 months ago

Should we print the error details here?

What command were you running?

megin1989 commented 4 months ago

Should we print the validation error details, such as 'The required datatype of this field is Integer,' here?

xrotwang commented 4 months ago

Should we print the validation error details, such as 'The required datatype of this field is Integer,' here?

This was the issue about installation problems - and as far as I can tell, these have been sorted out. So I'd rather close this issue.