# How to install geopandas in julia

**URL:** https://discourse.julialang.org/t/how-to-install-geopandas-in-julia/97272
**Category:** New to Julia
**Tags:** question, package
**Created:** [April 9, 2023, 6:55am UTC](https://discourse.julialang.org/t/how-to-install-geopandas-in-julia/97272 "2023-04-09T06:55:33Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![nirong](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nirong/32/48859_2.png) [@nirong](https://discourse.julialang.org/u/nirong)
#### Post date: [April 9, 2023, 6:55am UTC](https://discourse.julialang.org/t/how-to-install-geopandas-in-julia/97272/1 "2023-04-09T06:55:33Z")

</div>

I want to run “import geopandas” in julia1.6.0 in jupyter notebook. But there are some problems when I install this package. I use different methods to install it, and the erroe messages are showed in the following picture.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/6/1/6178fe528e98fd7933465542db089f05f6449cbf.jpeg)  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/b/b/bb841a3b185fef75ea06faf9d4fa4a8368c2df74.png)  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/7/e777baea645223c1753249513d9df385552561df.png)  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/f/3/f38bcd9acefd7f09b34784bbe1b4bb970d2ec3de.png)

---

<div class="post-metadata">

### Author: ![M-PERSIC](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/m-persic/32/51968_2.png) [@M-PERSIC](https://discourse.julialang.org/u/M-PERSIC)
#### Post date: [April 9, 2023, 7:50am UTC](https://discourse.julialang.org/t/how-to-install-geopandas-in-julia/97272/2 "2023-04-09T07:50:48Z")

</div>

geopandas is a Python project, so it cannot be installed normally via Julia’s package manager (`import Pkg; Pkg.add("geopandas")` or `pkg> add geopandas` won’t work).

The Conda.add() function takes the package name as a string, so you could do the following:

```julia
using Pkg; Pkg.add("Conda")
using Conda
Conda.add("geopandas")

```

---

<div class="post-metadata">

### Author: ![nirong](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nirong/32/48859_2.png) [@nirong](https://discourse.julialang.org/u/nirong)
#### Post date: [April 9, 2023, 8:25am UTC](https://discourse.julialang.org/t/how-to-install-geopandas-in-julia/97272/3 "2023-04-09T08:25:51Z")

</div>

Thanks for your answer. There is still a error showed in the following picture after using your code. The Info suggests me to run “conda install -y geopandas” in root environment, but I don’t know where is the root environment, does it mean run “conda install -y geopandas” in Anaconda Prompt?

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/1/31f0232bed3bbbfbbca91e13f056acaff2a6f481.png)

---

<div class="post-metadata">

### Author: ![M-PERSIC](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/m-persic/32/51968_2.png) [@M-PERSIC](https://discourse.julialang.org/u/M-PERSIC)
#### Post date: [April 9, 2023, 8:40am UTC](https://discourse.julialang.org/t/how-to-install-geopandas-in-julia/97272/4 "2023-04-09T08:40:49Z")

</div>

Seems like Conda couldn’t resolve the environment. Try again with [CondaPkg](https://github.com/cjdoris/CondaPkg.jl) and see if the problem reappears:

```julia
import Pkg; Pkg.add("CondaPkg")
using CondaPkg
CondaPkg.add("geopandas")

```

---

<div class="post-metadata">

### Author: ![nirong](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nirong/32/48859_2.png) [@nirong](https://discourse.julialang.org/u/nirong)
#### Post date: [April 9, 2023, 8:49am UTC](https://discourse.julialang.org/t/how-to-install-geopandas-in-julia/97272/5 "2023-04-09T08:49:16Z")

</div>

Thanks for your quick reply. It still doesn’t work. The error is showed in the follwing picture.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/b/e/bec1658aa96fd01c8a4f881bedcbbae6e325ce72.png)

---

<div class="post-metadata">

### Author: ![nirong](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nirong/32/48859_2.png) [@nirong](https://discourse.julialang.org/u/nirong)
#### Post date: [April 9, 2023, 9:48am UTC](https://discourse.julialang.org/t/how-to-install-geopandas-in-julia/97272/7 "2023-04-09T09:48:11Z")

</div>

Thanks again for your reply. I’ll check it out whthere it is the problem of installation method.

---

<div class="post-metadata">

