Why isn't R or Rscript executing on my Windows box? - r

I can't seem to run R.EXE or RSCRIPT.EXE. However, it works if it's in a directory that doesn't contain any spaces. Is this a limitation of the application itself?

I found a solution. This occurs because 8dot3 naming convention is disabled! For anyone else having this issue, and I saw there were others, you can re-enable it but if the directory is already created then it can't easily re-create a short name for it.

Related

R Studio Fatal error: 'R_TempDir'contains space

I tried to download the latest version (4.2.0) of R on my windows computer and received this error message upon trying to open the program. "Fatal error: 'R_TempDir' contains space". Has anyone ever had this issue or have any ideas on how to resolve it? I have tried reinstalling the program and moving where the program is stored but no luck.
I also experienced this issue with 4.2.0 of R on Windows 10 but not prior versions of R.
In my case, the reason was the default temporary file folder was within my user directory and my user ID has a space in it. Apparently this causes an issue.
I was able to work around it by setting the global environment variable TMPDIR in windows:
Go to the search box next to the start button and type "environment"
Click on the choice which says "Edit the system environment variables"
Click the button that says "Environment Variables" near the bottom of the window
Click "New" and enter TMPDIR for variable name and some suitable directory without spaces under variable value (I chose C:\Temp)
As an aside, I do not believe this is an RStudio specific issue (and 4.2.0 isn't a version for RStudio anyway).
Thank you Venk for your post. It didn't work for me, but it pointed me in the direction of a solution that did.
I changed the values of my TEMP and TMP variables to a folder that had no spaces in it or in any folder name in the path (as you note).
I'm working on a Windows 10 machine.
Rob
P.S. My first solution was to revert to an earlier version of R, which initially worked. Recently though, I got the same error, even using a previous version. I'm no expert, but the whole thing is very weird IMO.
Had the same issue, and the other proposed solutions didn't resolve it for me. (R 4.2.2 and Windows 10.)
Solution found here worked for me:
create a file named renviron.site that contains the following text, and save it to the Desktop, using a text-editing program.
TMP=C:/Temp TEMP=C:/Temp TMPDIR=C:/Temp
if a copy already exists, may need to handle that case-by-case
move the file to C:\Program Files\R\R-4.2.x\etc
I wasn't able to save directly to this folder, despite being in the admin account.
I tried the other solutions and none worked. I came across this post that suggested to not install R in the /Program Files/ folder, to instead modify the installation to the folder C:\R\ which worked.
I didn't go back and undo the work done based on previous suggestions, so I'm not sure if they too are needed.

By default, the server runs a writing document instead of the browser

I tried to change the run through the folder without success.
'jupyter notebook --generate-config'
I signed up and changed the target address and still when I register in CMD jupyter notebook I ran a writing document
Suggestions for a solution please?
The problem was solved, the default file for html beats was assigned to the writer.
All that had to be done was:
My Computer> Properties> Search Bar: Set Default Apps> Search Explorer> In html extension redefine Explorer.
Hope I helped those who also encountered this stupid problem, long before they got into the core of Jupiter's code

Accessing target of a windows shorcut

In linux machines, it is possible to access where a symbolic link is pointing to by using Sys.readlink function in R or readlink from the command line. Reading its documentation, we see that this is not intended for Windows shortcuts.
In Windows I have not been able to find a one liner to give me where the file points to. The closest I got was from this SO question that demonstrates the use of dir. While the output was not perfect I figured with some regex magic I could isolate the file path.
However when I tried system2('dir'), I received the error "dir" not found.
Is there (a better) way for me to access the file path of a Windows shortcut from R and why can't I use dir through a system call in R?
For anyone in the future finding this thread, the answer is fs::link_path() as pointed out by Edward Visel

What can cause robot framework to stop working?

Having used robot framework for almost a year, it suddenly stopped working. Starting a script gives only the response
'pybot' is not recognized as an internal or external command, operable program or batch file.
Running scripts worked yesterday, and I can't remember making any changes since then. I have checked the environment variables, they haven't been changed. The installation is on a Windows Server 2012. Python is still working as usual. There is no difference between using pybot or robot.
Now I just don't know what else to look for, and I'm asking you geniuses to give some ideas on where to search for this error.
One of two things happened:
robot framework was uninstalled
something in your environment changed so that pybot is no longer on your PATH
Both of those should be very easy to verify.
It turns out that the python/scripts folder had been moved by someone into the python/Lib folder. Simply putting it back solved the issue.

How do I get wkhtmltopdf running for a Drupal site on cPanel shared hosting?

First off, I will acknowledge that I am aware of another similar thread on the topic of wkhtmltopdf, but it was not similar enough to resolve my issue. Here's the other thread: wkhtmltopdf
Second, I will say that I have successfully used wkhtmltopdf with a Drupal site on a dedicated server that I run, where I installed the libX11 and used the most recent static version of wkhtmltopdf. That's on a CentOS 5 system and it runs nicely.
So, I have another hosting arrangement and I need to get the wkhtmltopdf to work, because it does the most amazing job producing bookmarked PDFs. The PDFs are beautiful.
The hosting is cPanel. I determined that it is on a server that has CentOS 5.5. It is not a problem to drop the static wkhtmltopdf in the print module's lib folder. However, I get the following message back in the Drupal admin status reports page (admin/reports/status).
It says,
"wkhtmltopdf library
The currently selected version of wkhtmltopdf () is not supported. Please update to a newer version."
I have obtained all of the needed .so files for CentOS 5, based on what jockie provided in his answer in the other StackOverflow thread.
Can someone knowledgeable confirm that his list was complete?
The idea of a shell script wrapper seems interesting and appears could be done for Drupal, if the naming of the shell script is called something like "wkhtmltopdf-wrapper.sh".
I have tried to use the shell script code that jockie provided, in a shell script. I did place all of the .so files in a sub-folder called "lib". I confess that I do not know what such things mean, in the script:
export HOME="$PWD"
Can someone interpret for me, what $PWD means?
export LD_LIBRARY_PATH="$PWD/lib/"
I understand that the script is going to get the .so files with that line, yes?
And can someone interpret the following line:
exec $# 2>/dev/null
What I am wondering is, where does the actual pdf get output? I did run the script. It did not throw any errors. However, I did not see a resulting PDF file.
Also, jockie's directions are not totally clear or defined enough. He says, "(some of them are symlinks)" under the list of .so files. Are such lines (in his list), the symlinks?:
lib/libX11.so.6 lib/libX11.so.6.2.0
Or am I mistaken? I was able to get all of them, so I don't know why they would be symlinks. The only thing is, that some of the versions are different. Do I need to delete the following files and make symlinks instead?:
lib/libX11.so.6
lib/libXau.so.6
lib/libxcb.so.1
lib/libXext.so.6
Should the shell script code be written differently, with Drupal in mind?
Thanks for reading and I hope someone can help!
...Finally, if anyone knows of a better solution, please share! Again, I appreciate the help!
...There does not seem to be a way, here on StackOverflow.com to notify jockie to check out this thread. I wish there was a way to write to them or notify them, so that they could clarify for them-self or contribute to this thread as well. If someone knows of a way, please let me know that too!

Resources