Error when importing Hmisc from R script

Issue #112 resolved
wrobell created an issue

With the following code

import rpy2.robjects as ro
R = ro.r

R('library(Hmisc)')

I am getting the following with rpy2 2.3.0 (2.2.x versions are fine)

 Traceback (most recent call last):
   File "/usr/lib64/python3.3/site-packages/rpy2/rinterface/__init__.py",

line 100, in consolePrint sys.stdout.write(bytes(x, 'utf-8')) TypeError: must be str, not bytes

Comments (4)

  1. Laurent Gautier
    • edited description

    I'll have to look at it.

    In the meantime the problem seems to have to do with Hmisc sending information to the console. Other packages with silent imports do not have that problem, and importing Hmisc quietly just works (see below):

    from rpy2.robjects.packages import importr
    Hmisc = importr('Hmisc')
    
  2. Log in to comment