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

ParsingError during pipenv install #613

Closed
remingtonc opened this issue Sep 20, 2017 · 8 comments
Closed

ParsingError during pipenv install #613

remingtonc opened this issue Sep 20, 2017 · 8 comments

Comments

@remingtonc
Copy link

Appears to date back to at least 7.3.1. Set ==7.2.1 which was successful.

[]@[]:~/pathblaster$ pipenv --three install
Creating a virtualenv for this project…
Using /usr/bin/python3 to create virtualenv…
⠋Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/remcampb/.local/share/virtualenvs/pathblaster-cKxdNjbb/bin/python3
Also creating executable in /home/remcampb/.local/share/virtualenvs/pathblaster-cKxdNjbb/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /home/[]/.local/share/virtualenvs/pathblaster-cKxdNjbb
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    load_entry_point('pipenv==7.4.2', 'console_scripts', 'pipenv')()
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 1063, in invoke
    Command.invoke(self, ctx)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/cli.py", line 1423, in cli
    ensure_project(three=three, python=python, warn=True)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/cli.py", line 524, in ensure_project
    if project.required_python_version:
  File "/usr/local/lib/python2.7/dist-packages/pipenv/project.py", line 54, in required_python_version
    required = self.parsed_pipfile.get('requires', {}).get('python_full_version')
  File "/usr/local/lib/python2.7/dist-packages/pipenv/project.py", line 197, in parsed_pipfile
    return contoml.loads(toml.dumps(data, preserve=True))
  File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/contoml/__init__.py", line 15, in loads
    elements = parse_tokens(tokens)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/prettytoml/parser/__init__.py", line 17, in parse_tokens
    return _parse_token_stream(TokenStream(tokens))
  File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/prettytoml/parser/__init__.py", line 32, in _parse_token_stream
    raise ParsingError('Failed to parse line {}'.format(pending.head.row))
prettytoml.parser.errors.ParsingError: Failed to parse line 6
@kennethreitz
Copy link
Contributor

Can you share your pipfile?

@kennethreitz
Copy link
Contributor

Closing until a pipfile is provided.

@techalchemy
Copy link
Member

Will need to see the output of env as well. Pipenv is installed with python2 but I'm guessing system python is python3.

That said I still have no clue why people aren't using user-scoped installations at minimum...

@remingtonc
Copy link
Author

remingtonc commented Sep 21, 2017

@kennethreitz Pipfile

[[source]]
verify_ssl = true
url = "https://pypi.python.org/simple"

[packages]
iosxr_grpc = "*"

[packages."0.1.0"]
git = "https://github.com/einarnn/pyang-plugins.git"

@techalchemy This issue was encountered on both Linux and MacOS.

MacOS output:

REMCAMPB-M-T2DM:pathblaster remcampb$ pipenv --three install
Creating a virtualenv for this project…
Using /Library/Frameworks/Python.framework/Versions/3.5/bin/python3 to create virtualenv…
⠋Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/3.5/bin/python3
Using base prefix '/Library/Frameworks/Python.framework/Versions/3.5'
New python executable in /Users/remcampb/.local/share/virtualenvs/pathblaster-RZehhmt1/bin/python3
Also creating executable in /Users/remcampb/.local/share/virtualenvs/pathblaster-RZehhmt1/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /Users/remcampb/.local/share/virtualenvs/pathblaster-RZehhmt1
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.5/bin/pipenv", line 11, in <module>
    load_entry_point('pipenv==7.4.3', 'console_scripts', 'pipenv')()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 1063, in invoke
    Command.invoke(self, ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pipenv/cli.py", line 1441, in cli
    ensure_project(three=three, python=python, warn=True)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pipenv/cli.py", line 526, in ensure_project
    if project.required_python_version:
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pipenv/project.py", line 54, in required_python_version
    required = self.parsed_pipfile.get('requires', {}).get('python_full_version')
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pipenv/project.py", line 197, in parsed_pipfile
    return contoml.loads(toml.dumps(data, preserve=True))
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pipenv/patched/contoml/__init__.py", line 15, in loads
    elements = parse_tokens(tokens)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pipenv/patched/prettytoml/parser/__init__.py", line 17, in parse_tokens
    return _parse_token_stream(TokenStream(tokens))
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pipenv/patched/prettytoml/parser/__init__.py", line 32, in _parse_token_stream
    raise ParsingError('Failed to parse line {}'.format(pending.head.row))
prettytoml.parser.errors.ParsingError: Failed to parse line 7
REMCAMPB-M-T2DM:pathblaster remcampb$ python
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 26 2016, 12:10:39)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
REMCAMPB-M-T2DM:pathblaster remcampb$ pipenv --version
pipenv, version 7.4.3
REMCAMPB-M-T2DM:pathblaster remcampb$ env
...
PATH=/Library/Frameworks/Python.framework/Versions/3.5/bin:/Users/remcampb/Development/exec/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/go/bin
...

