Is there any auto-completion for R in jupyterlab? - r

Kite can only auto complete python code in jupyterlab.
Is there a similar plug-in that allows R code to be automatically completed?
Thanks.

Yes, jupyterlab-lsp offers auto-completion (along other IDE features). It uses Language Server Protocol which requires you to install both:
one or more language servers (for R use R language server), and
an extension to JupyterLab (jupyterlab-lsp).
and then to enable continuousHinting option in Code Completion settings (via Advanced Settings Editor).
If you use JupyterLab 3.0 installed via conda it is as simple as:
conda install -c conda-forge 'jupyterlab>=3.0.0,<4.0.0a0' jupyterlab-lsp jupyter-lsp-r
If you use JupyterLab 3.0 installed via pip instead:
pip install 'jupyterlab>=3.0.0,<4.0.0a0' jupyterlab-lsp
R -e 'install.packages("languageserver")'

install nbextentations for jupyterlab.
nbextentations already have lightweigt auto complete add-on.lightweigth but enough for me.
link: https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html

Related

Installing R Studio with Anaconda

I tried to install R Studio (version 1.1.456) using the anaconda navigator by simply clicking on the install button. It was taking more than an hour, so I just figured it should be stuck.
I then tried to install it through the anaconda prompt but now it has also been stuck for around 30 minutes here:
What can I do to get around this?
Thank you in advance!
For various reasons up-to-date RStudio versions are not availabe on any conda channel I know. #merv's answer is the easiest solution, if you are happy to work with an older version of rstudio. Here is another suggestion, where you install RStudio outside of conda, but configure it to use a particular R installation, which is maintained in your custom conda environment. Step by step, this is how you procede:
Install the latest RStudio from the official sources
Create your custom conda environment CUSTOMENV, including an installation of r-base
conda create -n CUSTOMENV -c conda-forge r-base'>=4.0.0' ... [further packages]
Activate the conda environment
conda activate CUSTOMENV
Start RStudio from console
rstudio &
Important Note: I strongly endorse #mfakaehler's answer since all RStudio builds on Conda have effectively been abandoned. Install RStudio natively and launch from activated environment.
Create a new env instead. E.g.,
conda create --name rstudio_env -c r rstudio
Best practice for Conda is to create new envs for each project rather than using a monolithic base env. Generally, I find that the less one installs in base the better their experience with Conda will be.

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").

Is there an equivalent of `pip install -e` in R?

From python pip install -h:
-e, --editable <path/url> Install a project in editable mode (i.e. setuptools
"develop mode") from a local project path or a VCS url.
Basically , if you pip install -e <package_dir>, pip will install a python package, and symlink to the package, instead of copying it's contents. This is very useful, because it means that you can edit the package, and the changes are available immediately, without having to re-install the package after every modification.
Is there an equivalent for R packages? This would be extremely useful for package development.

pip says that module has already been installed while python

