Entering edit mode
Hi, I am learning to analyze bulk RNA-Seq data using Python. I am using Python3.6 and R 4.2.3.
import pandas as pd
import rpy2.robjects as robjects
from rpy2.robjects import pandas2ri, Formula
pandas2ri.activate()
from rpy2.robjects.packages import importr
Everything went well and an error hit me.
deseq = importr('DESeq2')
##
error
D:\Files\Python\PXF_H_L\venv\Scripts\python.exe D:/Files/Python/PXF_H_L/deseq2_2.py
From cffi callback <function _consolewrite_ex at 0x164A4AE0>:
Traceback (most recent call last):
File "D:\Files\Python\PXF_H_L\venv\lib\site-packages\rpy2\rinterface_lib\callbacks.py", line 132, in _consolewrite_ex
s = conversion._cchar_to_str_with_maxlen(buf, n, _CCHAR_ENCODING)
File "D:\Files\Python\PXF_H_L\venv\lib\site-packages\rpy2\rinterface_lib\conversion.py", line 133, in _cchar_to_str_with_maxlen
s = ffi.string(c, maxlen).decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 223: invalid continuation byte
R[write to console]: Failed with error:
R[write to console]:
From cffi callback <function _consolewrite_ex at 0x164A4AE0>:
Traceback (most recent call last):
File "D:\Files\Python\PXF_H_L\venv\lib\site-packages\rpy2\rinterface_lib\callbacks.py", line 132, in _consolewrite_ex
s = conversion._cchar_to_str_with_maxlen(buf, n, _CCHAR_ENCODING)
File "D:\Files\Python\PXF_H_L\venv\lib\site-packages\rpy2\rinterface_lib\conversion.py", line 133, in _cchar_to_str_with_maxlen
s = ffi.string(c, maxlen).decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xce in position 1: invalid continuation byte
R[write to console]:
R[write to console]:
From cffi callback <function _consolewrite_ex at 0x164A4AE0>:
Traceback (most recent call last):
File "D:\Files\Python\PXF_H_L\venv\lib\site-packages\rpy2\rinterface_lib\callbacks.py", line 132, in _consolewrite_ex
s = conversion._cchar_to_str_with_maxlen(buf, n, _CCHAR_ENCODING)
File "D:\Files\Python\PXF_H_L\venv\lib\site-packages\rpy2\rinterface_lib\conversion.py", line 133, in _cchar_to_str_with_maxlen
s = ffi.string(c, maxlen).decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 180: invalid continuation byte
Traceback (most recent call last):
File "D:/Files/Python/PXF_H_L/deseq2_2.py", line 6, in <module>
deseq = importr('DESeq2')
File "D:\Files\Python\PXF_H_L\venv\lib\site-packages\rpy2\robjects\packages.py", line 484, in importr
env = _get_namespace(name)
File "D:\Files\Python\PXF_H_L\venv\lib\site-packages\rpy2\rinterface_lib\conversion.py", line 45, in _
cdata = function(*args, **kwargs)
File "D:\Files\Python\PXF_H_L\venv\lib\site-packages\rpy2\rinterface.py", line 680, in __call__
raise embedded.RRuntimeError(_rinterface._geterrmessage())
File "D:\Files\Python\PXF_H_L\venv\lib\site-packages\rpy2\rinterface_lib\_rinterface_capi.py", line 438, in _geterrmessage
res = _string_getitem(res, 0)
File "D:\Files\Python\PXF_H_L\venv\lib\site-packages\rpy2\rinterface_lib\_rinterface_capi.py", line 286, in _string_getitem
conversion._R_ENC_PY[openrlib.rlib.Rf_getCharCE(elt)]
File "D:\Files\Python\PXF_H_L\venv\lib\site-packages\rpy2\rinterface_lib\conversion.py", line 127, in _cchar_to_str
s = ffi.string(c).decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 180: invalid continuation byte
During startup - Warning message:
package 'stats' in options("defaultPackages") was not found
I think this error may suggests that there is an issue with decoding a string using the 'utf-8' codec due to an invalid byte sequence.
Thanks! I tried to install PyDESeq2 within a conda environment following the official instruction
An error hit me
Then I googled the error and changed the code
Another error hit me
It seems that there's a problem with the connection between my system and the Anaconda repository.
I'm not the maintainer, try contacting them.