Error installing Numpy with Reticulate from Rstudio - r

I am trying to use Python from Rstudio but even if pandas and other packages can get installed normally , numpy don't. Is it something wrong with my code ?
PS : I am learning python so I might do basic error
I have tried to install again numpy from conda and no problem on there

Related

BokehJS library missing error and no plot

I am running Anaconda 10.0 Jupyter Notebook Python 3.8, bokeh 2.3.0 on Chrome. On my other PC (should be identical setup, except this is a slightly later Anaconda version) images are fine, but on this there is no image and the Javascript console tells me:
Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing
I could not find a simple, working solution to this problem here or elsewhere on the net and I am at a total loss now.
The abbreviated code I'm running is:
import regex as rg
import pandas as pd
import numpy as np
import datashader as ds, colorcet
import holoviews as hv
from holoviews.operation.datashader import datashade
from holoviews import opts
hv.extension("bokeh")
datashade(hv.Points(df_re), cmap=colorcet.fire).relabel('Reflectances').opts(height=700, width=800)
Where is the problem and how should I fix it?
Unfortunately that didn't work for me, still the same error.
What I found interesting was that prior to installing ver. 1.0.3 of the extension, Anaconda prompt said:
(Datashader-Holoview) C:\Windows\system32>jupyter labextension list
JupyterLab v2.2.6
No installed extensions
It is as if no version of that extension did exist in the environment.
There might be a bug with the most recent pyviz jupyter labextension (1.0.4). See if it works for you after you do
jupyter labextension install #pyviz/jupyterlab_pyviz#1.0.3
This worked for me.

Python shared library not found, Python bindings not loaded. in RStudio on Mac

I have seen this question answered for issues in Windows but haven't seen any solution for a Mac.
After installing keras like:
devtools::install_github("rstudio/keras")
library(keras)
install_keras()
I get the error when running:
library(keras)
mnist <- dataset_mnist()
>> Error in initialize_python(required_module, use_environment) :
Python shared library not found, Python bindings not loaded.
I have tried the following:
use_python("/Users/me/anaconda3/bin/python3.7", required = TRUE)
use_virtualenv("~/MyFolder/.venv/")
use_python("~/MyFolder/.venv/bin/python")
But haven't been successful, I saw some suggestions about wrong python installation but it shouldn't be it in my case.
i have installed python 3.7.5 with Anaconda
=> python --version
Python 3.7.5
I'm on macOS Catalina Version 10.15.1 in RStudio, Version 1.2.5019. Does anyone have any solution?
I had same problem with OSX. Found solution by configuring python virtual environment to use python3
library(reticulate)
use_python("/usr/local/bin/python3")
This is a old thread, but just wanted to say for anyone that finds this that installing the python-dev package for whatever version of python you're using may work. I was using python3.8, so I installed python3.8-dev

Jupyter notebook ModuleNotFound

I get this error when trying to execute the imports, i've tried to reinstall python3, ipython and jupyter-notebook, but i keep getting the error ModuleNotFound. I've tried googling and searching for an answer, but nothing has worked so far. I'm new to jupyter-notebook and need it for a course.
First, install matplotlib and numpy in your terminal:
pip install matplotlib #add "sudo" before "pip" when you get "Permission denied"
pip install numpy
Then, choose the right Python version(i.e. kernel) for your notebook.

rpy2 import works in shell but not in jupyter notebook

So, I have installed rpy2 successfully, and I can import it in a python shell, for example. Also, I have Jupyter notebook successfully installed. But for some reason I cannot import rpy2 on the jupyter notebook. I get the standard 'module not found' error. Other posts have addressed problems relating to installation of rpy2 itself, but specifically, I can't import ONLY from jupyter notebook. I find it quite strange, because I'm fairly certain I only have one copy of Python 3.6, so why can it import in the terminal but not in the notebook. .. .
I solved this by re-installing jupyter notebook. . .
I encountered the same issue, and I use many different env with conda. Here is my solution, starting your jupyter notebook with the same env which rpy2 is installed.

How can I import python packages using knit r?

I am looking to integrate python code into a r notebook (or even a rmarkdown document). I am able to run Python using a python code chunk:
```{python}
```
However I am unable to import a package (e.g. pandas). I have anaconda installed which has pandas installed, however I am unable to import it. Can anyone give me direction as to how I can import packages into r via knitr, preferably using anaconda?
{python, engine.path="/path/to/your/anaconda3/bin/python"}

Resources