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

Syntax error from concurrent/futures #1589

Closed
damouse opened this issue Mar 7, 2018 · 14 comments
Closed

Syntax error from concurrent/futures #1589

damouse opened this issue Mar 7, 2018 · 14 comments

Comments

@damouse
Copy link

damouse commented Mar 7, 2018

pipenv install

throws an error. I also see this doing a variety of other tasks, including pipenv lock. This occurs in multiple projects. I can get rid of the problem by reverting from 11.1.3 to 9.0.1.

I get the same error as #1553, but the error occurs all the time, and I'm not in a virtualenv.

Describe your environment
  1. OS Type MacOS 10.13.1
  2. Python version: $ python -V 3.6.2
  3. Pipenv version: $ pipenv --version pipenv, version 11.1.3
Expected result

Not expecting a traceback.

Actual result
~/code/python/scratch/protobufs $ pipenv install
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
kages/pipenv/patched/pip/index.py", line 31, in <module>
    from pip.wheel import Wheel, wheel_ext
  File "/usr/local/lib/python3.6/site-packages/pipenv/patched/pip/wheel.py", line 6, in <module>
    import compileall
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/compileall.py", line 20, in <module>
    from concurrent.futures import ProcessPoolExecutor
  File "/usr/local/lib/python3.6/site-packages/pipenv/../concurrent/futures/__init__.py", line 8, in <module>
    from concurrent.futures._base import (FIRST_COMPLETED,
  File "/usr/local/lib/python3.6/site-packages/pipenv/../concurrent/futures/_base.py", line 381
    raise exception_type, self._exception, self._traceback
                        ^
SyntaxError: invalid syntax
Steps to replicate

Pipfile:

[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[packages]

protobuf = "*"

[dev-packages]

[requires]

python_version = "3.6"

Commands:

pipenv install
@uranusjr
Copy link
Member

uranusjr commented Mar 8, 2018

Well you said it is the same error so I will ask the same question. Can you provide your python -m pip freeze result?

@kennethreitz
Copy link
Contributor

cannot reproduce

@damouse
Copy link
Author

damouse commented Mar 8, 2018

python3 -m pip freeze:

background==0.1.1
certifi==2017.11.5
chardet==3.0.4
click==6.7
cycler==0.10.0
first==2.0.1
flake8==3.5.0
futures==3.1.1
gmplot==1.2.0
idna==2.6
janus==0.3.0
matplotlib==2.1.2
mccabe==0.6.1
mpmath==0.19
msgpack-python==0.4.8
numpy==1.14.1
pew==1.1.2
pip-tools==1.9.0
pipenv==11.1.4
py==1.4.34
pycodestyle==2.3.1
pyflakes==1.6.0
pyparsing==2.2.0
pyserial==3.4
python-dateutil==2.6.1
pythonz-bd==1.11.4
pytz==2018.3
requests==2.18.4
resumable-urlretrieve==0.1.5
semver==2.7.8
six==1.10.0
sympy==1.1.1
urllib3==1.22
virtualenv==15.1.0
virtualenv-clone==0.3.0
websockets==4.0.1

@damouse
Copy link
Author

damouse commented Mar 8, 2018

@kennethreitz #1553 two days ago, mine yesterday, and #1603 today.

Thats a casual dismissal given the latest version of pipenv is unusable for me, and if those guys are experiencing the same behavior then they can't either.

@kennethreitz
Copy link
Contributor

just keeping tickets clean, we're working actively on both closed and open tickets.

@techalchemy
Copy link
Member

Fixed by c7c0613 and released

@zyv
Copy link

zyv commented Mar 9, 2018

I ran into this problem under the following circumstances:

  1. System Python is 2.7.x, pipenv is installed with pip with --user
  2. Installed futures backport with --user due to other packages dependency
  3. Attempted to create Python 3 virtualenv with pipenv install --python=...

Haven't tried if this is fixed in the latest release yet, but hopefully, it is.

@damouse
Copy link
Author

damouse commented Mar 9, 2018

Confirm I don't see the problem anymore after upgrading to 11.1.5.

Thanks!

@alok
Copy link
Contributor

alok commented Mar 11, 2018

I'm seeing this issue too, and I have the latest version of pipenv (11.5.2).

@techalchemy
Copy link
Member

I'm guessing this is from having both python 2.7 and python 3.x installed, with pipenv installed on 2.7.

My suggestion is you pip uninstall pipenv && python3.6 -m pip install --user --update --no-cache-dir pipenv and make sure ~/.local/bin is on your path before other items, if that doesn't help y'all gotta start providing the output of python -m pipenv.help

@alok
Copy link
Contributor

alok commented Mar 12, 2018

I don't have pipenv on python 2 since I don't use python 2.

Here's the traceback:

Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/alokbeniwal/Library/Python/3.6/lib/python/site-packages/pipenv/help.py", line 9, in <module>
    from .core import project, system_which, find_python_in_path, python_version
  File "/Users/alokbeniwal/Library/Python/3.6/lib/python/site-packages/pipenv/core.py", line 16, in <module>
    import background
  File "/Users/alokbeniwal/Library/Python/3.6/lib/python/site-packages/pipenv/../background.py", line 4, in <module>
    import concurrent.futures
  File "/Users/alokbeniwal/Library/Python/3.6/lib/python/site-packages/pipenv/../concurrent/futures/__init__.py", line 8, in <module>
    from concurrent.futures._base import (FIRST_COMPLETED,
  File "/Users/alokbeniwal/Library/Python/3.6/lib/python/site-packages/pipenv/../concurrent/futures/_base.py", line 381
    raise exception_type, self._exception, self._traceback
                        ^
SyntaxError: invalid syntax

Here's a gist of the file with the error, in case that helps.

@techalchemy
Copy link
Member

A clean install should fix this. Can you run python -m pipenv.help | pbcopy and past here in a <details></details> tag?

@alok
Copy link
Contributor

alok commented Mar 12, 2018

I already clean installed pipenv.

That's what I put in the gist, but here:

Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/alokbeniwal/Library/Python/3.6/lib/python/site-packages/pipenv/help.py", line 9, in 
    from .core import project, system_which, find_python_in_path, python_version
  File "/Users/alokbeniwal/Library/Python/3.6/lib/python/site-packages/pipenv/core.py", line 16, in 
    import background
  File "/Users/alokbeniwal/Library/Python/3.6/lib/python/site-packages/pipenv/../background.py", line 4, in 
    import concurrent.futures
  File "/Users/alokbeniwal/Library/Python/3.6/lib/python/site-packages/pipenv/../concurrent/futures/__init__.py", line 8, in 
    from concurrent.futures._base import (FIRST_COMPLETED,
  File "/Users/alokbeniwal/Library/Python/3.6/lib/python/site-packages/pipenv/../concurrent/futures/_base.py", line 381
    raise exception_type, self._exception, self._traceback
                        ^
SyntaxError: invalid syntax

@jwaschkau
Copy link

jwaschkau commented Mar 12, 2018

I have the same error. Python 3.4-x86 on Windows 10 and pipenv: 11.5.2.

Running via GitLab Runner.

$ pipenv install --ignore-pipfile
Traceback (most recent call last):
  File "c:\python34\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python34\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python34\Scripts\pipenv.exe\__main__.py", line 9, in <module>
  File "c:\python34\lib\site-packages\pipenv\vendor\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "c:\python34\lib\site-packages\pipenv\vendor\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "c:\python34\lib\site-packages\pipenv\vendor\click\core.py", line 1063, in invoke
    Command.invoke(self, ctx)
  File "c:\python34\lib\site-packages\pipenv\vendor\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\python34\lib\site-packages\pipenv\vendor\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "c:\python34\lib\site-packages\pipenv\vendor\click\decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "c:\python34\lib\site-packages\pipenv\cli.py", line 62, in cli
    from . import core
  File "c:\python34\lib\site-packages\pipenv\core.py", line 16, in <module>
    import background
  File "c:\python34\lib\site-packages\pipenv\vendor\background.py", line 11, in <module>
    import concurrent.futures as concurrent
  File "c:\python34\lib\site-packages\pipenv\..\concurrent\futures\__init__.py", line 8, in <module>
    from concurrent.futures._base import (FIRST_COMPLETED,
  File "c:\python34\lib\site-packages\pipenv\..\concurrent\futures\_base.py", line 381
    raise exception_type, self._exception, self._traceback
                        ^
SyntaxError: invalid syntax

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

7 participants