Linux (Ubuntu) output:

remcampb@KandRworld:~/pathblaster$ pipenv --three install
Creating a virtualenv for this project…
Using /usr/bin/python3 to create virtualenv…
⠋Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/remcampb/.local/share/virtualenvs/pathblaster-cKxdNjbb/bin/python3
Also creating executable in /home/remcampb/.local/share/virtualenvs/pathblaster-cKxdNjbb/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /home/remcampb/.local/share/virtualenvs/pathblaster-cKxdNjbb
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    load_entry_point('pipenv==7.4.3', 'console_scripts', 'pipenv')()
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 1063, in invoke
    Command.invoke(self, ctx)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/cli.py", line 1441, in cli
    ensure_project(three=three, python=python, warn=True)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/cli.py", line 526, in ensure_project
    if project.required_python_version:
  File "/usr/local/lib/python2.7/dist-packages/pipenv/project.py", line 54, in required_python_version
    required = self.parsed_pipfile.get('requires', {}).get('python_full_version')
  File "/usr/local/lib/python2.7/dist-packages/pipenv/project.py", line 197, in parsed_pipfile
    return contoml.loads(toml.dumps(data, preserve=True))
  File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/contoml/__init__.py", line 15, in loads
    elements = parse_tokens(tokens)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/prettytoml/parser/__init__.py", line 17, in parse_tokens
    return _parse_token_stream(TokenStream(tokens))
  File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/prettytoml/parser/__init__.py", line 32, in _parse_token_stream
    raise ParsingError('Failed to parse line {}'.format(pending.head.row))
prettytoml.parser.errors.ParsingError: Failed to parse line 6
remcampb@KandRworld:~/pathblaster$ python --version
Python 2.7.12
remcampb@KandRworld:~/pathblaster$ pipenv --version
pipenv, version 7.4.3
remcampb@KandRworld:~/pathblaster$ env
...
PATH=/home/remcampb/bin:/home/remcampb/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
...

@kennethreitz
Copy link
Contributor

I'm not sure how you ended up with that pipfile, but i'd suggest starting over with the latest version of pipenv. that's not valid TOML.

@techalchemy
Copy link
Member

Pipenv is up to date (relatively) but that pipfile yeah is totally invalid, no idea how old or what generated it but you will need to scrap it.

@remingtonc
Copy link
Author

remingtonc commented Sep 21, 2017

Very strange. Pipenv generated it in the past - and it works with earlier versions of Pipenv like 7.2.1.
Regenerated, very different result.

[[source]]
verify_ssl = true
url = "https://pypi.python.org/simple"

[dev-packages]

[packages]
iosxr-grpc = "*"
"0.1.0" = {git = "https://github.com/einarnn/pyang-plugins"}


[requires]
python_version = "3.5"

@kennethreitz
Copy link
Contributor

still strange, but much better :)

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

3 participants