### Author: ![nirong](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nirong/32/48859_2.png) [@nirong](https://discourse.julialang.org/u/nirong)
#### Post date: [April 9, 2023, 11:32am UTC](https://discourse.julialang.org/t/how-to-install-geopandas-in-julia/97272/8 "2023-04-09T11:32:31Z")

</div>

@M-PERSIC I restart the jupyter notebook, and run the following code again:

```julia
using Pkg; Pkg.add("Conda")
using Conda
Conda.add("geopandas")

```

The error changed again. It said I already installed geopandas, but when I import geopandas, it said geopandas not found.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/a/4a622fdabbe4adc5b6b4193bc64feace2bbdf3a3.png)

Besides, do you know how to resolve this error–AttributeError(“module ‘geopandas’ has no attribute ‘plotting’”)? It is showed in the following picture.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/f/b/fb788cf9fa3e492dac38a7e9b3f1efd6be71ec2f.png)

---

<div class="post-metadata">

### Author: ![M-PERSIC](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/m-persic/32/51968_2.png) [@M-PERSIC](https://discourse.julialang.org/u/M-PERSIC)
#### Post date: [April 9, 2023, 4:43pm UTC](https://discourse.julialang.org/t/how-to-install-geopandas-in-julia/97272/9 "2023-04-09T16:43:44Z")

</div>

That’s good that Conda is working correctly now. I’ll think about filing an issue report if I can continue to reproduce the original error.

Again, geopandas is NOT a Julia package, you cannot interact with it like such. `import geopandas` will not work. You need a Python interop package, such as [PyCall](https://github.com/JuliaPy/PyCall.jl) to use geopandas:

```julia
import Pkg; Pkg.add(["Conda", "PyCall"])
using Conda, PyCall
Conda.add("geopandas")
geopandas = pyimport("geopandas")
geopandas. __version__ #0.12.2

```

---

<div class="post-metadata">

### Author: ![nirong](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nirong/32/48859_2.png) [@nirong](https://discourse.julialang.org/u/nirong)
#### Post date: [April 10, 2023, 3:50am UTC](https://discourse.julialang.org/t/how-to-install-geopandas-in-julia/97272/10 "2023-04-10T03:50:51Z")

</div>

Thanks for your reply. But it seems not work in my case. I checked the original code which prompts wrong. The original code is showed in the following picture.  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/7/f/7f63954f5740d1ac2d44c4aa14ffe6ce9b1f5c4b.png)

Today, I rerun the code, and a different error occured.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/1/1/11d0f4d5da48abca12e1872a0fc277f0d6d22943.png)

I just realized that whether it is the problem of code " py" " " " that julia can’t recognize?The code" py" " " " is the 387th row of NYCPlots.jl.

---

<div class="post-metadata">

### Author: ![M-PERSIC](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/m-persic/32/51968_2.png) [@M-PERSIC](https://discourse.julialang.org/u/M-PERSIC)
#### Post date: [April 10, 2023, 5:08am UTC](https://discourse.julialang.org/t/how-to-install-geopandas-in-julia/97272/11 "2023-04-10T05:08:19Z")

</div>

I receive the same error on Julia 1.6. It is fixed for me on Julia 1.8, so I would suggest, if possible, to update to the latest Julia version. To test it out, I recommend running the following code:

```julia
import Pkg; Pkg.add("PyCall")
using PyCall
geopandas = pyimport_conda("geopandas", "geopandas")
path_to_data = geopandas.datasets.get_path("nybb")
gdf = geopandas.read_file(path_to_data)

```

If it works correctly, you should see “ERROR 1: PROJ: proj\_create\_from\_database: Open of /root/.julia/conda/3/x86\_64/share/proj failed”, which appears to be the expected output based on the [“Getting Started” section](https://geopandas.org/en/stable/getting_started/introduction.html#Reading-files) from the docs.

---

<div class="post-metadata">

### Author: ![nirong](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nirong/32/48859_2.png) [@nirong](https://discourse.julialang.org/u/nirong)
#### Post date: [April 10, 2023, 7:12am UTC](https://discourse.julialang.org/t/how-to-install-geopandas-in-julia/97272/12 "2023-04-10T07:12:24Z")

</div>

Thanks a lot for your continuous reply. I’ll test the code by using julia1.8.
