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

"ImportError No module named pathlib" on startup #287

Closed
still-dreaming-1 opened this issue Jul 10, 2018 · 7 comments
Closed

"ImportError No module named pathlib" on startup #287

still-dreaming-1 opened this issue Jul 10, 2018 · 7 comments
Assignees
Labels

Comments

@still-dreaming-1
Copy link

still-dreaming-1 commented Jul 10, 2018

I just did a fresh install of vint via pip install vim-vint. Then when I run vint:

Traceback (most recent call last):
File "/home/jesse/.local/bin/vint", line 7, in
from vint import main
File "/home/jesse/.local/lib/python2.7/site-packages/vint/init.py", line 1, in
from vint.bootstrap import (
File "/home/jesse/.local/lib/python2.7/site-packages/vint/bootstrap.py", line 3, in
from pathlib import Path
ImportError: No module named pathlib

Here is my .vintrc.yaml:

cmdargs:
    env:
        neovim: true
policies:
    # Disable a violation
    ProhibitImplicitScopeVariable:
        enabled: false

I also tried it with only the neovim:true setting, with a blank settings file, and I even tried deleting the settings file, but I get the same output on running vint.

I'm on Ubuntu 16.04 LTS. Additional system info:

▷ which python
/usr/bin/python
▷ python --version
Python 2.7.12
▷ which pip
/usr/bin/pip
▷ pip --version
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)

@Kuniwak Kuniwak self-assigned this Jul 11, 2018
@Kuniwak Kuniwak added the bug label Jul 11, 2018
@Kuniwak
Copy link
Member

Kuniwak commented Jul 11, 2018

Thank you for reporting.

I'm gonna try to reproduce it later. Until then, I think you can fix ad hoc it by installing pathlib manually:

$ pip install pathlib

@still-dreaming-1
Copy link
Author

Ok, I did that, and then:

