Pipenv: SyntaxError around async keyword on Python 3.7

Created on 23 Oct 2017  路  8Comments  路  Source: pypa/pipenv

async cannot be used as an argument name in Python 3.7:

https://github.com/kennethreitz/pipenv/blob/d89696e36da1277067c055ca83f786f762f02091/pipenv/vendor/pexpect/spawnbase.py#L224

Describe you environment
  1. OS Type: Alpine Linux 3.6
  2. Python version: 3.7-rc
  3. Pipenv version: N/A
Expected result

I can install pipenv.

Actual result
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 7, in <module>
    from pipenv import cli
  File "/usr/local/lib/python3.7/site-packages/pipenv/__init__.py", line 17, in <module>
    from .cli import cli
  File "/usr/local/lib/python3.7/site-packages/pipenv/cli.py", line 19, in <module>
    import delegator
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/delegator.py", line 8, in <module>
    from pexpect.popen_spawn import PopenSpawn
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/__init__.py", line 75, in <module>
    from .pty_spawn import spawn, spawnu
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/pty_spawn.py", line 14, in <module>
    from .spawnbase import SpawnBase
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/spawnbase.py", line 224
    def expect(self, pattern, timeout=-1, searchwindowsize=-1, async=False):
                                                                   ^
SyntaxError: invalid syntax
Steps to replicate

pip install pipenv with Python 3.7.

All 8 comments

This should be raised on https://github.com/pexpect/pexpect/ I imagine this change in 3.7 is going to break a whole lot of code though.

It looks like they have already fixed this issue upstream (async => async_): https://github.com/pexpect/pexpect/blob/c741080a46445e5b2dec037c4856617f679d4546/pexpect/spawnbase.py

So I think the vendored pexpect just needs to be updated.

I closed #957 because I don't think we want the noise from tests failing until 3.7 is at least into a beta phase. I'll get pexpect updated tonight. Thanks everyone!

This is fixed on master by PR #962

I am facing the same issue as well. Please advise.

the async as variable issue also breaks apache-airflow on python 3.7.

The pexpect issue has been fixed long ago. If you see this exact problem, you should upgrade Pipenv. If Pipenv is already up-to-date, or if you鈥檙e experiencing this for a package you want to install with Pipenv, this is a problem of that package, not Pipenv. Please report this problem to them instead.

Locking this since the problem is obviously resolved, and any claim of having this exact issue is always wrong.

Was this page helpful?
0 / 5 - 0 ratings