spyder: Windows permission errors when saving script - windows

We've been trying to get spyder 5.1.5 to work inside a windows server environment (version 2012 and 2016). Before We've been using Spyder 3.3.6 successfully, but we want to upgrade to get "black/autopep8" autoformatting.
We have this distributed CIFS-like shared drive inside this server that has some strict permissions (but my username definitely has read/write/modify access at the level where the script is).
Unfortunately, when I try to get spyder to SAVE my code (and autoformat using black), I get the following (trimmed) error below. Basically spyder cannot save due to a permission error that doesn't make sense to me.
2021-12-08 18:23:52,005 [DEBUG] [spyder.plugins.completion.providers.languageserver.client] -> python Response error: {'code': -32602, 'message': "PermissionError: [WinError 5] Access is denied: '\\\\\\\\data-dist\\\\DataVol_014\\\\group\\\\users\\\\myusername\\\\myscript.py'", 'data': {'traceback': [' File "C:\\ProgramData\\Anaconda3\\envs\\py37-dev\\lib\\site-packages\\pylsp_jsonrpc\\endpoint.py", line 116, in consume\n self._handle_request(message[\'id\'], message[\'method\'], message.get(\'params\'))\n', '
Troubleshooting this further, I certainly have read/write/modify access to the following levels of this path:
\\data-dist\DataVol_014\group\users\myusername\myscript.py
\\data-dist\DataVol_014\group\users\myusername\
\\data-dist\DataVol_014\group\users\
However, I cannot even view this level:
\\data-dist\DataVol_014\group\
Still this does not make sense to me. I don't understand why spyder would need this level of access.
Any help/guidance is appreciated.
The error certainly goes away if I copy the script to a local drive on said server and the black autoformatting works as expected.

Related

psqlodbc driver not found on heroku despite being in my app directory

I am trying to get RODBC to work on heroku. I have a rails app that calls an R script from RinRuby, which then queries the production database in order to do some analysis. It all works fine on my local Mac, so I thought the best approach was to use the binary compiled on my Max (psqlodbcw.so) into my repo, and reference it in production as well. Unfortunately, when I try to make the connection in production using this connection string:
> library(RODBC)
> dbhandle <- odbcDriverConnect('driver=./psqlodbcw.so;database=nw_server_production;trusted_connection=true;uid=nw_server')
Warning messages:
1: In odbcDriverConnect("driver=./psqlodbcw.so;database=<db_name>;trusted_connection=true;uid=<user>") :
[RODBC] ERROR: state 01000, code 0, message [unixODBC][Driver Manager]Can't open lib './psqlodbcw.so' : file not found
2: In odbcDriverConnect("driver=./psqlodbcw.so;database=<db_name>;trusted_connection=true;uid=<user>?") :
ODBC connection failed
I have seen this error in a similar post online here, but using SQL server instead of postgres. But the accepted answer on that post doesn't explain why the file isn't found, despite being in the app directory. I did follow the same approach and made my own custom buildpack (available here: https://github.com/NovaWulf/r-rodbc-buildpack). I replaced the .so file with the one I compiled on my mac, and simply deleted the .rll file and the code that copies it, since I don't have that file (and hopefully don't need it for psqlodbc?). When I run that buildpack it runs without error on heroku, but then when I reference the .so file copied from the buildpack, I get the same "file not found" error.
Is this happening because the .so file was compiled on the wrong system architecture? I tried compiling psqlodbc on linux, but I do not get a psqlodbcq.so file when I do that (let alone an .rll file). The closest thing I get is a file called libodbcpsqlS.so, which is a setup file, not a driver file.
Could someone please help me understand the best approach to this problem? Why is heroku not seeing the file that is not there? And what is the best solution? Is there a simple way to just download the correct driver file somewhere?
Any help is much appreciated!
Best,
Paul

Cannot run scripts in Rstudio

I'm working through some exercises in an Introduction to R book (A Dummy's Book to be specific). I am running Rstudio version 1.1.447. I Enter the following script
h <-hello
yourname <-readline("What is your name")
Print(paste(h,yourname))
I then press Ctrl+Shift+S. When I do this, I get the following error message:
Error in file(con, "w") : cannot open the connection
In addition: Warning message:
In file(con, "w") :
cannot open file 'C:/Users/efami/OneDrive/Documents/.active-rstudio-document': Permission denied
I am running RStudio in Administrative Mode in a Windows 10 system. I do not understand where this path is coming from (it's obviously picking up something in my environment) or how to get past this problem.
I still don't know why it picked up the directory shown in the error message but the trick is to override the directory by creating a .Renviron file. The instructions on how to do this are found here:
Change temporary directory

rethinkdb CURLOPT_ACCEPT_ENCODING was not declared in this scope error

I am working on installing rethinkdb on my server, which is a CentOS 6.9 machine. I followed all the directions for a CentOS server as described here for CentOS 6. I got all the way to the command scl enable devtoolset-2 -- make but while building, on line 244 of 421, the line that reads build/release/obj/extproc/http_job.o I receive the error "CURLOPT_ACCEPT_ENCODING was not declared in this scope"
I don't know what this means or why the error is popping up, but I can't continue with the build process as long as that error is there.
I found an obscure article that mentions a fix for this particular error. If you go into the rethinkdb folder on the server, you can then navigate to src/extproc/http_job.cc and open that file in a text editor. You can then search for the function void set_default_opts and inside of that function is the line exc_setopt(curl_handle, CURLOPT_ACCEPT_ENCODING, "", "PROTOCOLS); If you just change CURLOPT_ACCEPT_ENCODING to `CURLOPT_ENCODING, you will be able to continue the build process. It worked for me.

Automap library issue in Windows7 (with R 3.0.1)

I installed sp and automap libraries to my R 3.0.1 64-bit under Windows 7 (via install.packages command). Installation of them did not display any error and library(sp) works fine however when I try to execute library(automap) I get the following error:
> library(automap)
Error in gzfile(file, "rb") : cannot open the connection
In addition: Warning messages:
1: In read.dcf(file.path(p, "DESCRIPTION"), c("Package", "Version")) :
cannot open compressed file 'C:/Program Files/R/R-3.0.1/library/sp/DESCRIPTION', probable reason 'No such file or directory'
2: In gzfile(file, "rb") :
cannot open compressed file '', probable reason 'Invalid argument'
I looked from the path and indeed there is no DESCRIPTION file (or folder) in that path. However there is just libs folder under which folder x64 and inside it file sp.dll
Any idea what could cause this?
I would definitely try to run R as administrator, both for installing the packages and loading them. This could solve your problem.
This probably has to do with file permissions. When you install the packages as admin in a location where only admin can read/write, running R as a normal user means you do not have the file permissions needed to load the package. Running R as admin will solve this, as admin does have the correct permissions.
Alternatively, you could install your R packages in a location where a normal user has read/write persmissions, e.g. C:/Users/UserName (or something like that, I do not have my windows machine accesible right now).

php_curl not working, even after all the neccessary steps

I am trying to enable php_curl on my windows 2003 server, using IIS. It just won't work.
I made sure the extension is enabled/uncommented in php.ini - I did notice that there are more than one php.ini files, so I made sure they were all the same.
The extension_dir setting is pointing to c:\php\ext (without the slash)
I have copied 'ibeay32.dll' and 'ssleay32.dll' from "C:\PHP5\ext" to '%windows%\system32 folder'
I even tried copying php_curl.dll from c:\php\ext to the windows system32 folder, that didn't work either.
I did php-cgi.exe -v from the command prompt, and no errors came up.
I don't get the same error that some of the other windows users are getting, which says 'unable to load php curl' - I get an error saying "Fatal error: Call to undefined function: curl_init()"
I made a test page with phpInfo, which is here: http://www.mrahmanphoto.com/blog/test.php
Its obvious that none of the additional modules are loading. What gives?

Resources