Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli_* functions - can not be found / are not exported? #94

Closed
combiz opened this issue Oct 15, 2019 · 16 comments
Closed

cli_* functions - can not be found / are not exported? #94

combiz opened this issue Oct 15, 2019 · 16 comments

Comments

@combiz
Copy link

combiz commented Oct 15, 2019

After installing from CRAN, the cli_* functions can not be found / are not exported?

> library(cli)
> cli_alert_success()
Error in cli_alert_success() : 
  could not find function "cli_alert_success"
> lsf.str("package:cli")
ansi_hide_cursor : function (stream = stderr())  
ansi_show_cursor : function (stream = stderr())  
ansi_with_hidden_cursor : function (expr, stream = stderr())  
bg_black : function (...)  
bg_blue : function (...)  
bg_cyan : function (...)  
bg_green : function (...)  
bg_magenta : function (...)  
bg_red : function (...)  
bg_white : function (...)  
bg_yellow : function (...)  
boxx : function (label, border_style = "single", padding = 1, margin = 0, float = c("left", "center", "right"), col = NULL, background_col = NULL, border_col = col, align = c("left", 
    "center", "right"), width = console_width())  
cat_boxx : function (..., file = stdout())  
cat_bullet : function (..., col = NULL, background_col = NULL, bullet = "bullet", bullet_col = NULL, file = stdout())  
cat_line : function (..., col = NULL, background_col = NULL, file = stdout())  
cat_print : function (x, file = "")  
cat_rule : function (..., file = stdout())  
cli_sitrep : function ()  
col_black : function (...)  
col_blue : function (...)  
col_cyan : function (...)  
col_green : function (...)  
col_grey : function (...)  
col_magenta : function (...)  
col_red : function (...)  
col_silver : function (...)  
col_white : function (...)  
col_yellow : function (...)  
combine_ansi_styles : function (...)  
console_width : function ()  
demo_spinners : function (which = NULL)  
get_spinner : function (which = NULL)  
is_ansi_tty : function (stream = stderr())  
is_dynamic_tty : function (stream = stderr())  
is_utf8_output : function ()  
list_border_styles : function ()  
list_spinners : function ()  
make_ansi_style : function (..., bg = FALSE, grey = FALSE, colors = crayon::num_colors())  
make_spinner : function (which = NULL, stream = stderr(), template = "{spin}", static = c("dots", "print", "print_line", "silent"))  
rule : function (left = "", center = "", right = "", line = 1, col = NULL, line_col = col, background_col = NULL, width = console_width())  
style_blurred : function (...)  
style_bold : function (...)  
style_dim : function (...)  
style_hidden : function (...)  
style_inverse : function (...)  
style_italic : function (...)  
style_reset : function (...)  
style_strikethrough : function (...)  
style_underline : function (...)  
tree : function (data, root = data[[1]][[1]], style = NULL, width = console_width()) 
@gaborcsardi
Copy link
Member

The GitHub version is newer.

@RobertMyles
Copy link

RobertMyles commented Nov 14, 2019

I'm also having this problem, and I have the latest (GitHub) version:

> packageVersion("cli")
[1] ‘1.9.9.9000
> cli::cli_alert_success()
Error: 'cli_alert_success' is not an exported object from 'namespace:cli'
> lsf.str("package:cli")
ansi_hide_cursor : function (stream = stderr())  
ansi_show_cursor : function (stream = stderr())  
ansi_with_hidden_cursor : function (expr, stream = stderr())  
bg_black : function (...)  
bg_blue : function (...)  
bg_cyan : function (...)  
bg_green : function (...)  
bg_magenta : function (...)  
bg_red : function (...)  
bg_white : function (...)  
bg_yellow : function (...)  
boxx : function (label, border_style = "single", padding = 1, margin = 0, float = c("left", "center", "right"), col = NULL, background_col = NULL, 
    border_col = col, align = c("left", "center", "right"), width = console_width())  
cat_boxx : function (..., file = stdout())  
cat_bullet : function (..., col = NULL, background_col = NULL, bullet = "bullet", bullet_col = NULL, file = stdout())  
cat_line : function (..., col = NULL, background_col = NULL, file = stdout())  
cat_print : function (x, file = "")  
cat_rule : function (..., file = stdout())  
cli_sitrep : function ()  
col_black : function (...)  
col_blue : function (...)  
col_cyan : function (...)  
col_green : function (...)  
col_grey : function (...)  
col_magenta : function (...)  
col_red : function (...)  
col_silver : function (...)  
col_white : function (...)  
col_yellow : function (...)  
combine_ansi_styles : function (...)  
console_width : function ()  
demo_spinners : function (which = NULL)  
get_spinner : function (which = NULL)  
is_ansi_tty : function (stream = stderr())  
is_dynamic_tty : function (stream = stderr())  
is_utf8_output : function ()  
list_border_styles : function ()  
list_spinners : function ()  
make_ansi_style : function (..., bg = FALSE, grey = FALSE, colors = crayon::num_colors())  
make_spinner : function (which = NULL, stream = stderr(), template = "{spin}", static = c("dots", "print", "print_line", "silent"))  
rule : function (left = "", center = "", right = "", line = 1, col = NULL, line_col = col, background_col = NULL, width = console_width())  
style_blurred : function (...)  
style_bold : function (...)  
style_dim : function (...)  
style_hidden : function (...)  
style_inverse : function (...)  
style_italic : function (...)  
style_reset : function (...)  
style_strikethrough : function (...)  
style_underline : function (...)  
tree : function (data, root = data[[1]][[1]], style = NULL, width = console_width())  

Edit: I see you've moved them to cliapp. Maybe it's just a documentation issue on the README then.

@gaborcsardi
Copy link
Member

gaborcsardi commented Nov 14, 2019 via email

@RobertMyles
Copy link

Strange, I had removed the GH version and re-installed the CRAN version since I last posted. I've just run remotes::install_github("r-lib/cli") (which is what I had done earlier today) and now the cli_alert_* functions are available!

Output of session_info():

> sessioninfo::session_info()
─ Session info ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.5.0 (2018-04-23)
 os       macOS  10.14.6              
 system   x86_64, darwin15.6.0        
 ui       RStudio                     
 language (EN)                        
 collate  en_IE.UTF-8                 
 ctype    en_IE.UTF-8                 
 tz       Europe/Dublin               
 date     2019-11-14Packages ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package     * version    date       lib source                      
 assertthat    0.2.1      2019-03-21 [1] CRAN (R 3.5.2)              
 backports     1.1.5      2019-10-02 [1] CRAN (R 3.5.2)              
 cli         * 1.9.9.9000 2019-11-14 [1] Github (r-lib/cli@ad6410a)  
 crayon        1.3.4      2017-09-16 [1] CRAN (R 3.5.0)              
 fansi         0.4.0      2018-10-05 [1] CRAN (R 3.5.0)              
 glue          1.3.1      2019-03-12 [1] CRAN (R 3.5.2)              
 hms           0.5.2      2019-10-30 [1] CRAN (R 3.5.0)              
 magrittr      1.5        2014-11-22 [1] CRAN (R 3.5.0)              
 pillar        1.4.2      2019-06-29 [1] CRAN (R 3.5.2)              
 pkgconfig     2.0.3      2019-09-22 [1] CRAN (R 3.5.2)              
 prettyunits   1.0.2      2015-07-13 [1] CRAN (R 3.5.0)              
 progress      1.2.2      2019-05-16 [1] CRAN (R 3.5.2)              
 R6            2.4.1      2019-11-12 [1] CRAN (R 3.5.2)              
 rlang         0.4.1      2019-10-24 [1] CRAN (R 3.5.0)              
 rstudioapi    0.10       2019-03-19 [1] CRAN (R 3.5.2)              
 sessioninfo   1.1.1      2018-11-05 [1] CRAN (R 3.5.0)              
 tibble        2.1.3      2019-06-06 [1] CRAN (R 3.5.2)              
 vctrs         0.2.0.9007 2019-11-14 [1] Github (r-lib/vctrs@390bc5a)
 withr         2.1.2      2018-03-15 [1] CRAN (R 3.5.0)              
 zeallot       0.1.0      2018-01-28 [1] CRAN (R 3.5.0)              