▷ vint
Traceback (most recent call last):
File "/home/jesse/.local/bin/vint", line 7, in
from vint import main
File "/home/jesse/.local/lib/python2.7/site-packages/vint/init.py", line 1, in
from vint.bootstrap import (
File "/home/jesse/.local/lib/python2.7/site-packages/vint/bootstrap.py", line 5, in
from vint.linting.cli import CLI
File "/home/jesse/.local/lib/python2.7/site-packages/vint/linting/cli.py", line 7, in
from vint.linting.linter import Linter
File "/home/jesse/.local/lib/python2.7/site-packages/vint/linting/linter.py", line 5, in
from vint.encodings.decoder import EncodingDetectionError
File "/home/jesse/.local/lib/python2.7/site-packages/vint/encodings/decoder.py", line 2, in
from typing import Dict, Any
ImportError: No module named typing
▷ pip install typing
Collecting typing
Downloading https://files.pythonhosted.org/packages/0d/4d/4e5985d075d241d686a1663fa1f88b61d544658d08c1375c7c6aac32afc3/typing-3.6.4-py2-none-any.whl
Installing collected packages: typing
Successfully installed typing-3.6.4
You are using pip version 8.1.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
▷ vint
Traceback (most recent call last):
File "/home/jesse/.local/bin/vint", line 7, in
from vint import main
File "/home/jesse/.local/lib/python2.7/site-packages/vint/init.py", line 1, in
from vint.bootstrap import (
File "/home/jesse/.local/lib/python2.7/site-packages/vint/bootstrap.py", line 5, in
from vint.linting.cli import CLI
File "/home/jesse/.local/lib/python2.7/site-packages/vint/linting/cli.py", line 7, in
from vint.linting.linter import Linter
File "/home/jesse/.local/lib/python2.7/site-packages/vint/linting/linter.py", line 6, in
from vint.ast.parsing import Parser
File "/home/jesse/.local/lib/python2.7/site-packages/vint/ast/parsing.py", line 3, in
from vint.ast.traversing import traverse
File "/home/jesse/.local/lib/python2.7/site-packages/vint/ast/traversing.py", line 1, in
from vint.ast.node_type import NodeType
File "/home/jesse/.local/lib/python2.7/site-packages/vint/ast/node_type.py", line 1, in
from enum import Enum, unique
ImportError: No module named enum
▷ pip install enum
Collecting enum
Downloading https://files.pythonhosted.org/packages/0c/4e/1ea357e7783c756bb579333c1e4a026fb331371ee771f616ffedc781e531/enum-0.4.6.tar.gz
Collecting setuptools (from enum)
Downloading https://files.pythonhosted.org/packages/ff/f4/385715ccc461885f3cedf57a41ae3c12b5fec3f35cce4c8706b1a112a133/setuptools-40.0.0-py2.py3-none-any.whl (567kB)
100% |████████████████████████████████| 573kB 1.2MB/s
Building wheels for collected packages: enum
Running setup.py bdist_wheel for enum ... done
Stored in directory: /home/jesse/.cache/pip/wheels/6f/9d/fd/2ea23d9caa34a53df8c60be2e9ccc6d0db3877b8b09b01340c
Successfully built enum
Installing collected packages: setuptools, enum
Successfully installed enum-0.4.6 setuptools-40.0.0
You are using pip version 8.1.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
▷ vint
Traceback (most recent call last):
File "/home/jesse/.local/bin/vint", line 7, in
from vint import main
File "/home/jesse/.local/lib/python2.7/site-packages/vint/init.py", line 1, in
from vint.bootstrap import (
File "/home/jesse/.local/lib/python2.7/site-packages/vint/bootstrap.py", line 5, in
from vint.linting.cli import CLI
File "/home/jesse/.local/lib/python2.7/site-packages/vint/linting/cli.py", line 7, in
from vint.linting.linter import Linter
File "/home/jesse/.local/lib/python2.7/site-packages/vint/linting/linter.py", line 6, in
from vint.ast.parsing import Parser
File "/home/jesse/.local/lib/python2.7/site-packages/vint/ast/parsing.py", line 3, in
from vint.ast.traversing import traverse
File "/home/jesse/.local/lib/python2.7/site-packages/vint/ast/traversing.py", line 1, in
from vint.ast.node_type import NodeType
File "/home/jesse/.local/lib/python2.7/site-packages/vint/ast/node_type.py", line 1, in
from enum import Enum, unique
ImportError: cannot import name unique
▷ pip install unique
Collecting unique
Downloading https://files.pythonhosted.org/packages/f9/3c/4be066cc1d3fdd3bee965645e00e7d4e8dcdaa0b066610e2da360b09cdb0/unique-0.1.tar.gz
Collecting richenum>=1.0.0 (from unique)
Downloading https://files.pythonhosted.org/packages/51/6f/bde74324820aa14f8e1e6939500ab55fd7426d53465396d5a0b4cd7a571e/richenum-1.2.1.tar.gz
Collecting normalize>=0.7.4 (from unique)
Downloading https://files.pythonhosted.org/packages/d6/a2/3055e120d2b7d4ec57216cf079454f84f60b52442572f2a4f2b7f6a00c67/normalize-1.0.4.tar.gz (56kB)
100% |████████████████████████████████| 61kB 118kB/s
Collecting GitPython>=0.3.6 (from unique)
Downloading https://files.pythonhosted.org/packages/ac/c9/96d7c86c623cb065976e58c0f4898170507724d6b4be872891d763d686f4/GitPython-2.1.10-py2.py3-none-any.whl (449kB)
100% |████████████████████████████████| 450kB 1.2MB/s
Collecting six (from richenum>=1.0.0->unique)
Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting gitdb2>=2.0.0 (from GitPython>=0.3.6->unique)
Downloading https://files.pythonhosted.org/packages/e0/95/c772c13b7c5740ec1a0924250e6defbf5dfdaee76a50d1c47f9c51f1cabb/gitdb2-2.0.3-py2.py3-none-any.whl (63kB)
100% |████████████████████████████████| 71kB 2.9MB/s
Collecting smmap2>=2.0.0 (from gitdb2>=2.0.0->GitPython>=0.3.6->unique)
Downloading https://files.pythonhosted.org/packages/e3/59/4e22f692e65f5f9271252a8e63f04ce4ad561d4e06192478ee48dfac9611/smmap2-2.0.3-py2.py3-none-any.whl
Building wheels for collected packages: unique, richenum, normalize
Running setup.py bdist_wheel for unique ... done
Stored in directory: /home/jesse/.cache/pip/wheels/11/48/d9/afa536fb84c60ec199b27cd5e3a62fb123872c64a76c0d4f02
Running setup.py bdist_wheel for richenum ... done
Stored in directory: /home/jesse/.cache/pip/wheels/7d/5e/11/55cd15d95d7a38da0c271995bd107e192a8ef7c356707c1f01
Running setup.py bdist_wheel for normalize ... done
Stored in directory: /home/jesse/.cache/pip/wheels/ed/26/a8/2177e0a1f0c59a8775fd97050d418859774442a7de3783fd57
Successfully built unique richenum normalize
Installing collected packages: six, richenum, normalize, smmap2, gitdb2, GitPython, unique
Successfully installed GitPython-2.1.10 gitdb2-2.0.3 normalize-1.0.4 richenum-1.2.1 six-1.11.0 smmap2-2.0.3 unique-0.1
You are using pip version 8.1.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
▷ vint
Traceback (most recent call last):
File "/home/jesse/.local/bin/vint", line 7, in
from vint import main
File "/home/jesse/.local/lib/python2.7/site-packages/vint/init.py", line 1, in
from vint.bootstrap import (
File "/home/jesse/.local/lib/python2.7/site-packages/vint/bootstrap.py", line 5, in
from vint.linting.cli import CLI
File "/home/jesse/.local/lib/python2.7/site-packages/vint/linting/cli.py", line 7, in
from vint.linting.linter import Linter
File "/home/jesse/.local/lib/python2.7/site-packages/vint/linting/linter.py", line 6, in
from vint.ast.parsing import Parser
File "/home/jesse/.local/lib/python2.7/site-packages/vint/ast/parsing.py", line 3, in
from vint.ast.traversing import traverse
File "/home/jesse/.local/lib/python2.7/site-packages/vint/ast/traversing.py", line 1, in
from vint.ast.node_type import NodeType
File "/home/jesse/.local/lib/python2.7/site-packages/vint/ast/node_type.py", line 1, in
from enum import Enum, unique
ImportError: cannot import name unique

The final result being that it cannot import name unique, even after I pip installed unique.

@Kuniwak
Copy link
Member

Kuniwak commented Jul 12, 2018

▷ pip install enum

@still-dreaming-1 I think you should install enum34 instead of enum. Could you try the following command?

$ pip install enum34

@still-dreaming-1
Copy link
Author

That worked, thanks!

@blueyed
Copy link
Member

blueyed commented Jul 12, 2018

JFI: seeing this on Travis myself: https://travis-ci.org/blueyed/vim-qf_resize/jobs/403314506#L474

Not important currently for me, but might help to find out what is happening.

@wsdjeg
Copy link

wsdjeg commented Jul 13, 2018

I still get this issue:

https://travis-ci.org/SpaceVim/SpaceVim/jobs/403536165

@blueyed
Copy link
Member

blueyed commented Jul 15, 2018

The problem is that a wheel gets used, but the requirements in setup.py are dynamic.

blueyed added a commit to blueyed/vint that referenced this issue Jul 15, 2018
blueyed added a commit to blueyed/vint that referenced this issue Jul 15, 2018
blueyed added a commit to blueyed/vim-qf_resize that referenced this issue Jul 15, 2018
blueyed added a commit to blueyed/vim-qf_resize that referenced this issue Jul 15, 2018
blueyed added a commit to blueyed/vim-qf_resize that referenced this issue Jul 15, 2018
blueyed added a commit to blueyed/vim-qf_resize that referenced this issue Jul 15, 2018
blueyed added a commit to blueyed/vim-qf_resize that referenced this issue Jul 15, 2018
blueyed added a commit to blueyed/vim-qf_resize that referenced this issue Jul 15, 2018
blueyed added a commit to blueyed/vim-qf_resize that referenced this issue Jul 15, 2018
fatih added a commit to fatih/vim-go that referenced this issue Jul 17, 2018
blueyed added a commit to JelteF/vim-python-pep8-indent that referenced this issue Jul 26, 2018
It is always failing, not worth fixing for now.

Ref: Vimjas/vint#288
Ref: Vimjas/vint#287
kevinoid added a commit to kevinoid/syntastic-use-node-bin that referenced this issue Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants