I have installed Julia 1.5.3 on Ubuntu but IJulia falis with LoadError as shown in the screenshot.
The first path to the conda environment is very wrong, this is running on Ubuntu. The path shown below Precompliling is a WINDOWS path.
Where in the scripts can I correct this reference and allow IJulia to install ?
It looks like you have had an Anaconda installation that is not available anymore yet your paths are pointing to it. The best thing to do is to install an Anaconda inside Julia. This also works best in practice.
using Pkg
ENV["PYTHON"]=""
Pkg.add("PyCall")
Pkg.build("PyCall")
Pkg.add("Conda")
using Conda
Conda.runconda(`install jupyter --yes`)
Pkg.build("IJulia")
Now your code will work.
using IJulia
notebook(dir=".")
Remember also to try Pluto Pkg.add("Pluto") - a new generation of notebooks for Julia.
Related
I have installed julia 1.6.2 , jupyter notebook and anaconda 3 according to this website:
https://datatofish.com/add-julia-to-jupyter/
I have also checked other websites and the steps of installation were similar. However, I have a problem in step 5 of the above link, as Julia 1.0 doesn't appear and only Python appears. ( Text File, Folder, and Terminal also appear in the Others section )
Any ideas on what the problem is? I have also set the environment variable of Julia by going to System Variables and adding the bin folder of julia to Path. ( Windows 10 OS)
Also, after installing Julia, these were the lines I entered to install other things.
import Pkg
# installs IJulia package
Pkg.add("IJulia")
using IJulia
# launch Jupyter notebook
notebook()
After these, I opened julia again and typed:
import Pkg
Pkg.add("NBInclude")
Julia 1.0 is really old, please use the latest 1.6.2 and follow official installation guide for Jupyter notebook support (IJulia): https://julialang.github.io/IJulia.jl/dev/manual/installation/
Usually, it's as simple as ]build IJulia, where pressing ] at the REPL drops you into the pkg> mode
I had this issue also. To solve it, you just need to rebuild your IJulia kernel by running command below on Julia apps:
Using Pkg
Pkg.add("IJulia")
Pkg.build("IJulia")
I agree with the answer of #jling. Use an up-to-date julia version if you can. In case you need an old julia version, I have recently created a docker container that provides julia 1.1 inside jupyter notebooks (and I think python as well).
You can find the Dockerfile here: https://github.com/cherrywoods/HorizontalCAS
Nevermind all the code, only the Dockerfile is relevant (and maybe the last section of the Readme). I guess this dockee fiƶe should also work with julia 1.0 if you change the file accordingly.
I am not able to get rstudio into my anaconda base environment. I have tried installing it from the GUI and from the command line. In the GUI it just says that it is installing and either A) crashes, or B) stays on the installing screen forever.
I am using the following code in the base env.
conda install rstudio
System: Ubuntu 19.10 on vitualboxVM with a mac os mojave host.
Also, It is trying to install pypq, is this the problem? This doesn't seem like a package I need for my R scripts, do popular R packages depend on it? If not, can I tell anaconda just to skip installing it?
The terminal log is very long so I attached the image instead of copying the code:
UPDATE: I can install in another env, but not base.
Yes, that's it. For some reason you cannot install R Studio in the base environment but you're obliged to create a specific R environment to install it.
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").
I'm trying to install IJulia ( I ran Pkg.add("IJulia") and now running Pkg.build("IJulia") says the package is installed ), but constantly getting these messages for a long while now :
INFO: Downloading miniconda installer ...
INFO: Installing miniconda ...
And it keeps going, It also occasionally gets ~50% CPU usage.
I have full Anaconda Python installed (Py3) in Windows 10. So is that the issue ? Nothing happened when I tried installing it on my other Linux machine.
EDIT: Removing and re-installation didn't work, neither did setting Anaconda Jupyter as Jupyter environment for Julia. I get an old version error, as it detects that my Jupyter is of version 0.0.0 .
I had similar symptoms installing IJulia on my Windows computer. I was not able to determine what was preventing the Julia package manager from installing miniconda, but I was able to work around the issue by manually installing Miniconda and Jupyter and setting ENV["JUPYTER"] to the full path, including executable name, of the jupyter program. Without the executable name it reported version 0.0.0 as your question indicated and then fell back to install miniconda (which failed repeatedly).
julia> ENV["JUPYTER"]="<HOME>\\Miniconda2\\Scripts\\jupyter.exe"
"<HOME>\\Miniconda2\\Scripts\\jupyter.exe"
julia> Pkg.build("IJulia")
...
INFO: Building IJulia
INFO: Found Jupyter version 4.3.0: <HOME>\Miniconda2\Scripts\jupyter.exe
INFO: Installing Julia kernelspec julia-0.6
[InstallKernelSpec] Installed kernelspec julia-0.6 in <HOME>\AppData\Roaming\jupyter\kernels\julia-0.6
julia> using IJulia
INFO: Precompiling module IJulia.
julia> notebook()
Like you, I did not encounter this problem on my Linux install. The Readme.md states on Linux it will look for jupyter in your path, but on Mac and Windows it will default to installing miniconda for itself which failed. Based on your question I think you want to use your preexisting Jupyter install so this should work. The miniconda install problem may need to be reported as an issue to the IJulia folks as a separate problem.
I had Tensorflow installed with Anaconda. Now I want use it in R and I need to reinstall Tensorflow, because the note here
NOTE: You should NOT install TensorFlow with Anaconda as there are
issues with the way Anaconda builds the python shared library that
prevent dynamic linking from R.
I already tried to uninstall from Anaconda and install with pip but its came to the same place in anaconda directory. Tesorflow is working from terminal but in R shows Error: Command failed (1)
Anybody can help me to how I can solve the problem? Should I uninstall anaconda and install Tensorflow using pip?
You have several options on what to do. Probably the cleanest one is to install a system-wide python (if not installed yet) and then create a virtual environment. This basically takes your system python binaries and moves them to its own compartment where everythign is isolated from the rest, incl. anaconda. Once you are inside an activated virtual environment you can install all the necessary Python appendages for TensorFlow. Once that is done, make sure you set up a correct environmental PATH for TensorFlow from where R can reach it:
Sys.setenv(TENSORFLOW_PYTHON="/path/to/virtualenv/python/binary")
devtools::install_github("rstudio/tensorflow")
Example of the path to where you installed the virtual environment project would be, I think, something like ~/minion/medvedi/venv_medvedi/bin/python.
This is no longer an issue, the documentation was updated too.
See here:
https://github.com/rstudio/tensorflow/commit/4e1e11d6ba2fe7efe1a03356f96172dbf8db365e
With the help of Keras, we can install the TensorFlow package in R.
install_keras()
library(keras)
devtools::install_github("rstudio/keras")
install_tensorflow(package_url = "https://pypi.python.org/packages/b8/d6/af3d52dd52150ec4a6ceb7788bfeb2f62ecb6aa2d1172211c4db39b349a2/tensorflow-1.3.0rc0-cp27-cp27mu-manylinux1_x86_64.whl#md5=1cf77a2360ae2e38dd3578618eacc03b")
library(tensorflow)
Keras is a high-level neural network API for deep learning from TensorFlow Google.
my suggestion is to install anaconda and create an environment called "r-reticulate".
you can do it using anaconda navigator or
reticulate::conda_create(envname = "r-reticulate")
then to check that env detected by reticulate, use reticulate::conda_python().it must return directory of python.exe for your env.
after that you can install tensorflow by install_tensorflow(). [not working in my case]
so I install the tesnorflow from CMD.
follow these steps:
open the cmd :]
activate the r-reticulate env using conda activate r-reticulate (you may need your directory to conda directory if you did not add conda to your PATH)
use : conda install -c anaconda tensorflow
now in R, you can use TensorFlow.
for installing Keras, you can use pip install Keras. [i tried install_keras() function after the installation of tensorflow, but it ruined my TensorFlow installation also]
Eventually I found the best and fast method to do it in R:
devtools::install_github("rstudio/keras")
library(keras)
install_keras(method = "conda")
install_keras(tensorflow = "gpu")
tensorflow::install_tensorflow()