[1] /Library/Frameworks/R.framework/Versions/3.5/Resources/library

@gaborcsardi
Copy link
Member

Reinstalling a package does not reload it. You probably still had the old version loaded.

@RobertMyles
Copy link

Probably something like that. Ok, thanks for your time, Gábor!

@Financebro1
Copy link

Financebro1 commented Feb 3, 2021

Hey i also have a problem with Error: 'cli_h1' is not an exported object from 'namespace:cli',

I cant seem to figure out the problem. Thanks for any help!

Here is my code:

library(tidyverse)
library(tidyquant)

options("getSymbols.warning4.0"=FALSE)
options("getSymbols.yahoo.warning"=FALSE)

Downloading Apple price using quantmod

getSymbols("AAPL", from = '2017-01-01',
to = "2018-03-01",warnings = FALSE,
auto.assign = TRUE)
head(AAPL)

class(AAPL)
chart_Series(AAPL)
chart_Series(AAPL['2017-12/2018-03'])
tickers = c("AAPL", "NFLX", "AMZN", "K", "O")

getSymbols(tickers,
from = "2017-01-01",
to = "2017-01-15")
prices <- map(tickers,function(x) Ad(get(x)))
prices <- reduce(prices,merge)
colnames(prices) <- tickers
head(prices)
class(prices)

aapl <- tq_get('AAPL',
from = "2017-01-01",
to = "2018-03-01",
get = "stock.prices")

@Robinlovelace
Copy link

Also seeing this issue pop up in the latest version, generating the following error message:

Error: Error: 'col_ed' is not an exported object from 'namespace:cli'

Reproducible example from GitHub Actions: https://github.com/zonebuilders/zonebuilder/runs/2312217732#step:9:64

@Robinlovelace
Copy link

FYI that issue seems to have been fixed with this: zonebuilders/zonebuilder@9f172ee

@maelle
Copy link

maelle commented Apr 12, 2021

I am seeing the same error as @Robinlovelace

@gaborcsardi
Copy link
Member

The real (first) error is

Running git push --force origin 'HEAD:gh-pages'
remote: fatal error in commit_refs        
To zonebuilders/zonebuilder
 ! [remote rejected] HEAD -> gh-pages (failure)
error: failed to push some refs to 'zonebuilders/zonebuilder'

and then some package that uses cli fails to print the error message.

@hongooi73
Copy link

Ditto, here: https://github.com/Azure/AzureGraph/runs/2428049370?check_suite_focus=true

It looks like knitr is failing to be installed, and that triggers the error. It looks like rcmdcheck::rcmdcheck is the calling function, but I can't see where it references col_ed....

@statneutrino
Copy link

statneutrino commented Apr 27, 2021

Also seeing this issue pop up in the latest version, generating the following error message:

Error: Error: 'col_ed' is not an exported object from 'namespace:cli'

Reproducible example from GitHub Actions: https://github.com/zonebuilders/zonebuilder/runs/2312217732#step:9:64

I am getting the same message, but when running brms models through cmdstanr usign Rscript.exe

@peetmate
Copy link

is there a col_ed function in cli? shouldn't col_red be called?
I have the same issue as above it is killing me.

@gaborcsardi
Copy link
Member

@peetmate The col_ed error happens when trying to print the real error message. Look for the real error that probably precedes it.

@aleruete
Copy link

I had the same issue and figured out it had to do with a totally unrelated issue in my markdown. In my case I was trying to set a color palette
palBW <- leaflet::colorNumeric(palette = c("white", "navyblue"), domain = c(0, max(mydata, na.rm = TRUE)), na.color = "transparent")
but mydata was a character vector.

but it may be something else that is triggering the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants