I recently installed riskfolio-fin and started working through some of the example notebooks on the github page. Import data, data prep all work, but as soon as I hit a piece of code requiring a call to riskfolio-fin either the kernal dies or spins for an hour.
I've checked all of the required dependencies and it looks good.
I am trying to run the code from the following notebook- BL Optimization and constantly get hung or dead kernal on In[9] in section 2.3.
Any ideas as to why the code won't execute?
UPDATE I tried to replicate other example notebooks and the Hierarchical Equal Risk Contribution (HERC) Portfolio Optimization and Mean Risk Portfolio Optimization using historical estimates worked fine. Still failing on the original model listed in the note.
It looks like the root cause has to do with calls using the port.optimization(model=model, rm=rm, obj=obj, rf=rf, l=l, hist=hist) where some models seem to work but some don't. Sounds like it must be a dependency issue, but I can't figure out what it could be.
RESOLUTION - turns out to be the dependency on cvxpy. I removed and reinstalled and it fixed the issue.
MY STEPS TO SOLVE THIS PROBLEM OF RISKFOLIO-LIB:
pip uninstall ffn
jupyter notebook --generate-config
conda update --all
Related
I've searched for tutorials to help configure the package in my PC, and I've found this one: https://www.youtube.com/watch?v=_fDhRL_LBdQ
I executed every part of the code interactively with the tutorial, but when I run ee_install() (after installing miniconda with py_discover_config() and other packages previously, such as reticulate), but it keeps me returning an error saying that anaconda is mandatory for the package since I'm a windows user.
Here is the error I get:
Error in ee_install_set_pyenv_env(py_env = py_env, py_path = python_path, : Windows users must install miniconda/anaconda to use rgee. The use of a Python environment is mandatory.
I've just installed Anaconda (full version with navigator) and I set a new python environment called "py2r" and tried to use the function ee_install_set_pyenv(), passing the path to the environment created through Anaconda Navigator (which has a python.exe) as paremeter to py_path and the name "py2r" as paremeter for py_env arg. And yet, it didn't work.
What am I missing?
In case you want to take a look at the code, I can provide it, but I don't think it's necessary because is a simple test script that follows as I described.
Thanks for your attention and congratulations for the library, it will be very usefull for me at work!
I fixed the ee_install() problems bypassing them and doing every passage manually. It will require no more then 10 mins and you will probably fix the installation problems. You can find and follow the manual installation with this tutorial:
https://www.youtube.com/watch?v=1-k6wNL2hlo
Since this morning, every graph that I've generated get all the numbers and characters transformed in strange characters (like a squared zero).
After ggplot, I tried with plot and get the same error.
The reproductible example is : plot(c(1,2,3)). I get this graph :
I use a session connected to RStudio Server.
I tried to restart my session, to use another session (another profile without any packages), to restart RStudio Server and to restart the server. I also tried to reinstall R. I still get the same problem.
How can I solve this problem ?
My colleague finally solved the problem.
The problem was a missing libpango1.0-0 library (that was removed when upgrading a bunch of packages to their debian stretch version on a debian jessie system to have an up-to-date libgdal library so that the r-gdal package could be used).
A bit frustrated right now. I have an R project that I built several weeks ago that I have not touched in those weeks. Come back to R Studio to do some debugging, and it will not rebuild the package. When I run the Check command from within the RStudio UI, the error I get is:
Error: Check failed: 'P:\MosaicPA\R Packages/Mosaic.VoronoiV2.Rcheck' doesn't exist
Execution halted
Exited with status 1.
When I try the Install and Restart option, I get this error:
==> Rcmd.exe INSTALL --no-multiarch --with-keep.source Mosaic.VoronoiV2
Warning: invalid package 'Mosaic.VoronoiV2'
Error: ERROR: no packages specified
Exited with status 1.
I have not seen these messages before, and cannot figure out what I am doing wrong, since nothing has changed.
I am not new to programming, but I am new-ish to the R environment. Cannot figure out what has changed, and I dont know what the .Rcheck file is, and I dont know why R doesnt create it. None of my other projects have a .Rcheck file or directory, and I dont know if this is supposed to be a file or directory. I have tried creating the project from scratch. Same issue.
Using R 3.4.1 and the latest R Studio version.
Well, Windows permissions strikes again...personally, I find Windows to be a HUGE POS because of stuff like this. Problem resolved after I reinstalled R under my domain account...I was suspicious of this, but couldn't find a way to confirm. Just reinstalled R and it worked. What I really wish is that when it IS a permissions problem, that Windows would report it as such, so the software can tell the end user this, vs sending us down some rabbit hole, chasing some non-existent problem, which happens too much as it is. Thanks, Redmond! But...I understand...after all, MS is too busy working on the next emoji standard...which is a priority, so who has time to make the OS better. End of rant.
I want to view an image in Jupyter notebook. It's a 9.9MB .png file.
from IPython.display import Image
Image(filename='path_to_image/image.png')
I get the below error:
IOPub data rate exceeded.
The notebook server will temporarily stop sending output
to the client in order to avoid crashing it.
A bit surprising and reported elsewhere.
Is this expected and is there a simple solution?
(Error msg suggests changing limit in --NotebookApp.iopub_data_rate_limit.)
Try this:
jupyter notebook --NotebookApp.iopub_data_rate_limit=1.0e10
Or this:
yourTerminal:prompt> jupyter notebook --NotebookApp.iopub_data_rate_limit=1.0e10
I ran into this using networkx and bokeh
This works for me in Windows 7 (taken from here):
To create a jupyter_notebook_config.py file, with all the defaults commented out, you can use the following command line:
$ jupyter notebook --generate-config
Open the file and search for c.NotebookApp.iopub_data_rate_limit
Comment out the line c.NotebookApp.iopub_data_rate_limit = 1000000 and change it to a higher default rate. l used c.NotebookApp.iopub_data_rate_limit = 10000000
This unforgiving default config is popping up in a lot of places. See git issues:
jupyter
IOPub data rate exceeded
It looks like it might get resolved with the 5.1 release
Update:
Jupyter notebook is now on release 5.2.2. This problem should have been resolved. Upgrade using conda or pip.
Removing print statements can also fix the problem.
Apart from loading images, this error also happens when your code is printing continuously at a high rate, which is causing the error "IOPub data rate exceeded". E.g. if you have a print statement in a for loop somewhere that is being called over 1000 times.
By typing 'jupyter notebook --NotebookApp.iopub_data_rate_limit=1.0e10' in Anaconda PowerShell or prompt, the Jupyter notebook will open with the new configuration. Try now to run your query.
Some additional advice for Windows(10) users:
If you are using Anaconda Prompt/PowerShell for the first time, type "Anaconda" in the search field of your Windows task bar and you will see the suggested software.
Make sure to open the Anaconda prompt as administrator.
Always navigate to your user directory or the directory with your Jupyter Notebook files first before running the command. Otherwise you might end up somewhere in your system files and be confused by an unfamiliar file tree.
The correct way to open Jupyter notebook with new data limit from the Anaconda Prompt on my own Windows 10 PC is:
(base) C:\Users\mobarget\Google Drive\Jupyter Notebook>jupyter notebook --NotebookApp.iopub_data_rate_limit=1.0e10
I have the same problem in my Jupyter NB on Win 10 when querying from a MySQL database.
Removing any print statements solved my problem.
For already running docker containers, try editing the file name - ~/.jupyter/jupyter_notebook_config.py
uncomment the line - NotebookApp.iopub_data_rate_limit =
and set high number like 1e10.
Restart the docker, it should fix the problem
I ran into this problem running version 6.3.0. When I tried the top rated solution by Merlin the powershell prompt notified me that iopub_data_rate_limit has moved from NotebookApp to ServerApp. The solution still worked but wanted to mention the variation, especially as internal handling of the config may become deprecated.
Easy workaround is to create a for loop and print. Then there wont be any issue. Printing directly wcc would cause if graph is huge. Hence any of below code will work as workaround.
wcc=list(nx.weakly_connected_components(train_graph))
for i in range(1,10):
print(wcc[i])
for i in wcc):
print(wcc)
Like others pointed out, print statement at a high rate can cause this. Resolve it by printing modulo a number using if statement. Example in python:
k = 10
if (i % k == 0):
print("Something")
Increase k if the warning persists.
Using Visual Studio Code, the Jupyter extension will be able to handle big data. launch from anaconda navigator
In general, trying to print something that is too long will trigger this error. I tried to print a string that was 9221593 characters long (too long), and that triggered the error.
When I require(gWidgetstcktk), I get an infinite loop, with a seemingly endless number of error messages that look like this:
error reading package index file /Library/Frameworks/R.framework/Versions/2.14/Resources/library/tcltk2/tklibs/ttktheme_clearlooks/pkgIndex.tcl: can't find package tile
error reading package index file /Library/Frameworks/R.framework/Versions/2.14/Resources/library/tcltk2/tklibs/ttktheme_clearlooks/pkgIndex.tcl: too many nested evaluations (infinite loop?)
(On each iteration the path is different. The end of these messages seem to be the important parts: can't find package tile and too many nested evaluations (infinite loop?)
I installed the packages as usual using install.package() and the files referred to seem to be present. gWidgets seems to load just fine. I'm running R 2.14.1 via RStudio 0.96.231 on OSX 10.7.4. What is going wrong here?
Update: I now see that the problem is coming from the tcltk2 package.
That shouldn't happen. First off, I'd say try uninstalling the package and then re-installing it. There might have been an error during the process. Another thing you should do is select "Install All Dependencies" when you do this (or install.packages(______, dependencies = TRUE)). Have you installed all of the package's relevant dependencies? Perhaps this library requires a different library which you don't have.