Hemken / Statamarkdown

Functions to write Stata documentation with knitr
Other
59 stars 11 forks source link

Ubuntu 18.04 installation issue #3

Closed Lio21 closed 2 years ago

Lio21 commented 5 years ago

library(devtools) # before this you may need to install devtools install_github("hemken/Statamarkdown")

Downloading GitHub repo hemken/Statamarkdown@master ✔ checking for file ‘/tmp/RtmpDK3s0n/remotes292552702801/Hemken-Statamarkdown-4581096/DESCRIPTION’ ... ─ preparing ‘Statamarkdown’: ✔ checking DESCRIPTION meta-information ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories ─ building ‘Statamarkdown_0.3.8.tar.gz’

Installing package into ‘/home/R/x86_64-pc-linux-gnu-library/3.4’ (as ‘lib’ is unspecified)

Hemken commented 5 years ago

Is Stata installed on the server where you are installing this package?

Doug Hemken

From: Lio21 notifications@github.com Sent: Tuesday, June 4, 2019 2:11 PM To: Hemken/Statamarkdown Statamarkdown@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Hemken/Statamarkdown] Ubuntu 18.04 installation issue (#3)

library(devtools) # before this you may need to install devtools install_github("hemken/Statamarkdown")

Downloading GitHub repo hemken/Statamarkdown@master ✔ checking for file ‘/tmp/RtmpDK3s0n/remotes292552702801/Hemken-Statamarkdown-4581096/DESCRIPTION’ ... ─ preparing ‘Statamarkdown’: ✔ checking DESCRIPTION meta-information ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories ─ building ‘Statamarkdown_0.3.8.tar.gz’

Installing package into ‘/home/livedrine/R/x86_64-pc-linux-gnu-library/3.4’ (as ‘lib’ is unspecified)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/Hemken/Statamarkdown/issues/3?email_source=notifications&email_token=ACYBME3VAWRQ62ERDE4YCWTPY2447A5CNFSM4HTADHI2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GXTNXMA, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACYBMEZQHY46ENNDELX62RTPY2447ANCNFSM4HTADHIQ.

Lio21 commented 5 years ago

Yes, Stata and R are installed on the same machine. I have tested on another machine (also in Ubuntu 18.04), with the same result.

Hemken commented 5 years ago

Sorry for the slow response.

It appears not to find Stata when it is loaded.

When you type which stata On the linux command line, how does it respond?

This is what I see when I install:

install.packages("~/R/Statamarkdown_0.3.8.tar.gz", type="source") Installing package into ‘/home/h/hemken/R/x86_64-redhat-linux-gnu-library/3.5’ (as ‘lib’ is unspecified) inferring 'repos = NULL' from 'pkgs'

  • installing source package ‘Statamarkdown’ ... R inst byte-compile and prepare package for lazy loading help *** installing help indices converting help for package ‘Statamarkdown’ finding HTML links ... done Statamarkdown-package html finding level-2 HTML links ... done
find_stata                              html
spinstata                               html
stata_engine                            html

building package indices installing vignettes ** testing if installed package can be loaded Stata found at /usr/local/stata/stata

From: Lio21 notifications@github.com Sent: Wednesday, June 5, 2019 11:25 AM To: Hemken/Statamarkdown Statamarkdown@noreply.github.com Cc: Doug Hemken dehemken@wisc.edu; Comment comment@noreply.github.com Subject: Re: [Hemken/Statamarkdown] Ubuntu 18.04 installation issue (#3)

Yes, Stata and R are installed on the same machine. I have tested on another machine (also in Ubuntu 18.04), with the same result.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/Hemken/Statamarkdown/issues/3?email_source=notifications&email_token=ACYBME3YOAJLT35GNNQKFHDPY7SD5A5CNFSM4HTADHI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXAII2Q#issuecomment-499156074, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACYBME2WNZMQ2QA2WDZBXZ3PY7SD5ANCNFSM4HTADHIQ.

Lio21 commented 5 years ago

when I type "which stata", I have: /usr/local/stata15/stata

Le jeu. 6 juin 2019 à 19:01, Doug Hemken notifications@github.com a écrit :

Sorry for the slow response.

It appears not to find Stata when it is loaded.

When you type which stata On the linux command line, how does it respond?

This is what I see when I install:

install.packages("~/R/Statamarkdown_0.3.8.tar.gz", type="source") Installing package into ‘/home/h/hemken/R/x86_64-redhat-linux-gnu-library/3.5’ (as ‘lib’ is unspecified) inferring 'repos = NULL' from 'pkgs'

  • installing source package ‘Statamarkdown’ ... R inst byte-compile and prepare package for lazy loading help *** installing help indices converting help for package ‘Statamarkdown’ finding HTML links ... done Statamarkdown-package html finding level-2 HTML links ... done

find_stata html spinstata html stata_engine html building package indices installing vignettes ** testing if installed package can be loaded Stata found at /usr/local/stata/stata

  • DONE (Statamarkdown)

From: Lio21 notifications@github.com Sent: Wednesday, June 5, 2019 11:25 AM To: Hemken/Statamarkdown Statamarkdown@noreply.github.com Cc: Doug Hemken dehemken@wisc.edu; Comment comment@noreply.github.com Subject: Re: [Hemken/Statamarkdown] Ubuntu 18.04 installation issue (#3)

Yes, Stata and R are installed on the same machine. I have tested on another machine (also in Ubuntu 18.04), with the same result.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub< https://github.com/Hemken/Statamarkdown/issues/3?email_source=notifications&email_token=ACYBME3YOAJLT35GNNQKFHDPY7SD5A5CNFSM4HTADHI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXAII2Q#issuecomment-499156074>, or mute the thread< https://github.com/notifications/unsubscribe-auth/ACYBME2WNZMQ2QA2WDZBXZ3PY7SD5ANCNFSM4HTADHIQ>.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Hemken/Statamarkdown/issues/3?email_source=notifications&email_token=AMIAPNJZRDDZH2UXAOUQHIDPZE7FDA5CNFSM4HTADHI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXDQFRI#issuecomment-499581637, or mute the thread https://github.com/notifications/unsubscribe-auth/AMIAPNN3YHYLVT2FYINB6G3PZE7FDANCNFSM4HTADHIQ .

Hemken commented 5 years ago

Thank you. I am able to reproduce the problem now. I’ll work on this.

From: Lio21 [mailto:notifications@github.com] Sent: Saturday, June 08, 2019 2:07 AM To: Hemken/Statamarkdown Cc: Doug Hemken; Comment Subject: Re: [Hemken/Statamarkdown] Ubuntu 18.04 installation issue (#3)

when I type "which stata", I have: /usr/local/stata15/stata

Hemken commented 5 years ago

I think this will install:

install.packages("https://www.ssc.wisc.edu/~hemken/Stataworkshops/Stata%20and%20R%20Markdown/Statamarkdown_0.3.9.tar.gz", type="source", repos=NULL)

From: Lio21 notifications@github.com Sent: Saturday, June 8, 2019 2:07 AM To: Hemken/Statamarkdown Statamarkdown@noreply.github.com Cc: Doug Hemken dehemken@wisc.edu; Comment comment@noreply.github.com Subject: Re: [Hemken/Statamarkdown] Ubuntu 18.04 installation issue (#3)

when I type "which stata", I have: /usr/local/stata15/stata

Le jeu. 6 juin 2019 à 19:01, Doug Hemken notifications@github.com a écrit :

Sorry for the slow response.

It appears not to find Stata when it is loaded.

When you type which stata On the linux command line, how does it respond?

This is what I see when I install:

install.packages("~/R/Statamarkdown_0.3.8.tar.gz", type="source") Installing package into ‘/home/h/hemken/R/x86_64-redhat-linux-gnu-library/3.5’ (as ‘lib’ is unspecified) inferring 'repos = NULL' from 'pkgs'

  • installing source package ‘Statamarkdown’ ... R inst byte-compile and prepare package for lazy loading help *** installing help indices converting help for package ‘Statamarkdown’ finding HTML links ... done Statamarkdown-package html finding level-2 HTML links ... done

find_stata html spinstata html stata_engine html building package indices installing vignettes ** testing if installed package can be loaded Stata found at /usr/local/stata/stata

  • DONE (Statamarkdown)

From: Lio21 notifications@github.com Sent: Wednesday, June 5, 2019 11:25 AM To: Hemken/Statamarkdown Statamarkdown@noreply.github.com Cc: Doug Hemken dehemken@wisc.edu; Comment comment@noreply.github.com Subject: Re: [Hemken/Statamarkdown] Ubuntu 18.04 installation issue (#3)

Yes, Stata and R are installed on the same machine. I have tested on another machine (also in Ubuntu 18.04), with the same result.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub< https://github.com/Hemken/Statamarkdown/issues/3?email_source=notifications&email_token=ACYBME3YOAJLT35GNNQKFHDPY7SD5A5CNFSM4HTADHI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXAII2Q#issuecomment-499156074>, or mute the thread< https://github.com/notifications/unsubscribe-auth/ACYBME2WNZMQ2QA2WDZBXZ3PY7SD5ANCNFSM4HTADHIQ>.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Hemken/Statamarkdown/issues/3?email_source=notifications&email_token=AMIAPNJZRDDZH2UXAOUQHIDPZE7FDA5CNFSM4HTADHI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXDQFRI#issuecomment-499581637, or mute the thread https://github.com/notifications/unsubscribe-auth/AMIAPNN3YHYLVT2FYINB6G3PZE7FDANCNFSM4HTADHIQ .

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/Hemken/Statamarkdown/issues/3?email_source=notifications&email_token=ACYBME5OLOXB56ILLKR2LPLPZNLC5A5CNFSM4HTADHI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXHPJ6Q#issuecomment-500102394, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACYBMEZZNIWFZFFNLHIGGBDPZNLC5ANCNFSM4HTADHIQ.

anhnguyendepocen commented 4 years ago

When I tried install.packages("https://www.ssc.wisc.edu/~hemken/Stataworkshops/Stata%20and%20R%20Markdown/Statamarkdown_0.3.9.tar.gz", type="source", repos=NULL) I get the following error:

================

Error: unexpected symbol in "Microsoft Windows" Execution halted ERROR: lazy loading failed for package 'Statamarkdown'

Hemken commented 4 years ago

I cannot reproduce this error. Both the .zip and the .tar.gz versions install without error for me. The symbol “Microsoft Windows” is not part of my source code.

From: Anh Nguyen from Lancaster [mailto:notifications@github.com] Sent: Thursday, February 20, 2020 4:22 AM To: Hemken/Statamarkdown Cc: Doug Hemken; Comment Subject: Re: [Hemken/Statamarkdown] Ubuntu 18.04 installation issue (#3)

When I tried install.packages("https://www.ssc.wisc.edu/~hemken/Stataworkshops/Stata%20and%20R%20Markdown/Statamarkdown_0.3.9.tar.gz", type="source", repos=NULL) I get the following error:

================

Error: unexpected symbol in "Microsoft Windows" Execution halted ERROR: lazy loading failed for package 'Statamarkdown'

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/Hemken/Statamarkdown/issues/3?email_source=notifications&email_token=ACYBMEY4E4JOIYDVFNB2JLTRDZKUFA5CNFSM4HTADHI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMNA3JI#issuecomment-588909989, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACYBME4WGMKQBPT6XBLULMTRDZKUFANCNFSM4HTADHIQ.

sagebiej commented 4 years ago

Hey, I am facing the same problem as Lio21. I am running R on Ubuntu 18.04.
The problem is obviously, that the package cannot locate the path of Stata (version 16). In the command line, which stata /usr/local/stata16/stata

it seems fine. Also execute and read permission are provided for all users and the package RStata also works fine.

I tried system2 directly in R (3.6.2)

> system2("which", "stata", stdout = TRUE) character(0) attr(,"status") [1] 1 Warning message: In system2("which", "stata", stdout = TRUE) : running command ''which' stata' had status 1

but others e.g. R work

> system2("which", "R", stdout = TRUE) [1] "/usr/bin/R"

Any ideas?

Thanks a lot for the help. The package seems awesome and I cant wait testing it.

Hemken commented 4 years ago

Can you send me the error messages from R when you try to install?

From: sagebiej notifications@github.com Sent: Friday, March 6, 2020 3:10 AM To: Hemken/Statamarkdown Statamarkdown@noreply.github.com Cc: Doug Hemken dehemken@wisc.edu; Comment comment@noreply.github.com Subject: Re: [Hemken/Statamarkdown] Ubuntu 18.04 installation issue (#3)

Hey, I am facing the same problem as Lio21. I am running R on Ubuntu 18.04. The problem is obviously, that the package cannot locate the path of Stata (version 16). In the command line, which stata /usr/local/stata16/stata

it seems fine. Also execute and read permission are provided for all users and the package RStata also works fine.

I tried system2 directly in R (3.6.2)

system2("which", "stata", stdout = TRUE) character(0) attr(,"status") [1] 1 Warning message: In system2("which", "stata", stdout = TRUE) : running command ''which' stata' had status 1

but others e.g. R work

system2("which", "R", stdout = TRUE) [1] "/usr/bin/R"

Any ideas?

Thanks a lot for the help. The package seems awesome and I cant wait testing it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/Hemken/Statamarkdown/issues/3?email_source=notifications&email_token=ACYBME3NEGVKBTUOAPLATFLRGC4X3A5CNFSM4HTADHI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOAUEDI#issuecomment-595673613, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACYBME3VCGRJILX2FOH6XUTRGC4X3ANCNFSM4HTADHIQ.

Hemken commented 4 years ago

Another thought:

Is there any difference between:

linux> printenv PATH

and

R> system2(“printenv”, “PATH”)

From: sagebiej notifications@github.com Sent: Friday, March 6, 2020 3:10 AM To: Hemken/Statamarkdown Statamarkdown@noreply.github.com Cc: Doug Hemken dehemken@wisc.edu; Comment comment@noreply.github.com Subject: Re: [Hemken/Statamarkdown] Ubuntu 18.04 installation issue (#3)

Hey, I am facing the same problem as Lio21. I am running R on Ubuntu 18.04. The problem is obviously, that the package cannot locate the path of Stata (version 16). In the command line, which stata /usr/local/stata16/stata

it seems fine. Also execute and read permission are provided for all users and the package RStata also works fine.

I tried system2 directly in R (3.6.2)

system2("which", "stata", stdout = TRUE) character(0) attr(,"status") [1] 1 Warning message: In system2("which", "stata", stdout = TRUE) : running command ''which' stata' had status 1

but others e.g. R work

system2("which", "R", stdout = TRUE) [1] "/usr/bin/R"

Any ideas?

Thanks a lot for the help. The package seems awesome and I cant wait testing it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/Hemken/Statamarkdown/issues/3?email_source=notifications&email_token=ACYBME3NEGVKBTUOAPLATFLRGC4X3A5CNFSM4HTADHI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOAUEDI#issuecomment-595673613, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACYBME3VCGRJILX2FOH6XUTRGC4X3ANCNFSM4HTADHIQ.

sagebiej commented 4 years ago

Can you send me the error messages from R when you try to install?

It is exactly the same as from Lio21

Another thought: Is there any difference between: linux> printenv PATH and R> system2(“printenv”, “PATH”)

Yes, this is actually different

Terminal:

julian@Tiger:~$ printenv PATH
/home/julian/bin:/usr/local/stata16:/usr/local/MATLAB/R2019b/bin:/home/julian/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

in R:

system2("printenv" , "PATH")
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

So the PATH from R does not contain my Stata folder, which should explain the issue.

In the meantime i found a workaround, which, however is not very elegant. I created a symbolic link in /usr/bin to my Stata folder, and put it at the very beginning of PATH. Then it worked. But not a very nice solution.

Just as a suggestion. In the package RStata, you let R know where the Stata file is in the options(). And you can add it after package installation. This may also solve the problem.

Hemken commented 4 years ago

I agree with your suggestion. My package tries to build vignettes, using Stata, when it is installed. I see now this is a mistake, because if Stata is not found automatically the vignettes fail to build and the whole installation fails. I need to go back to the older method of vignette building so that Stata is not needed for installation. Once installed, one can always code in the Stata executable location, like with RStata.

From: sagebiej notifications@github.com Sent: Friday, March 6, 2020 1:56 PM To: Hemken/Statamarkdown Statamarkdown@noreply.github.com Cc: Doug Hemken dehemken@wisc.edu; Comment comment@noreply.github.com Subject: Re: [Hemken/Statamarkdown] Ubuntu 18.04 installation issue (#3)

Can you send me the error messages from R when you try to install?

It is exactly the same as from Lio21

Another thought: Is there any difference between: linux> printenv PATH and R> system2(“printenv”, “PATH”)

Yes, this is actually different

Terminal:

julian@Tiger:~$ printenv PATH

/home/julian/bin:/usr/local/stata16:/usr/local/MATLAB/R2019b/bin:/home/julian/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

in R:

system2("printenv" , "PATH")

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

So the PATH from R does not contain my Stata folder, which should explain the issue.

In the meantime i found a workaround, which, however is not very elegant. I created a symbolic link in /usr/bin to my Stata folder, and put it at the very beginning of PATH. Then it worked. But not a very nice solution.

Just as a suggestion. In the package RStata, you let R know where the Stata file is in the options(). And you can add it after package installation. This may also solve the problem.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/Hemken/Statamarkdown/issues/3?email_source=notifications&email_token=ACYBME7JKECWA7TEGC4QBGTRGFILNA5CNFSM4HTADHI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOCVFYA#issuecomment-595940064, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACYBME3HOUED3LAKXPGYR5DRGFILNANCNFSM4HTADHIQ.

Crismoc commented 4 years ago

I just would like to check, is there any solution for installing Statamarkdown when this happens? I have the same issue described above using Ubuntu 20.04. @sagebiej could you give a more detailed description of your workaround? Thanks!

sagebiej commented 4 years ago

The workaround is pretty easy.

Hope that helps...

Hemken commented 4 years ago

Let me know whether or not this works, and if not, where Stata is located on your system

From: sagebiej notifications@github.com Sent: Friday, September 4, 2020 2:29 AM To: Hemken/Statamarkdown Statamarkdown@noreply.github.com Cc: Doug Hemken dehemken@wisc.edu; Comment comment@noreply.github.com Subject: Re: [Hemken/Statamarkdown] Ubuntu 18.04 installation issue (#3)

The workaround is pretty easy.

Hope that helps...

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/Hemken/Statamarkdown/issues/3#issuecomment-686968771, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACYBMEZZE46JOLTTCG4X4FTSECJNBANCNFSM4HTADHIQ.

Crismoc commented 4 years ago

Great, thank you very much @sagebiej. The workaround works