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

ModuleNotFoundError: No module named 'validate' #324

Closed
carlphilipp opened this issue Dec 21, 2020 · 24 comments
Closed

ModuleNotFoundError: No module named 'validate' #324

carlphilipp opened this issue Dec 21, 2020 · 24 comments
Labels
bug Something isn't working

Comments

@carlphilipp
Copy link

Hi I'm getting this:

λ  ~  terminator                                                                                                                                                                                                                                                                                                                                                        1   10:56:06  
Traceback (most recent call last):
  File "/usr/sbin/terminator", line 48, in <module>
    import terminatorlib.optionparse
  File "/usr/lib/python3.9/site-packages/terminatorlib/optionparse.py", line 24, in <module>
    from . import config
  File "/usr/lib/python3.9/site-packages/terminatorlib/config.py", line 76, in <module>
    from validate import Validator
ModuleNotFoundError: No module named 'validate'

Here is my version of python:

Python 3.9.1

Also when I try to install the validate module:

 λ  ~  pip install validate                                                                                                                                                                                                                                                                                                                                                  10:59:39  
Defaulting to user installation because normal site-packages is not writeable
Collecting validate
  Using cached validate-1.0.1.tar.gz (32 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0tvxkv2x/validate/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0tvxkv2x/validate/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-6pyjqa9s
         cwd: /tmp/pip-install-0tvxkv2x/validate/
    Complete output (8 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-0tvxkv2x/validate/setup.py", line 13, in <module>
        from configobj import __version__ as VERSION
      File "/tmp/pip-install-0tvxkv2x/validate/configobj.py", line 1632
        except Exception, e:
                        ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

It looks like it's Python 3.9.1 not compatible?

@mattrose
Copy link
Member

Looks like it. I'll look at this.

@janhrastnik
Copy link

I got this error on arch after upgrading python-configobj to 5.0.6-10. Downgrading to 5.0.6-9 fixed this for me.

@inetAnt
Copy link

inetAnt commented Dec 21, 2020

I got this error on arch after upgrading python-configobj to 5.0.6-10. Downgrading to 5.0.6-9 fixed this for me.

Fixed it for me as well, looks related to DiffSK/configobj@0cfca0c#diff-fb6fb820a0e6b474958f753024dc23dbc01d133a698a64593106f166234030f2

I believe this would fix the underlying issue (but no new official release of configobj has been made yet).

@carlphilipp
Copy link
Author

Thanks @janhrastnik downgrading python-configobj worked!

@inetAnt
Copy link

inetAnt commented Dec 21, 2020

Tips if you don't want your Arch to upgrade again:

+++ /etc/pacman.conf	2020-12-21 19:10:34.503448528 +0100
@@ -22,7 +22,7 @@
 Architecture = auto
 
 # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
-#IgnorePkg   =
+IgnorePkg   = python-configobj
 #IgnoreGroup =
 
 #NoUpgrade   =

@ghost
Copy link

ghost commented Dec 21, 2020

I manually edited the import with the line from the merge request and it fixed it on my system (Archlinux)

@mabod
Copy link

mabod commented Dec 21, 2020

I manually edited the import with the line from the merge request and it fixed it on my system (Archlinux)

That works for me too!
But it is incompatible now with python-configobj 5.0.6-9

@dpertierra
Copy link

dpertierra commented Dec 22, 2020

image

I found a library called validator
I changed line 77 from this file /usr/lib/python3.9/site-packages/terminatorlib/config.py
from this "from validate import Validator" to "from validator import Validator"

image

And it opened fine
image

Tried changing it to "from configobj.validate import Validator" and it also works

@mattrose
Copy link
Member

validator is a completely separate library, and does not have the functionality we are looking for. It loads, but it doesn't necessarily do what we want it to.

@EricksonDouglas
Copy link

sudo nano /usr/lib/python3.9/site-packages/terminatorlib/config.py
from:
from validate import Validator
To:
from validator import Validator

@telius
Copy link

telius commented Dec 22, 2020

Changing line 77 to "from validator import Validator" did not fix it for me.
Changing it to "from configobj.validate import Validator" did.

@mattrose mattrose added the bug Something isn't working label Dec 22, 2020
@julienfalque
Copy link

On Arch Linux, the terminator package has been upgraded from 1.92-3 to 2.0.1-1. This fixed the issue for me.

@Sarchis
Copy link

Sarchis commented Dec 23, 2020

I got this error on arch after upgrading python-configobj to 5.0.6-10. Downgrading to 5.0.6-9 fixed this for me.

Thanks @janhrastnik, it worked perfectly

@ThorstenBuss
Copy link

On Arch Linux, the terminator package has been upgraded from 1.92-3 to 2.0.1-1. This fixed the issue for me.

It works on Arch Linux now cause they include the changes of #325 in there package. The unchanged release 2.0.1 would not work.

@mattrose
Copy link
Member

Given that Arch is the only distro that has reported this problem, and it was fixed in the arch package, I'm tempted to close this.

@mattrose
Copy link
Member

Closing. Please re-open if this occurs somewhere other than arch.

@venteto
Copy link

venteto commented Dec 30, 2020

This error just started happening today in Manjaro after this afternoon's round of updates.

@mattrose
Copy link
Member

For the purpose of this bug, Manjaro == Arch, Make sure you're not running python-configobj 5.0.6-10, there's a bug in it and it's been superseded by 5.0.6.r110.g3e2f4cc-1 see #325 (comment) for details

@ardydavari
Copy link

I have the same problem on manjaro. Terminator version is 1.92-3

@EKami
Copy link

EKami commented Dec 31, 2020

sudo nano /usr/lib/python3.9/site-packages/terminatorlib/config.py
from:
from validate import Validator
To:
from validator import Validator

This solution works, just don't forget to pip3.9 install validator

EDIT: Actually it doesn't, terminator doesn't read the config file anymore with that solution. Use @telius solution instead:

Changing line 77 to "from validator import Validator" did not fix it for me.
Changing it to "from configobj.validate import Validator" did.

@stevexyz
Copy link

I had the problem yesterday evening after full Manjaro upgrade.
Today terminator was updated to 2.0.1-1 and with another sudo pacman -Syu the error was gone.
I would say ok also on Manjaro now.

@EKami
Copy link

EKami commented Dec 31, 2020

I had the problem yesterday evening after full Manjaro upgrade.
Today terminator was updated to 2.0.1-1 and with another sudo pacman -Syu the error was gone.
I would say ok also on Manjaro now.

Indeed, it's very recent then, I didn't have this update a few min ago, and it only contains the new version of terminator aha

@Larkinnjm1
Copy link

Larkinnjm1 commented Aug 31, 2021

This issue stilll apears to present in the latest version using a typical pip install on Mac OS using python 3.7 to a virtual environment.

A quick workaround is just to use:
from validate import Validator however is the correct way to use this package?

@mattrose
Copy link
Member

That line is what it is in the code:

from validate import Validator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.