jimhester / SublimeLinter-contrib-lintr

MIT License
14 stars 8 forks source link

Packageversion error #8

Open ghost opened 9 years ago

ghost commented 9 years ago

Hi,

I haven't been able to load Lintr. It seems it's unable to extract the version (copied error below). I've tried to execute the same command on my console and I get the same error. I've tried with different packages (ggvis, for instance), and I get the same error. If I open R from the console (path is correct), I'm able to run packageVersion ("lintr") and I get 0.3.1.

I'm using windows and sublime 3083

Felipe

The following error: SublimeLinter: lintr version query: C:\Program Files\R\R-3.2.1\bin\x64\R.exe --slave --restore --no-save -e packageVersion("lintr") SublimeLinter: WARNING: no lintr version could be extracted from: During startup - Warning message:

Setting LC_CTYPE=en_US.UTF-8 failed

Error in packageDescription(pkg, lib.loc = lib.loc, fields = "Version") :

object 'lintr' not found

Calls: packageVersion

Execution halted

jimhester commented 9 years ago

Lintr 3.1 that was recently submitted to lintr had an test error on windows that caused it to fail on CRAN's build system. This caused that version not to be available on windows. I have fixed the error and will be submitting a new version to CRAN tomorrow, so this should be fixed as soon as it is accepted.

If you want to fix the issue before then you can install lintr directly from the development version using

devtools::install_github("jimhester/lintr")
ghost commented 9 years ago

I've tried the development version without success. I don't know if that's the issue as it's unable to retrieve the version number. So it halts even before calling lintr function on R.

Screenshot of the Sublime Error Message: image

My attempts to call the same command on windows console:

image

federman commented 8 years ago

I'm also getting this error with R-3.2.3, development version of lintr, and the current version of sublime 3 built 3103. It worked with prior version of sublime. I would note that lintr does work with Atom using these same packages.

nassimhaddad commented 8 years ago

Note that simply changing the double quotes with simple quotes will make the command work in the windows console: R.exe --slave --restore --no-save -e packageVersion("lintr") instead of R.exe --slave --restore --no-save -e packageVersion("lintr")

mihaiconstantin commented 7 years ago

Same issue here:

After SublimeLinter lists all the values under the PATH variable (I made sure R.exe is available at the cmd), the following message is outputted to the console (debug mode is ON):

SublimeLinter: lintr version query: C:\Program Files\R\R-3.3.3\bin\x64\R.exe --slave --restore --no-save -e packageVersion("lintr") 
SublimeLinter: WARNING: no lintr version could be extracted from:
During startup - Warning message:
Setting LC_CTYPE=en_US.UTF-8 failed 
Error in packageDescription(pkg, lib.loc = lib.loc, fields = "Version") : 
  object 'lintr' not found
Calls: packageVersion
Execution halted

lintr is installed from CRAN and it is at version 1.0.0. As for R here are the details:

platform       x86_64-w64-mingw32
arch           x86_64
os             mingw32
system         x86_64, mingw32
status
major          3
minor          3.3
year           2017
month          03
day            06
svn rev        72310
language       R
version.string R version 3.3.3 (2017-03-06)
nickname       Another Canoe

Do you have any hints on how to fix this? Looks like it is indeed a problem involving the quotes, as @nassimhaddad suggested.

As a side note, installing from GitHub via devtools results in the following error:

Downloading GitHub repo jimhester/lintr@master
from URL https://api.github.com/repos/jimhester/lintr/zipball/master
Installing lintr
Downloading GitHub repo hadley/xml2@master
from URL https://api.github.com/repos/hadley/xml2/zipball/master
Installing xml2
"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" --no-site-file --no-environ --no-save  \
  --no-restore --quiet CMD INSTALL  \
  "C:/Users/M/AppData/Local/Temp/RtmpETyA6q/devtools147439155c8/hadley-xml2-c84db5e"  \
  --library="C:/Users/M/Documents/R/win-library/3.3" --install-tests

* installing *source* package 'xml2' ...
** libs
rm -f RcppExports.o connection.o xml2_doc.o xml2_init.o xml2_namespace.o xml2_node.o xml2_output.o xml2_schema.o xml2_url.o xml2_xpath.o xml2.dll
"C:/PROGRA~1/R/R-33~1.3/bin/x64/Rscript.exe" --vanilla "../tools/winlibs.R"
C:/Program Files/Rtools/mingw_64/bin/g++  -I"C:/PROGRA~1/R/R-33~1.3/include" -DNDEBUG -I../inst/include -I../windows/libxml2-2.9.4/include/libxml2 -DLIBXML_STATIC   -I"C:/Users/M/Documents/R/win-library/3.3/Rcpp/include" -I"C:/Users/M/Documents/R/win-library/3.3/BH/include" -I"d:/Compiler/gcc-4.9.3/local330/include"     -O2 -Wall  -mtune=core2 -c RcppExports.cpp -o RcppExports.o
C:/Program: not found
make: *** [RcppExports.o] Error 127
Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-33~1.3/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-33~1.3/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="xml2.dll" WIN=64 TCLBIN=64 OBJECTS="RcppExports.o connection.o xml2_doc.o xml2_init.o xml2_namespace.o xml2_node.o xml2_output.o xml2_schema.o xml2_url.o xml2_xpath.o"' had status 2
ERROR: compilation failed for package 'xml2'
* removing 'C:/Users/M/Documents/R/win-library/3.3/xml2'
* restoring previous 'C:/Users/M/Documents/R/win-library/3.3/xml2'
Error: Command failed (1)

I forked and removed Remotes: hadley/xml2, MangoTheCat/xmlparsedata from DESCRIPTION (manually installed them from CRAN). Now I am able to install the package via devtools, but the issue still persists.

Update. Changing from version_args = '--slave --restore --no-save -e "packageVersion(\\\"lintr\\\")"' to version_args = '--slave --restore --no-save -e "packageVersion(\'lintr\')"' solves the problem under Windows 10.

alofting commented 7 years ago

Quick fix (Windows 7): install Package Resource Viewer. Then in Package Control choose 'PackageResourceViewer: Open Resource' -> 'SublimeLinter-contrib-lintr' ->'linter.py'. This opens the linter.py file from the package (the file can also be accessed by appending '.zip' to 'SublimeLinter-contrib-lintr.sublime-package' in 'Installed Packages' and opening it). Then change \'lintr\' to \\"lintr\\" as shown above and save the file (remove .zip from file if using that method). If this was obvious, then good for you.