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

Python Script TypeError: expected string or bytes-like object #410

Closed
different-name opened this issue Mar 5, 2022 · 4 comments
Closed

Comments

@different-name
Copy link

different-name commented Mar 5, 2022

When running kcc-c2e.exe installed with pip, the following error occurs

Traceback (most recent call last): File "C:\Users\harve\AppData\Roaming\Python\Python39\Scripts\kcc-c2e-script.py", line 33, in <module> sys.exit(load_entry_point('KindleComicConverter==5.5.2', 'console_scripts', 'kcc-c2e')()) File "C:\Users\harve\AppData\Roaming\Python\Python39\site-packages\kindlecomicconverter\startup.py", line 46, in startC2E dependencyCheck(2) File "C:\Users\harve\AppData\Roaming\Python\Python39\site-packages\kindlecomicconverter\shared.py", line 121, in dependencyCheck if StrictVersion('1.2.1') > StrictVersion(slugifyVersion): File "C:\Users\harve\AppData\Local\Programs\Python\Python39\lib\distutils\version.py", line 40, in __init__ self.parse(vstring) File "C:\Users\harve\AppData\Local\Programs\Python\Python39\lib\distutils\version.py", line 135, in parse match = self.version_re.match(vstring) TypeError: expected string or bytes-like object

Any tips?
Windows 11
Python 3.9.9
pip 21.2.4

@darodi
Copy link
Collaborator

darodi commented Mar 5, 2022

the problem seems related to your slugify version.
try that in the python command line, what is the result?

from slugify import __version__ as slugifyVersion
print(slugifyVersion)
from distutils.version import StrictVersion
print(StrictVersion(slugifyVersion))

@different-name
Copy link
Author

@darodi

>>> from slugify import __version__ as slugifyVersion
>>> print(slugifyVersion)
<module 'slugify.__version__' from 'C:\\Users\\harve\\AppData\\Roaming\\Python\\Python39\\site-packages\\slugify\\__version__.py'>
>>> from distutils.version import StrictVersion
>>> print(StrictVersion(slugifyVersion))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\harve\AppData\Local\Programs\Python\Python39\lib\distutils\version.py", line 40, in __init__
    self.parse(vstring)
  File "C:\Users\harve\AppData\Local\Programs\Python\Python39\lib\distutils\version.py", line 135, in parse
    match = self.version_re.match(vstring)
TypeError: expected string or bytes-like object

@darodi
Copy link
Collaborator

darodi commented Mar 6, 2022

you should have a result like that:

>>> from slugify import __version__ as slugifyVersion
>>> print(slugifyVersion)
2.0.1

try reinstalling slugify

pip install "python-slugify>=1.2.1,<3.0.0"
then
pip install --user KindleComicConverter

or even better:

download https://raw.githubusercontent.com/ciromattia/kcc/master/requirements.txt

pip install -r requirements.txt
pip install --user KindleComicConverter

@different-name
Copy link
Author

That worked, thanks - missed the version in the dependencies

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