Running sphinx with nbsphinx - jupyter-notebook

I'm just getting started with sphinx, and sucessfully built html pages from .rst files with the command
$ sphinx-build -b html source build
Since my goal is to create pages from Jupyter notebooks, I would like to work with nbsphinx. However, if I try to run mentioned command after adding nbsphinx to the extension of conf.py, I get following error message
Could not import extension nbsphinx (exception: No module named 'sphinx.transforms.post_transforms')
I have installed nbsphinx, as conda list shows
(dummy) C:\Users\rata\someproject conda list
...
nbsphinx 0.4.3 py_0 conda-forge
...
What am I doing wrong?

Apparently, I the issue was with the sphinx version. I was using version 1.5.1, after updating to 2.2.0 everything worked fine!

Related

libreadline.so.6 missing - Can not access R via command line after installation

I did put R on path using the .bashrc file. And yet, I do not have access to R through the command line. I have nevertheless no issues with RStudio. When I check for the R location with which R, I get /home/myself/anaconda3/bin/R. I have Ubuntu 20.04. The error message that I get is /home/myself/anaconda3/lib/R/bin/exec/R: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory. I have version R version 4.1.3 which I have installed recently. Working in JupyterLab in anaconda, I installed again R in a conda environement. Unfortunately, I get inside the conda environment the same error message.
When I try to install the missing package, I get the message:libreadline6 : PreDepends: multiarch-support but it is not installable.
I also tried to install libreadline with conda, conda install -c conda-forge m2-libreadline (as suggested on the anaconda site) as well as conda install -n base -c conda-forge libreadline.so.6. The message I get is: `PackagesNotFoundError: The following packages are not available from current channels:
libreadline.so.6
m2-libreadline`
I will highly appreciate your help. Thanks.

How do you add Jupyter Notebook kernels for prior versions of Julia?

I am using a Windows machine and trying to have Jupyter Notebook kernels for multiple versions of Julia (0.7.0 and 1.1.1) because package AWS does not support the latest version, but does support 0.7.0.
I had Julia 1.1.1 installed on my computer first and got something similar to the following error when I tried to install package AWS: https://github.com/JuliaLang/Pkg.jl/issues/792
Then I installed Julia 0.7.0 and was able to install AWS in the Julia 0.7.0 terminal with Pkg.add("AWS") with no problems.
In the Julia 0.7.0 terminal, I installed IJulia again with Pkg.add("IJulia") and restarted my Jupyter notebook instance. Now I'd like to use AWS via Jupyter notebook but when I create a new one, only Julia 1.1.1 appears.
I ended up having success by showing which kernels I had using jupyter kernelspec list in terminal, which showed where my other Julia kernel was located.
>>> jupyter kernelspec list
Available Kernels:
julia-1.1 C:\Users\{%USERNAME%}\AppData\Roaming\jupyter\kernels\julia-1.1
python3 C:\ProgramData\Anaconda3\share\jupyter\kernels\python3
I navigated to the file path listed after julia-1.1
Created a julia-0.7 folder in that same directory
Copied over contents from the julia-1.1 folder
Edited the kernel.json file by replacing every instance of julia-1.1.1 with julia-0.7.0
What I ended up having success with seems like a very rudimentary way to solve this problem. I'd like a more elegant way to achieve the same result, similar to when adding multiple kernels for different versions of Python. (Using both Python 2.x and Python 3.x in IPython Notebook)
Please help, thank you!
You (probably) just need to Pkg.build("IJulia") on the second Julia version.
Since Julia 0.7 the package manager uses separate directories for each version of a package, meaning that, from the package managers perspective, the package is already installed, and no downloading or building is performed when you install the same version from a different Julia version. The package manager does not know, however, that IJulia needs to be rebuilt for this new Julia version. You can trigger the build manually by Pkg.build("IJulia").

Undefined cran_mirror when building conda packages

I am trying to build an R package in conda using skeleton. After preparing the environment with the required packages, I execute the following commands
$ conda skeleton cran arules
$ conda build r-arules
The recipe files are generated and everything seems OK, but the build command results into the following error:
Adding in variants from internal_defaults
INFO:conda_build.variants:Adding in variants from internal_defaults
Attempting to finalize metadata for r-arules
INFO:conda_build.metadata:Attempting to finalize metadata for r-arules
Undefined Jinja2 variables remain (['cran_mirror', 'cran_mirror']).
Please enable source downloading and try again.
I've been reading the documentation and searching the Web for a solution to this problem, without success, and I do not know what else to do. ¿Any ideas?
Notes: I've started following this tutorial: http://ihrke.github.io/conda.html but afterwards I have also checked the official conda documentation on building packages and other related docs. I have updated conda (= 4.5.2), as well as conda-build ( = 3.10.1)
I finally find out how to solve my issue in two different ways:
The most straight solution is to specify a cran url using --cran-url option when creating the recipse, as follows:
$ conda skeleton cran arules --cran-url https://mran.microsoft.com/snapshot/2018-01-01/
Another solution is to create a conda-build config file, using yaml. Inside that file we specify the cran mirror, for example:
cran_mirror: https://mran.microsoft.com/snapshot/2018-01-01/
And then, we should use option -m when creating the recipe
$ conda skeleton cran arules -m path/to/conda_build_config.yam
PD: It seems there will be a default cran mirror in the next release of conda-build, according to comments in this pull request

Can't create Jupyter Notebook in a subdirectory

I am having issues creating a Jupyter Notebook inside a subdirectory. Instead of creating in the subdirectory, it creates in the root path.
Let me exemplify. Let us suppose that I have the following path structure:
Then, I open Subdirectory_1 and asks it to create a Notebook.
But instead of creating it in the Subdirectory_1, it creates in the root path.
And these are the log messages:
There is a problem with the nbextensions/widgets/notebook/js/extension.js
Try to update or install again the package :
conda update -c conda-forge ipywidgets
Then this:
jupyter nbextension enable --py widgetsnbextension
source : Github
As #thomas-k mentioned in the comments:
There was a bug in notebook 5.3. It should be fixed in 5.4, which is out now on PyPI. Conda packages should follow soon.
More info on this GitHub issue.

PyQT5 error: could not find or load Qt platform plugin xcb

Up until Anaconda3 (which contains Python 3.4) was re-installed on my RedHat 6.5 workstation, I have been able to develop Python apps that use PyQT5.
Post re-install of Anaconda I receive an error message:
....could not find or load Qt platform plugin xcb
The only difference between Anaconda installs is the folder name: /usr/local/ananaconda3 vs /usr/local/anaconda_py3
I checked libqxcb.so has no missing dependencies.
I rebuilt PyQT5.
I tried explicitly adding location of site-packages of PyQT5:
import site
site.addsitedir("...path.../python3.4")
Any other suggestions?
How does re-installing Python impact the use of PyQT5?
This is an error caused by having two different versions of Qt under the same installation/environment.
Check the packages installed and their versions in your environment (if for some reason you're not working in a virtual environment, you can skip the first line):
source activate yourenvname
conda list
If you see pyqt and qt both with version 4.X.X then remove them (assuming you want to work in Qt v5):
conda remove qt
conda remove pyqt
I had an issue that seems to match what happened here.
But in my case the solution was to "sudo rm -rf user/anaconda3" and reinstall it with "bash anaconda....sh", because I had previously installed it using sudo ("sudo bash anaconda....sh")

Resources