# Encountered error when trying to import the harp package in R

**URL:** https://forum.atmospherictoolbox.org/t/encountered-error-when-trying-to-import-the-harp-package-in-r/831
**Category:** HARP
**Tags:** r
**Created:** [November 1, 2024, 10:02am UTC](https://forum.atmospherictoolbox.org/t/encountered-error-when-trying-to-import-the-harp-package-in-r/831 "2024-11-01T10:02:24Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![HZK111](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/hzk111/32/376_2.png) [@HZK111](https://forum.atmospherictoolbox.org/u/HZK111)
#### Post date: [November 1, 2024, 10:02am UTC](https://forum.atmospherictoolbox.org/t/encountered-error-when-trying-to-import-the-harp-package-in-r/831/1 "2024-11-01T10:02:24Z")

</div>

Dear administrator, hello. I have successfully installed harp using Anaconda and connected its library path in R. My R version is also up to date at 4.4.1, but I am unable to import harp. Could you please help me figure out what’s going on? Thank you very much.

 ![1EE5BD0E42AAD9D74151D3F0399CAD9B](https://forum.atmospherictoolbox.org/uploads/default/original/1X/5a5cb6c57cc499de0d3449fbc7cc78449faa6c57.png)

---

<div class="post-metadata">

### Author: ![sander.niemeijer](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/sander.niemeijer/32/5_2.png) [@sander.niemeijer](https://forum.atmospherictoolbox.org/u/sander.niemeijer)
#### Post date: [November 1, 2024, 11:34am UTC](https://forum.atmospherictoolbox.org/t/encountered-error-when-trying-to-import-the-harp-package-in-r/831/2 "2024-11-01T11:34:58Z")

</div>

Did you also install the `r-harp` conda package?  
Note that the R interface of HARP is provided using this separate package (to prevent the default `harp` package bringing in a full R installation).

---

<div class="post-metadata">

### Author: ![HZK111](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/hzk111/32/376_2.png) [@HZK111](https://forum.atmospherictoolbox.org/u/HZK111)
#### Post date: [November 2, 2024, 12:38am UTC](https://forum.atmospherictoolbox.org/t/encountered-error-when-trying-to-import-the-harp-package-in-r/831/3 "2024-11-02T00:38:43Z")

</div>

Dear administrator, hello. I am a sophomore student at university, and I apologize for my limited knowledge. I have been following the HARP documentation for installation and have modified the library path (as suggested in one of your previous responses). I am not clear on what you meant, could you please provide further guidance? Thank you very much. (I have installed HARP using conda and am now operating in RStudio.)

 ![7483DA91093E0594AA170EAE7F2FE424](https://forum.atmospherictoolbox.org/uploads/default/original/1X/e5d1b2202fe6429bf8b27cfb31195cfcfd03a95b.jpeg)

---

<div class="post-metadata">

### Author: ![HZK111](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/hzk111/32/376_2.png) [@HZK111](https://forum.atmospherictoolbox.org/u/HZK111)
#### Post date: [November 2, 2024, 10:32am UTC](https://forum.atmospherictoolbox.org/t/encountered-error-when-trying-to-import-the-harp-package-in-r/831/4 "2024-11-02T10:32:47Z")

</div>

Dear administrator, the steps I have taken are as follows: First, I used conda in the terminal to download HARP. Then, I modified the library path in my installed RStudio to point to HARP’s site-library. Finally, when I entered `library(harp)` in RStudio, an error occurred.

---

<div class="post-metadata">

### Author: ![HZK111](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/hzk111/32/376_2.png) [@HZK111](https://forum.atmospherictoolbox.org/u/HZK111)
#### Post date: [November 2, 2024, 12:24pm UTC](https://forum.atmospherictoolbox.org/t/encountered-error-when-trying-to-import-the-harp-package-in-r/831/5 "2024-11-02T12:24:12Z")

</div>

Did I miss any steps, such as configuring environment variables or something like that?

---

<div class="post-metadata">

### Author: ![sander.niemeijer](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/sander.niemeijer/32/5_2.png) [@sander.niemeijer](https://forum.atmospherictoolbox.org/u/sander.niemeijer)
#### Post date: [November 4, 2024, 9:39am UTC](https://forum.atmospherictoolbox.org/t/encountered-error-when-trying-to-import-the-harp-package-in-r/831/6 "2024-11-04T09:39:18Z")

</div>

You should be using R from the conda environment as well. I am not sure whether you can combine the conda environment with an RStudio installation that is located separately on your system (apparently it doesn’t?).

---

<div class="post-metadata">

### Author: ![HZK111](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/hzk111/32/376_2.png) [@HZK111](https://forum.atmospherictoolbox.org/u/HZK111)
#### Post date: [November 4, 2024, 11:25am UTC](https://forum.atmospherictoolbox.org/t/encountered-error-when-trying-to-import-the-harp-package-in-r/831/8 "2024-11-04T11:25:03Z")

</div>

My issue has been resolved, thank you very much.

---

<div class="post-metadata">

### Author: ![HZK111](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/hzk111/32/376_2.png) [@HZK111](https://forum.atmospherictoolbox.org/u/HZK111)
#### Post date: [November 4, 2024, 11:40am UTC](https://forum.atmospherictoolbox.org/t/encountered-error-when-trying-to-import-the-harp-package-in-r/831/9 "2024-11-04T11:40:28Z")

</div>

Dear administrator, hello. Although I have successfully resolved the issue now, I am still quite puzzled. I ran these codes in the terminal, and the results were correct. However, it is not convenient to write code in the terminal without an interface. Could you please offer some suggestions? (Please forgive me if my question seems silly to you.)

 ![343209a4-6d3e-4c45-aa57-3e745ba1e1a1](https://forum.atmospherictoolbox.org/uploads/default/original/1X/44c02c05ab1501a8d6ae700a08890511e1768b80.png)

---

<div class="post-metadata">

### Author: ![sander.niemeijer](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/sander.niemeijer/32/5_2.png) [@sander.niemeijer](https://forum.atmospherictoolbox.org/u/sander.niemeijer)
#### Post date: [November 4, 2024, 11:51am UTC](https://forum.atmospherictoolbox.org/t/encountered-error-when-trying-to-import-the-harp-package-in-r/831/10 "2024-11-04T11:51:57Z")

</div>

I am unfortunately not that familiar with using RStudio. I saw that there is an [rstudio package on conda-forge](https://github.com/conda-forge/rstudio-feedstock), but this seems to only be available for linux and macos. I am not sure how this can be made to work on Windows. Perhaps other members on the forum can help with this?

---

<div class="post-metadata">

### Author: ![HZK111](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/hzk111/32/376_2.png) [@HZK111](https://forum.atmospherictoolbox.org/u/HZK111)
#### Post date: [November 4, 2024, 12:17pm UTC](https://forum.atmospherictoolbox.org/t/encountered-error-when-trying-to-import-the-harp-package-in-r/831/11 "2024-11-04T12:17:09Z")

</div>

Alright, administrator, thank you very much.
