<#18278 Unable to create a python2 package> Issue ...
# github-notifications
q
#18278 Unable to create a python2 package Issue created by shankj3 When trying to run
pants package
with
python_distribution
target that has
interpreter_constraints
that include
>=2.7
, the build fails with this error:
Copy code
Traceback (most recent call last):
  File "/private/var/folders/tx/j170snrj51x7vsqlr6gjgknm0000gn/T/pants-sandbox-n0BU4K/chroot/../.cache/pex_root/venvs/1286fe9e47a1c2e7c2f0b8f40834df0d199c016c/bbf665a577dacddf63ce4c741b47906e31dbdb6c/pex", line 230, in <module>
    exec ast in globals_map, locals_map
  File "backend_shim.py", line 21, in <module>
    os.makedirs(dist_dir, exist_ok=True)
TypeError: makedirs() got an unexpected keyword argument 'exist_ok'
Because the generated
backend_shim.py
file includes
exist_ok
when calling
makedirs
, which is not an available keyword argument in python 2. Slack thread pantsbuild/pants
u