You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the reticulate R package to install alpaca-py, I can see the package in the virtualenv, but cannot import. I believe this is a hyphen in the package name issue. When I import other packages with hyphens in their names changing the hyphen to an underscore allows the package to be properly imported by reticulate into R. This is not the case with alpaca-py. Thank you for your time here.
Example:
library(reticulate)
use_virtualenv("r-reticulate-alpaca")
virtualenv_install("r-reticulate-alpaca", "alpaca-py")
...
py_list_packages()
package version requirement
1 alpaca-py 0.38.0 alpaca-py==0.38.0
2 annotated-types 0.7.0 annotated-types==0.7.0
3 certifi 2025.1.31 certifi==2025.1.31
4 charset-normalizer 3.4.1 charset-normalizer==3.4.1
5 idna 3.10 idna==3.10
6 msgpack 1.1.0 msgpack==1.1.0
7 numpy 2.2.3 numpy==2.2.3
8 pandas 2.2.3 pandas==2.2.3
...
x <- import ("alpaca_py")
Error in py_module_import(module, convert = convert) :
ModuleNotFoundError: No module named 'alpaca_py'
Run reticulate::py_last_error() for details.
y <- reticulate::import("charset_normalizer")
z <- reticulate::import("annotated_types")
Expected Behavior
When I do:
library(reticulate)
use_virtualenv("r-reticulate-alpaca")
x <- import ("alpaca_py")
I expect the package to be loaded correctly into the environment.
SDK Version I encountered this issue in
0.38.0
Steps To Reproduce
In R-4.4.2 running in R studio Build 375, with R reticulate package 1.39.0:
library(reticulate)
# set up a virtualenv
use_virtualenv("r-reticulate-alpaca")
# install alpaca-py into the venv
virtualenv_install("r-reticulate-alpaca", "alpaca-py")
#verify install
py_list_packages()
import the python package into R environment
x <- import ("alpaca_py")
Error in py_module_import(module, convert = convert) :
ModuleNotFoundError: No module named 'alpaca_py'
# also does not work with hyphen
x <- import ("alpaca-py")
Error in py_module_import(module, convert = convert) :
ModuleNotFoundError: No module named 'alpaca-py'
Filled out the Steps to Reproduce section?
I have entered valid steps to reproduce my issue or have attached a minimally reproducible case in code that shows my issue happening; and understand that without this my issue will be flagged as invalid and closed after 30 days.
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Current Behavior
When I use the reticulate R package to install alpaca-py, I can see the package in the virtualenv, but cannot import. I believe this is a hyphen in the package name issue. When I import other packages with hyphens in their names changing the hyphen to an underscore allows the package to be properly imported by reticulate into R. This is not the case with alpaca-py. Thank you for your time here.
Example:
Expected Behavior
When I do:
library(reticulate)
use_virtualenv("r-reticulate-alpaca")
x <- import ("alpaca_py")
I expect the package to be loaded correctly into the environment.
SDK Version I encountered this issue in
0.38.0
Steps To Reproduce
Filled out the Steps to Reproduce section?
Anything else?
No response
The text was updated successfully, but these errors were encountered: