# Installation issues

**URL:** <https://itensor.discourse.group/t/installation-issues/62>\
**Category:** ITensor Julia Questions\
**Tags:** julia, installing, cluster\
**Created:** [April 21, 2022, 9:51am UTC](https://itensor.discourse.group/t/installation-issues/62 "2022-04-21T09:51:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![scapponi](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/scapponi/32/472_2.png) [@scapponi](https://itensor.discourse.group/u/scapponi)\
**Post date:** [April 21, 2022, 9:51am UTC](https://itensor.discourse.group/t/installation-issues/62/1 "2022-04-21T09:51:21Z")

</div>

I am trying to install the Julia version on some supercomputer . In order to have a local installation, I need to use some local environments using:

```julia
import Pkg; Pkg.activate("ITensors")

```

Then I do a standard installation using:

```julia
import Pkg; Pkg.add("ITensors")
using ITensors
ITensors.compile()

```

Then, if I try to create simple tensors everything is fine but I cannot run the basic dmrg examples due to errors, e.g.

```julia
julia> OpSum()
ERROR: UndefVarError: OpSum not defined
Stacktrace:
 [1] top-level scope at REPL[4]:1

```

I am beginner in Julia so it might be a stupid mistake… Any help would be appreciated, thanks in advance.

---

<div class="post-metadata">

**Author:** ![mtfishman](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/mtfishman/32/11_2.png) [@mtfishman](https://itensor.discourse.group/u/mtfishman)\
**Post date:** [April 21, 2022, 12:28pm UTC](https://itensor.discourse.group/t/installation-issues/62/2 "2022-04-21T12:28:11Z")

</div>

In the same Julia session, did you execute `using ITensors` before executing `OpSum()`? For example:

```julia-repl
$ julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.7.2 (2022-02-06)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> OpSum()
ERROR: UndefVarError: OpSum not defined
Stacktrace:
 [1] top-level scope
   @ REPL[1]:1

julia> using ITensors

julia> OpSum()
OpSum:

julia> 

```

---

<div class="post-metadata">

**Author:** ![scapponi](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/scapponi/32/472_2.png) [@scapponi](https://itensor.discourse.group/u/scapponi)\
**Post date:** [April 21, 2022, 12:48pm UTC](https://itensor.discourse.group/t/installation-issues/62/3 "2022-04-21T12:48:46Z")

</div>

yes indeed and if I type something else:

```julia
sites = siteinds("S=1/2",10; conserve_qns=true)

```

it works perfectly.  
Actually in my local installation, the content of the `.julia/packages` is not the same as on my laptop so I’m wondering if the installation was done correctly. Is there another way to install ITensor with Julia ?

---

<div class="post-metadata">

**Author:** ![mtfishman](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/mtfishman/32/11_2.png) [@mtfishman](https://itensor.discourse.group/u/mtfishman)\
**Post date:** [April 21, 2022, 12:55pm UTC](https://itensor.discourse.group/t/installation-issues/62/4 "2022-04-21T12:55:17Z")

</div>

Does the installation work if you skip the step of making a local environment?

To do a basic installation of ITensors.jl, all you have to do is:

```julia-repl
$ julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.7.2 (2022-02-06)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> import Pkg; Pkg.add("ITensors")
    Updating registry at `~/.julia/registries/General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Resolving package versions...
    Updating `~/.julia/environments/v1.7/Project.toml`
  [9136182c] + ITensors v0.3.9
  No Changes to `~/.julia/environments/v1.7/Manifest.toml`

julia> using ITensors

julia> OpSum()
OpSum:

julia> sites = siteinds("S=1/2",10; conserve_qns=true)
10-element Vector{Index{Vector{Pair{QN, Int64}}}}:
 (dim=2|id=824|"S=1/2,Site,n=1") <Out>
 1: QN("Sz",1) => 1
 2: QN("Sz",-1) => 1
[...]

```

Does that work for you?

If so, the issues you are seeing are probably related to making the local environment, which we can try to help with but I just want to check first that the basic installation process works for you.

---

<div class="post-metadata">

**Author:** ![scapponi](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/scapponi/32/472_2.png) [@scapponi](https://itensor.discourse.group/u/scapponi)\
**Post date:** [April 21, 2022, 1:08pm UTC](https://itensor.discourse.group/t/installation-issues/62/5 "2022-04-21T13:08:32Z")

</div>

No if I do that, I get this error:

```julia
ERROR: SystemError: opening file "/usr/local/julia/julia-1.5.3/local/share/julia/environments/v1.5/Project.toml": Permission denied

```

since I cannot install in the /usr directory. So I do need to activate some local environment…

---

<div class="post-metadata">

**Author:** ![mtfishman](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/mtfishman/32/11_2.png) [@mtfishman](https://itensor.discourse.group/u/mtfishman)\
**Post date:** [April 21, 2022, 1:15pm UTC](https://itensor.discourse.group/t/installation-issues/62/6 "2022-04-21T13:15:22Z")

</div>

I see, are you using a pre-installed version of Julia on a cluster?

I would recommend installing your own version of Julia. First of all, Julia 1.5.3 is pretty old right now and the latest versions of ITensors.jl (after ITensors 0.3) have dropped support for Julia 1.5 and below. Second, it will make it easier for you to install your own packages without having to mess with environments.

You should be able to follow the instructions here: [Installing Julia and ITensor · ITensors.jl](https://itensor.github.io/ITensors.jl/stable/getting_started/Installing.html) to install your own local version of Julia on a cluster.

---

<div class="post-metadata">

**Author:** ![scapponi](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/scapponi/32/472_2.png) [@scapponi](https://itensor.discourse.group/u/scapponi)\
**Post date:** [April 21, 2022, 1:46pm UTC](https://itensor.discourse.group/t/installation-issues/62/7 "2022-04-21T13:46:37Z")

</div>

Thanks a lot, it seems to work now !

---

<div class="post-metadata">

**Author:** ![mtfishman](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/mtfishman/32/11_2.png) [@mtfishman](https://itensor.discourse.group/u/mtfishman)\
**Post date:** [April 21, 2022, 2:01pm UTC](https://itensor.discourse.group/t/installation-issues/62/8 "2022-04-21T14:01:50Z")

</div>

Great, glad that worked!
