koenderks / rcityviews

rcityviews is a user-friendly R interface for creating stylized city maps using OpenStreetMap (www.openstreetmap.org) data, implemented as an R package and a Shiny web application.
https://koenderks.github.io/rcityviews/
GNU General Public License v3.0
163 stars 22 forks source link

Failed to install on windows #23

Closed SpatLyu closed 3 months ago

SpatLyu commented 3 months ago

Describe the bug I found that it is not possible to install this package on windows, using devtools::install() shows that there is a case of calling widgets.js API, please check it?

To Reproduce Go to the package source code and run devtools::install() image

Desktop :

sessionInfo()
#> R version 4.4.1 (2024-06-14 ucrt)
#> Platform: x86_64-w64-mingw32/x64
#> Running under: Windows 11 x64 (build 22631)
#> 
#> Matrix products: default
#> 
#> 
#> locale:
#> [1] LC_COLLATE=Chinese (Simplified)_China.utf8 
#> [2] LC_CTYPE=Chinese (Simplified)_China.utf8   
#> [3] LC_MONETARY=Chinese (Simplified)_China.utf8
#> [4] LC_NUMERIC=C                               
#> [5] LC_TIME=Chinese (Simplified)_China.utf8    
#> 
#> time zone: Asia/Shanghai
#> tzcode source: internal
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] digest_0.6.36     fastmap_1.2.0     xfun_0.46         glue_1.7.0       
#>  [5] knitr_1.48        htmltools_0.5.8.1 rmarkdown_2.27    lifecycle_1.0.4  
#>  [9] cli_3.6.3         reprex_2.1.1      withr_3.0.0       compiler_4.4.1   
#> [13] rstudioapi_0.16.0 tools_4.4.1       evaluate_0.24.0   yaml_2.3.9       
#> [17] rlang_1.1.4       fs_1.6.4

Created on 2024-07-23 with reprex v2.1.1

SpatLyu commented 3 months ago

Have you ever released binary versions of the rcityviews package on r-universe for any major platforms,@koenderks

koenderks commented 3 months ago

I don't have a windows pc myself (I have a mac) but I will see if I can get hands on one to test this. I have never released any binary versions of the package, it only lives on github. Could the timeout be related to the internet connection, or maybe the fact that twitter is now X?

SpatLyu commented 3 months ago

The PR I want to submit mainly has three aspects:

SpatLyu commented 3 months ago

I don't have a windows pc myself (I have a mac) but I will see if I can get hands on one to test this. I have never released any binary versions of the package, it only lives on github. Could the timeout be related to the internet connection, or maybe the fact that twitter is now X?

Fair enough, does this have anything to do with automated github bots; Also, I have a windows PC and I can help you with this

SpatLyu commented 3 months ago

I don't have a windows pc myself (I have a mac) but I will see if I can get hands on one to test this. I have never released any binary versions of the package, it only lives on github. Could the timeout be related to the internet connection, or maybe the fact that twitter is now X?

@koenderks ,I can access http://platform.twitter.com/widgets.js, Can you tell me where this js interface is used?

SpatLyu commented 3 months ago

The problem arises from functions related to shiny, and the first step should be to replace https://platform.twitter.com/widgets.js with http://platform.twitter.com/widgets.js

SpatLyu commented 3 months ago

After changing the Twitter JS API call address, I now have a second issue related to Shiny, as shown in the figure below: image

koenderks commented 3 months ago

Strange...Just out of curiosity, is there any error when you install the package via remotes from github, as specified in the readme.md file?

koenderks commented 3 months ago

I don't have a windows pc myself (I have a mac) but I will see if I can get hands on one to test this. I have never released any binary versions of the package, it only lives on github. Could the timeout be related to the internet connection, or maybe the fact that twitter is now X?

@koenderks ,I can access http://platform.twitter.com/widgets.js, Can you tell me where this js interface is used?

It is used in the shiny app accompanying the package, in the interface. But this can probably be removed, as it is not that important.

SpatLyu commented 3 months ago

Strange...Just out of curiosity, is there any error when you install the package via remotes from github, as specified in the readme.md file?

It has been stuck in the byte-compile and prepare package for lazy loading state and cannot be installed normally.

SpatLyu commented 3 months ago

Strange...Just out of curiosity, is there any error when you install the package via remotes from github, as specified in the readme.md file?

If devtools::install() works, then devtools::install_github() in the R terminal will also work; but devtools::install() did not install properly when I tested it. Can it be installed normally on Mac now?

SpatLyu commented 3 months ago

Strange...Just out of curiosity, is there any error when you install the package via remotes from github, as specified in the readme.md file?

I suggest we deploy the rcityviews package on r-universe to test different operating systems

SpatLyu commented 3 months ago

@koenderks Now I have passed the test on my PC, and I submit the PR to you

koenderks commented 3 months ago

If devtools::install() works, then devtools::install_github() in the R terminal will also work; but devtools::install() did not install properly when I tested it. Can it be installed normally on Mac now?

I just tested if I could install the package on a Windows pc using remotes::install_github(), that worked fine. It also works fine on my Mac using both devtools::install_github() and remotes::install_github(). It also works fine when downloading the source code (.tar.gz) and using devtools::install() on my Mac.

SpatLyu commented 3 months ago

Ah, let me test it again

SpatLyu commented 3 months ago

If devtools::install() works, then devtools::install_github() in the R terminal will also work; but devtools::install() did not install properly when I tested it. Can it be installed normally on Mac now?

I just tested if I could install the package on a Windows pc using remotes::install_github(), that worked fine. It also works fine on my Mac using both devtools::install_github() and remotes::install_github(). It also works fine when downloading the source code (.tar.gz) and using devtools::install() on my Mac.

image

I'm still stuck at this stage, it's been more than 5 minutes so far, this step shouldn't take long (other R packages I wrote won't get stuck here)

SpatLyu commented 3 months ago

After I made a few changes, it can be installed normally on my PC.

image

Maybe because my Internet is not so stable in China?

SpatLyu commented 3 months ago

It's great, and it works on my PC right now

image

Thank you for putting up with my tireless interruptions

koenderks commented 3 months ago

Good to hear, thanks for your contribution! 😃