Now a bit of background of my current setup:
I have Python3.3 running on Centos 6. I'm currently working on a web application using Flask that runs on Apache 2.2.15 with mode WSGI 4.5.3 and virtualenv 15.0.2.
pip --version pip 8.1.2 from /usr/local/bin/lib/python3.3/site-packages (python 3.3)
I have installed pysvn with pip and when I run pip show pysvn says
Location: /usr/local/bin/lib/python3.3/site-packages
755 permissions recursively set to /usr/local/bin/lib/python3.3/site-packages. And I passed --system-site-packages argument to virtualenv to use the global site packages.
Even when I try to import the package from python interpreter it does not work. So it is not specific to my virtualenv setup but rather a global problem.
I must mention that other packages installed with pip work perfectly fine (i.e. flask).
I've exhausted all other avenues before coming forward to you guys. Any suggestion would be highly appreciated as I ran out of ideas.
L.E.
I did manage to install it in the end. I'm not completly sure yet why and how but I presume is was compatibility issue.
First of all I have uninstalled svn 1.6+ and installed version 1.8.16 instead which seems to be tested against the latest two versions.
Second, I have uninstalled the troublesome pysvn instance and installed pysvn-1.8.0 workbench "sudo /var/www/FlaskApp/FlaskApp/flask/bin/pip install pysvn-1.8.0.tar.gz". In this case I have installed it my local environment. The 1.9.0 version of pysvn did not work.
L.L.E.
False positive, still doesn't work. I'm going to interact with svn via command line from my script.
L.L.L.E.
After installing svn 1.8.16 and svn-devel along with the rest of dependencies described in the readme file I have managed to successfully install it from the source fallowing the instructions.
Thanks for your help Barry.
pysvn is not available from PyPI because PyPI has no way to allow me to upload pysvn for each supported SVN version. Let alone deal with the issues of installing on a Linux distro given the choices for pysvn dependencies.
(APR, SVN, OpenSSL etc).
Fedora packages pysvn for the Fedora release.
I'm assuming that means it is on RHEL and therefore packaged by CentOS.
(But I do not have RHEL or CentOS to check this on)
If you find that a package is not available for your CentOs is not hard
to build pysvn on a linux distro. Get the source kit and follow the readme.html should get you going.
Barry (pysvn maintainer)

Installing RIDE(Robot Framework)

For automated testing on RIDE(Robot framework), I had already installed PYTHON 2.6 and wxPython 3.0 version,PATH had already been updated in Environment variables, and when I jumped to the last phase i.e Installing RIDE(version -"robotframework-ride-1.3.win32.exe") through Windows Installer, application is been installed when I try to through "Run as Administrator", it was unable to open the IDE. How I can resolve this issue?
I installed RIDE a few days ago with no problem.
First you need to install python like you did (run the command: "python --version" to verify the installation).
After that, you will need to install Robot Framework (run the command: "pybot --version" to verify the installation)
If Robot Framework was sucessfully installed then it's time to install wxpython (choose the right installation, depending on the python version installed)
Finally you only need to install RIDE and it should work
You can follow the steps given below to install robotframework.
Install Python 2.7.1
RIDE runs only on the regular Python, not on Jython nor IronPython.
Download Python 2.7.1
Install Python 2.7.1.
Set the path in environment variable. (Look below for instructions )
Note: Python 2.6 is the minimum version. Robot Framework, RIDE does not yet support Python3 .
Set path on Windows 8 (Windows 7 users also can try the steps)
Open Start and
search Environment Variables
Click on Edit the system environment variables
Goto Advanced tab
Click on Environment Variables button
Scroll down under System variables and click on Path
Click on Edit button
Append ;<InterpreterInstallationDir>;<InterpreterInstallationDir>\Scripts\ in variable value Save the changes.
If command prompt is already open, then re-open command prompt to effectively take changes.
Install wxPython 2.8.12.1
It is necessary to install wxPython because RIDE’s GUI is implemented by using wxPython.
Download wxPython 2.8.12.1 directly from https://www.python.org/ftp/python/2.7.10/python-2.7.10.msi
Run the installer and finish the setup. This will install wxPython 2.8-win32-unicode-2.8.12.1 on your system.
Install PIP 1.1
To install PIP follow the step by step instruction provided here http://arunrocks.com/guide-to-install-python-or-pip-on-windows/
Install Robotframework 2.9rc1
Using Command Prompt
You can install RIDE by using the pip or easy_install commands.
Run either of the following command to install Robotframework:
pip install robotframework ride
OR
easy_install robotframework ride
After the installation of RIDE, run the following command:
`ride.py` (this will launch RIDE )
Using Windows Installer
Download robotframework-RIDE 1.4:
You can download RIDE installer for windows version from
https://pypi.python.org/packages/source/r/robotframework-ride/robotframework-ride-1.4.tar.gz
Open the installer and follow the onscreen instructions. After installation, launch RIDE by double clicking the shortcut icon.
This should resolve the issue.
Thank you :)
You probably have the different versions for wxPython and Python in your machine. Always make sure you should install the wxPython version same as the python version i.e. Python 2.7.

Resources