-1

I have a python script that sends a message to Discord. From R, I have executed the following succesfuly several times:

library(reticulate)
use_python('C:/Users/OfirL1/Miniconda3/', required = T)
source_python('C:/Users/OfirL1/Google Drive (ronnydorone@mail.tau.ac.il)/Model Data/message.py')
# use sourced function here

But today, without any changes, I now get:

## Error in python_config(python_version, required_module, python_version,  : 
##   Error 1033 occurred running C:/Users/OfirL1/Miniconda3/python.exe  
## In addition: Warning message:
## In system2(command = python, args = paste0("\"", config_script,  :
##   running command '"C:/Users/OfirL1/Miniconda3/python.exe" "D:/OfirL1/Documents/R/win-library/3.6/reticulate/config/config.py"' had status 1033

I don't understand why, or what 1033 stands for (have not been able to find any information on it).

Ronny Efronny
  • 1,148
  • 9
  • 28

1 Answers1

2

the problem is that your path you give use_python is incorrect, you should specify the entire path to where python is located for example:

use_python('C:\\Users\\davidsr\\AppData\\Local\\Programs\\Python\\Python38-32', required = T)

This will not raise errors, and in case you wonder how to find the full path -> you can run the following simple python code below and it will output you the path needed:

import os
import sys
print(os.path.dirname(sys.executable))
David
  • 8,113
  • 2
  • 17
  • 36
  • I'm sorry, I do have the full path to the Python executable in my code, just when writing it here I decided to skip it. But do you mean that the path is supposed to be to the directory, not the executable? – Ronny Efronny Dec 19 '19 at 12:14
  • Exactly, this was your problem; next time specify it so it will be clearer – David Dec 19 '19 at 12:14
  • I updated the question with my full paths. This does not solve the error however. – Ronny Efronny Dec 19 '19 at 12:44
  • @RonnyEfronny is it a virtual environment or the standard python? it seems that there authorization issues – David Dec 19 '19 at 13:11
  • Standard python as installed by Miniconda3. – Ronny Efronny Dec 19 '19 at 13:29
  • @RonnyEfronny I would try download `python` from the site and retry, there might be some issue with the `python` under the miniconda installation – David Dec 19 '19 at 14:05
  • I use this particular one in pure Python work with PyCharm as well and there are no issues at all, this sounds odd. – Ronny Efronny Dec 19 '19 at 14:07
  • I agree that its odd, but that might be the issue; worthwhile to check it; Did the `R` code with `python` calling worked before? If yes when did you changed something? – David Dec 19 '19 at 14:08
  • It did, and I changed nothing about it before it ceased working this morning. – Ronny Efronny Dec 19 '19 at 14:12
  • @RonnyEfronny So it is peculiar, it has to do with something that is not related to the code itself – David Dec 19 '19 at 14:26