shinyapps.io deployment error -- incomplete final line found by readTableHeader AND The directory C:/Users/user/Documents cannot be deployed because it contains too many files (the maximum number of files is 10000)

split from Error to shinyApp because of reticulate


Hello I also have a similar problem.
I would like to transcript an audio. I'm doing it using the Python module azure-cognitiveservices-speech. I would like to use it in a demo. For that, I used the package reticulate to transform Python in R. I did a shiny demo which woks very well locally but when I wat to deploy it with shinyapps.io, it doesn't work. In the beginning I had the same error message than @j.lei2821 but I tried many things an d finally, I don't have the same error message.

That's some of my code:

library(reticulate)
reticulate::use_python("C:\Users\user\AppData\Local\Continuum\anaconda3", required = TRUE)
speechsdk <- import('azure.cognitiveservices.speech')
speech_config = speechsdk$SpeechConfig("ce3ec1153ba14deab068e45cb02d6c38","westus",
speech_recognition_language="fr-FR")
get_audio_tag<-function(filename){
tags$audio(src = filename, type = "audio/wav",
autostart = F, controls = T)
}

ui
server

setwd("C:\Users\user\Documents\R\win-library\3.5\shiny\www") # I wrote this line in order that we can listen to the audio even when I open the app in a web browser.

The browser open itself and the following message is wrote :
Error in value[[3L]](cond) : Specified version of python 'C:\Users\user\AppData\Local\Continuum\anaconda3' does not exist. Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> Execution halted

And in the tab deploy on Rstudio, it's wrotten :
Preparing to deploy application...DONE
Uploading bundle for application: 835787...Detecting system locale ... DONE
Deploying bundle: 1989068 for application: 835787 ...
Waiting for task: 601962607
building: Parsing manifest
building: Building image: 2088294
building: Installing system dependencies
building: Fetching packages
building: Installing packages
building: Installing files
building: Pushing image: 2088294
deploying: Starting instances
terminating: Stopping old instances
Application successfully deployed to ttps://laur.shinyapps.io/final/
Deployment completed: ttps://laur.shinyapps.io/final/
Warning message:
Error detecting locale: Error in read.table(file = file, header = header, sep = sep, quote = quote, : incomplete final line found by readTableHeader on 'raw'
(Using default: en_US)

I'm working on Windows, with Python 3.7 and Rstudio.

I have that :
rsconnect:::systemInfo()
Error in read.table(file = file, header = header, sep = sep, quote = quote, :
incomplete final line found by readTableHeader on 'raw'

and that
rsconnect::appDependencies()
Error in bundleFiles(appDir) :
The directory C:/Users/user/Documents cannot be deployed because it contains too many files (the maximum number of files is 10000). Remove some files or adjust the rsconnect.max.bundle.files option.

Thanks for helping

Based on the information you've given, the key errors are highlighted below

Did you intend to deploy a directory with >10,000 files? That's impressive!!

I would take a close look at the file producing the read.table, there might be an errant symbol, or you might use a function better able to handle this kind of file (e.g. something from readr or other).

Thanks for your answer. I don't have anymore the second error. But the first stayed. I don't really know what change, because I didn't use a function from readr. When it is deployed in the browser, I have the following page


or if I change the path in the function use_python, I rather have :
Error in value[[3L]](cond) : Specified version of python 'C:\Users\user\AppData\Local\Continuum\anaconda3' does not exist. Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> Execution halted.
It seems to me that I have a problem in using python or a module not usual...

Thanks for your help

In the error from your screenshot, it seems that the python module are not installed or just not found.

This path won't be found on the server. Python is available on shinyapps.io
https://support.rstudio.com/hc/en-us/articles/226905928-Can-I-use-Python-on-shinyapps-io-
it should be found on its own and I guess python package you need should be installed when deploy if you followed the advice for installation. See

1 Like