Issue 39430?
I don't have an answer. But this symptom sounds like this Python bug ticket:
Reported in 2020. Unfortunately still unfixed as of 2022.
Workaround for package "csvkit": Try python2
I experienced this issue when trying to use package csvkit
on my Windows 10 running MobaXterm:
Package installs just fine but then the /bin/csv* tools don't run:
$ /bin/python3 -m pip install csvkit --quiet
✔
$ csvstat --version
Traceback (most recent call last):
File "/bin/csvstat", line 5, in <module>
from csvkit.utilities.csvstat import launch_new_instance
File "/usr/lib/python3.6/site-packages/csvkit/utilities/csvstat.py", line 12, in <module>
from csvkit.cli import CSVKitUtility, parse_column_identifiers
File "/usr/lib/python3.6/site-packages/csvkit/cli.py", line 16, in <module>
import lzma
File "/usr/lib/python3.6/lzma.py", line 27, in <module>
from _lzma import *
ModuleNotFoundError: No module named '_lzma'
✘
My workaround was to use python2. Not super happy with that.
First throw out the non-working python3 version like so:
$ /bin/python3 -m pip uninstall csvkit --quiet --yes
✔
$ hash -r
✔
$ csvstat --version
csvstat: command not found
✘
So now it's gone. Let's try again but with python2:
$ /bin/python2 -m pip list | grep -i csv
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
WARNING: You are using pip version 20.3.4; however, version 21.3.1 is available.
You should consider upgrading via the '/bin/python2 -m pip install --upgrade pip' command.
✘
$ /bin/python2 -m pip install csvkit --quiet
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
WARNING: The scripts csvclean, csvcut, csvformat, csvgrep, csvjoin, csvjson, csvlook, csvpy, csvsort, csvsql, csvstack, csvstat, in2csv and sql2csv are installed in '/usr/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: You are using pip version 20.3.4; however, version 21.3.1 is available.
You should consider upgrading via the '/bin/python2 -m pip install --upgrade pip' command.
✔
$ csvstat --version
csvstat 1.0.7
✔
Result: csvkit is installed and /bin/csvstat.exe runs without the "_lzma" error. But unfortunately on python2 and not on python3. -- This workaround is kinda good enough for me, because I just wanted the /bin/csv* utilities but maybe useless for people who actually need to run things on python3.
python my_script.py
– Handoutbrew
history). – Handout