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

[windows] VisiData must be run using WSL #2172

Closed
wcheek opened this issue Dec 14, 2023 · 10 comments
Closed

[windows] VisiData must be run using WSL #2172

wcheek opened this issue Dec 14, 2023 · 10 comments

Comments

@wcheek
Copy link

wcheek commented Dec 14, 2023

Small description
visidata doesn't work. I'm running Windows 10 Pro Version 10.0.19045 Build 19045. I'm on a Japanese laptop, so maybe encoding is throwing things off.

Expected result
visidata <file> would open a file.

Actual result with screenshot
When I try to run eg visidata faa-wildlife-strikes.csv, it hangs for a moment and then returns me to the command prompt without displaying anything:

D:\Projects\RiceMiller\RawData>visidata faa-wildlife-strikes.csv

D:\Projects\RiceMiller\RawData>

When I run visidata -h I get a UnicodeDecodeError:

D:\Projects\RiceMiller\RawData>visidata -h
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\xxx\AppData\Roaming\Python\Python312\Scripts\visidata.exe\__main__.py", line 7, in <module>
  File "C:\Users\xxx\AppData\Roaming\Python\Python312\site-packages\visidata\main.py", line 395, in vd_cli
    rc = main_vd()
         ^^^^^^^^^
  File "C:\Users\xxx\AppData\Roaming\Python\Python312\site-packages\visidata\main.py", line 116, in main_vd
    print(fp.read())
          ^^^^^^^^^
UnicodeDecodeError: 'cp932' codec can't decode byte 0x94 in position 101: illegal multibyte sequence

Steps to reproduce with sample data and a .vd
When I run

D:\Projects\RiceMiller\RawData>echo "abc" | visidata -f faa-wildlife-strikes.csv -N

D:\Projects\RiceMiller\RawData>

Nothing happens.

Additional context

D:\Projects\RiceMiller\RawData>visidata --version
saul.pw/VisiData v2.11.1

Python 3.12.0

I was able to fix the visidata -h UnicodeDecodeError by explicitly specifying encoding="utf-8" in line 113 of main.py, but so far unable to figure out how to actually get files opening.

@wcheek wcheek added the bug label Dec 14, 2023
@saulpw
Copy link
Owner

saulpw commented Dec 14, 2023

Hey @wcheek, what happens if you use vd instead of visidata? Also does it work on the develop branch?

@wcheek
Copy link
Author

wcheek commented Dec 14, 2023

vd isn't a recognized command even though I have a vd file in site-packages in the same place that I have the visidata.exe file that is currently failing. I'll check the develop branch.

@wcheek
Copy link
Author

wcheek commented Dec 14, 2023

I get a few more notifications at least but the file still doesn't open and vd is still not working. However, visidata -h works now.

D:\Projects\RiceMiller\RawData>visidata --version
saul.pw/VisiData v3.0dev

D:\Projects\RiceMiller\RawData>visidata faa-wildlife-strikes.csv
saul.pw/VisiData v3.0dev
opening faa-wildlife-strikes.csv as csv

D:\Projects\RiceMiller\RawData>vd faa-wildlife-strikes.csv
'vd' is not recognized as an internal or external command,
operable program or batch file.

@saulpw
Copy link
Owner

saulpw commented Dec 14, 2023

Try running with --debug, does that show anything for you?

@wcheek
Copy link
Author

wcheek commented Dec 15, 2023

@saulpw same behavior with a small stack trace?

D:\Projects\RiceMiller\RawData>visidata --debug faa-wildlife-strikes.csv
saul.pw/VisiData v3.0dev
opening faa-wildlife-strikes.csv as csv [visidata\_open.py:137:openPath]

D:\Projects\RiceMiller\RawData>

In openSource(), vd.openPath() is getting called:

        else:
            print("Here!")
            vs = vd.openPath(
                Path(p), filetype=filetype, create=create
            )  # convert to Path and recurse

openSource() returns vs = "faa_wildlife-strikes" and then the only place I see openSource() getting referenced is in these BaseSheet and TableSheet. Interestingly, the only one that seems to actually be present in the visidata module is BaseSheet:

image

image

@saulpw
Copy link
Owner

saulpw commented Dec 19, 2023

How did you install VisiData, @wcheek? You said you're running on Windows, is this with WSL?

@wcheek
Copy link
Author

wcheek commented Dec 19, 2023

I installed it using the recommended way: pip3 install visidata.

I have WSL installed, but I am running visidata with the Windows shell. I've tried it on both wezterm and powershell to no avail.

@saulpw
Copy link
Owner

saulpw commented Dec 19, 2023

Try installing it inside WSL and running it there. Or, you could try installing from the unreleased develop branch. v2.11.1 definitely works for other users under WSL.

@saulpw saulpw changed the title Nothing happens when I try to open a file [windows] nothing happens Dec 19, 2023
@wcheek
Copy link
Author

wcheek commented Dec 20, 2023

@saulpw confirmed v2.11.1 works in WSL.

No offense, but it seems like a serious problem if it's not working on Windows, even the v.3.0dev version. Let me know if you need more information from my system.

@saulpw
Copy link
Owner

saulpw commented Dec 20, 2023

None of us on the dev team use Windows, so I don't believe it's ever worked on Windows outside of WSL. I think the correct fix here is to remove any hint from https://visidata.org/install that it might work without WSL.

If anyone is interested in getting VisiData to work on Windows apart from WSL, please get in touch!

@saulpw saulpw closed this as completed Dec 20, 2023
@saulpw saulpw changed the title [windows] nothing happens [windows] VisiData must be run using WSL Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants