# Import Board Package on Julia and use Infinity

**URL:** https://discourse.julialang.org/t/import-board-package-on-julia-and-use-infinity/40929
**Category:** General Usage
**Tags:** question, package
**Created:** [June 7, 2020, 1:49pm UTC](https://discourse.julialang.org/t/import-board-package-on-julia-and-use-infinity/40929 "2020-06-07T13:49:24Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Moreno](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Moreno](https://discourse.julialang.org/u/Moreno)
#### Post date: [June 7, 2020, 1:49pm UTC](https://discourse.julialang.org/t/import-board-package-on-julia-and-use-infinity/40929/1 "2020-06-07T13:49:24Z")

</div>

Hi Guys, am new to Julia and am developing a Tic Tac Toe AI board game and i happen to have issues with importing board.I know in python it’s  
import board

how do i do this in Julia?

---

<div class="post-metadata">

### Author: ![jw3126](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jw3126/32/3086_2.png) [@jw3126](https://discourse.julialang.org/u/jw3126)
#### Post date: [June 7, 2020, 2:12pm UTC](https://discourse.julialang.org/t/import-board-package-on-julia-and-use-infinity/40929/2 "2020-06-07T14:12:15Z")

</div>

```julia
using Board

```

Or are you talking about importing a python package in julia?

```julia
using PyCall
board = pyimport("board")

```

---

<div class="post-metadata">

### Author: ![Moreno](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Moreno](https://discourse.julialang.org/u/Moreno)
#### Post date: [June 7, 2020, 2:25pm UTC](https://discourse.julialang.org/t/import-board-package-on-julia-and-use-infinity/40929/3 "2020-06-07T14:25:21Z")

</div>

I have tried using Board  
but I get the following error

julia\> Pkg.add(“Board”)  
Updating registry at `C:\Users\NEW\.julia\registries\General`  
Updating git-repo `https://github.com/JuliaRegistries/General.git`  
ERROR: The following package names could not be resolved:

- Board (not found in project, manifest or registry)  
Please specify by known `name=uuid`.

---

<div class="post-metadata">

### Author: ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)
#### Post date: [June 7, 2020, 3:15pm UTC](https://discourse.julialang.org/t/import-board-package-on-julia-and-use-infinity/40929/4 "2020-06-07T15:15:03Z")

</div>

It is

```julia
include("board.jl")

```

In python import load a file, but in Julia using read a package, not a file, and a package has a specific structure.

---

<div class="post-metadata">

### Author: ![Moreno](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Moreno](https://discourse.julialang.org/u/Moreno)
#### Post date: [June 7, 2020, 4:43pm UTC](https://discourse.julialang.org/t/import-board-package-on-julia-and-use-infinity/40929/5 "2020-06-07T16:43:23Z")

</div>

@dmolina am trying this but it doesn’t work, could kindly provide more info on how i should use it? thanks

---

<div class="post-metadata">

### Author: ![jw3126](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jw3126/32/3086_2.png) [@jw3126](https://discourse.julialang.org/u/jw3126)
#### Post date: [June 8, 2020, 9:59pm UTC](https://discourse.julialang.org/t/import-board-package-on-julia-and-use-infinity/40929/6 "2020-06-08T21:59:39Z")

</div>

It is not fully clear to me, what you are trying to do. So is `board.jl` some file you created on your computer? Or is it some repo on github? Or is it a python package?

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [June 8, 2020, 11:16pm UTC](https://discourse.julialang.org/t/import-board-package-on-julia-and-use-infinity/40929/7 "2020-06-08T23:16:56Z")

</div>

The PyCall docs:

> By default on Mac and Windows systems, `Pkg.add("PyCall")` or `Pkg.build("PyCall")` will use the [Conda.jl](https://github.com/Luthaf/Conda.jl) package

Implying not used on Linux (is that outdated, and used there too?). At least on Linux, where you have Python 3 preinstalled, I could do (and I don’t find that package in Anaconda), and note the 3 in pip3, therefore may be important:

```julia
shell> pip3 install board

```

but then had to build PyCall correctly:

```julia
julia> ENV["PYTHON"] = "python3" # will not be enough on Windows, see docs

julia> using Pkg; Pkg.build("PyCall")

```

exit Julia and start again:

```julia
julia> using PyCall

julia> board = pyimport("board")

julia> b[0, 0] = "X" # works, but warning:
┌ Warning: `setindex!(o::PyObject, v, i1::Integer, i2::Integer)` is deprecated, use `set!(o, (i1 - 1, i2 - 1), v)` instead.
│ caller = top-level scope at REPL[12]:1
└ @ Core REPL[12]:1
"X"

```

You can e.g. do as in Python (for strings and this package, index from the end of the board):

```julia
julia> set!(b, (-1, 0), "X")
"X"

julia> get(b, (-1, 0))
"X"

```

Note, in general such negative indexing or starting from 0 in not done in Julia. I believe the deprecation above (can you disable the warning? I think it’s only in the REPL, not your working program) is there to allow the usual indexing as done in Julia, in a future PyCall version, for Python objects, shifting for you by one (and I guess loosing out on the negative, Julia uses “end” for that, or end-n).
