marcschwartz / WriteXLS

CRAN Package WriteXLS: Cross-platform Perl based R function to create Excel 2003 (XLS) and Excel 2007 (XLSX) files from one or more data frames. Each data frame will be written to a separate named worksheet in the Excel spreadsheet. The worksheet name will be the name of the data frame it contains or can be specified by the user.
GNU General Public License v2.0
19 stars 9 forks source link

WriteXLS doesn't work on R 3.6 #16

Closed barrel0luck closed 5 years ago

barrel0luck commented 5 years ago

WriteXLS installs on R 3.6 without error, however doesn't work as it needs some dependencies that don't install on R 3.6 (Compress). Here's the error I get when I try to use the WriteXLS function:

Can't locate Compress/Raw/Zlib.pm in @INC (you may need to install the Compress::Raw::Zlib module) (@INC contains: /usr/lib64/R/library/WriteXLS/Perl /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /usr/lib64/R/library/WriteXLS/Perl/Archive/Zip.pm line 9.
BEGIN failed--compilation aborted at /usr/lib64/R/library/WriteXLS/Perl/Archive/Zip.pm line 9.
Compilation failed in require at /usr/lib64/R/library/WriteXLS/Perl/Excel/Writer/XLSX/Workbook.pm line 25.
BEGIN failed--compilation aborted at /usr/lib64/R/library/WriteXLS/Perl/Excel/Writer/XLSX/Workbook.pm line 25.
Compilation failed in require at /usr/lib64/R/library/WriteXLS/Perl/Excel/Writer/XLSX.pm line 17.
BEGIN failed--compilation aborted at /usr/lib64/R/library/WriteXLS/Perl/Excel/Writer/XLSX.pm line 17.
Compilation failed in require at /usr/lib64/R/library/WriteXLS/Perl/WriteXLSX.pl line 36.
BEGIN failed--compilation aborted at /usr/lib64/R/library/WriteXLS/Perl/WriteXLSX.pl line 36.
The Perl script 'WriteXLSX.pl' failed to run successfully.
marcschwartz commented 5 years ago

Hi,

I have WriteXLS installed on macOS 10.14.6 (Mojave) with R 3.6.1 via the CRAN binary, and do not have any issues running the function.

From the file paths that you have above, I am guessing that you are on a Linux distribution.

The Compress::Raw::Zlib Perl package is typically part of the default Perl installation on major operating systems, which is why I do not include it in the WriteXLS package, nor does the testPerl() function in the package look for it.

That you are having the errors above suggests that there might be an issue with your Perl installation. You should check to see if Compress::Raw::Zlib is installed, and if not, install it either from CPAN or via your Linux distribution package management system.

barrel0luck commented 5 years ago

Ah, I thought it's a R package. Compress::Raw::Zlib is not installed by default on Fedora 30. So others on Fedora 30 might face this problem too and not understand what needs to be done... After installing the issue was resolved, so you can go ahead and close. Thanks a bunch for the quick reply!

marcschwartz commented 5 years ago

Hi,

Interesting. I wonder why that change suddenly, as it has not been an issue in the past. I used Fedora in years past, but it has been a long time.

Thanks for the additional information. I have posted to R-sig-Fedora to see if one of the Fedora maintainers can comment and provide some clarification.

barrel0luck commented 5 years ago

I'm on Fedora 30 GNOME (in case this issue is DE specific).

marcschwartz commented 5 years ago

Hi,

I don't think that this will be DE specific, but am waiting on any feedback on the e-mail list.

In the mean time, I found the following page:

https://fedora.pkgs.org/30/fedora-updates-x86_64/perl-5.28.2-436.fc30.x86_64.rpm.html

which would indicate that perl-Compress-Raw-Zlib is indeed required by the Perl RPM.

If that is correct, it is not clear to me under what install/upgrade scenario, it would not have been installed on your system.

marcschwartz commented 5 years ago

Hi,

Timing is everything.

I just got a reply from Tom Callaway, who is the Fedora maintainer for R.

His reply is as follows:

"I can confirm:

[spot@localhost ~]$ rpm -q perl --requires |grep Zlib perl-Compress-Raw-Zlib perl-IO-Zlib [spot@localhost ~]$ rpm -q perl perl-5.28.2-436.fc30.x86_64

It would require either notable human intervention (or a canceled mid-upgrade state) for a Fedora 30 system to end up with perl, but not perl-Compress-Raw-Zlib."

Thus, Compress::Raw::Zlib should have been present on your system, presuming Perl was installed in a normal manner. Not sure how that may not have been the case, but hopefully this provides some additional information that may be helpful.

barrel0luck commented 5 years ago

Okay, I really haven't done anything special to Perl or R. I did not upgrade either, rather clean installed Fedora 30 and then R and then this R library. So, not sure either how this was possible. I'll try to test this issue more using live bootable USBs made with the Fedora image. I don't know if that could help...

marcschwartz commented 5 years ago

Hi,

This should be independent of R, as from what I can see, R does not have any direct dependencies on Perl, within the Fedora RPM system. That is, there should not have been any Perl related installs that would have taken place during the installation of the R RPM, to satisfy related dependencies.

So whatever happened should have occurred prior to you installing R, either during the initial Fedora install, or perhaps during any later steps that involved adding Fedora components on top of a base installation. My recollection from years ago, is that there are some default configurations in Fedora for an install, with various options to install other components that may be needed, either during the initial install, or at a later time, as add-ons. I presume that may still be the case.

If this was a de novo Fedora 30 install, something occurred to inhibit the installation of this particular RPM, which is a core (standard) part of a Perl distribution. Thus, it would logically raise red flags relative to what else may have possibly occurred and perhaps be missing.