datasnakes / renv

Creating virtual environments for R.
MIT License
17 stars 0 forks source link

New capture_output parameter in python3.7 #32

Closed grabear closed 5 years ago

grabear commented 5 years ago

Tried to create an environment:

grabear@Ubuntu-Blog:~$ renv -n boobs
Traceback (most recent call last):
  File "/home/grabear/.local/bin/renv", line 11, in <module>
    sys.exit(renv())
  File "/usr/lib/python3/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/grabear/.local/lib/python3.6/site-packages/renv/renv.py", line 47, in renv
    prompt=prompt)
  File "/home/grabear/.local/lib/python3.6/site-packages/renv/core.py", line 62, in __init__
    r_path = utils.get_r_installed_root()
  File "/home/grabear/.local/lib/python3.6/site-packages/renv/utils.py", line 23, in get_r_installed_root
    r_path = get_r_path()
  File "/home/grabear/.local/lib/python3.6/site-packages/renv/utils.py", line 11, in get_r_path
    sp_out = sp.run(["which R"], shell=True, capture_output=True, encoding="utf8")
  File "/usr/lib/python3.6/subprocess.py", line 403, in run
    with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'capture_output'

Here is a 3.6/3.7 compatible way (I think). https://github.com/datasnakes/renv/blob/master/renv/core.py#L208-L223

santina commented 5 years ago

Fixed in here 9154d436d365bf47d22a713071031b3a956fa6da

grabear commented 5 years ago

I might be mistaken, but I was having trouble with this right before the teams started presenting. I think we missed something with the merges right before this.

grabear commented 5 years ago

I might be mistaken, but I was having trouble with this right before the teams started presenting. I think we missed something with the merges right before this.

https://github.com/datasnakes/renv/commit/8ee743db5c13c4b445c9d9e25fb5c04d8caba92c Fixes this issue