Problem using modules

Hello I used PkgTemplates.jl to create package all works I have directory structure as below

but when I try to test a package from src (using generated by a template test file) I get

LoadError: ArgumentError: Package PetJuliaVascProsthesis not found in current path:

  • Run import Pkg; Pkg.add("PetJuliaVascProsthesis") to install the PetJuliaVascProsthesis package.

PetJuliaVascProsthesis code what I do incorrectly?

module PetJuliaVascProsthesis
greet() = print("helloooo 22")
my_f(x,y) = 4000x+y
# Write your package code here.

and test

using PetJuliaVascProsthesis
using Test
using basicDicomLoad


@testset "PetJuliaVascProsthesis.jl" begin



Have you activated the package environment?
]activate path/to/PetJuliaVascProsthesis
After this, using PetJuliaVascProsthesis should work.
Alternatively, start julia with the argument
julia --project=path/to/PetJuliaVascProsthesis

1 Like

Thank You for a reply ! I activated package as can be seen in repl ! but I still do sth incorrectly


Looks like you try to run it line-by-line, maybe you missed running lines with using?

1 Like

@Jakub_Mitura Please tell us about the interesting work you are doing. I do know that PET will very probably be Positron Emission Tomography!

No I used run all method and still get

In order to get full reference
My github repo

@johnh happy to hear intrest Generally I am physician during specialization in nuclear medicine I am doing my Phd on usage of FDG PET/CT in infections of vascular prosthesis I had created only some tiny project in pytorch yet (I mean from macine learning I am programming for couple years in java, kotlin, javascript, python and now starting julia), This project I will take first all my controll group and study group to try to learn a network some segmentation of vascular prosthesis (probably I will concentrate on aorto bi femoral as those are most common) I have about 30 in study and 20 in control group plus i will add some augmantation on the rotating on Y axis and some moderate gaussian elastic deformations, maybe I will think of sth else but most other augmentation techniques that I had read will not work here , when segmentation will be done I will cut sth like 2 cm around prosthesis and try to analyze this area for patterns - probably dividing this ring like areas to parts and analyze them via 3d convolutions (I know that ussually 3d analysis is not done becouse of computation problems but I hope that strategy i envisioned would make amount of voxels small enough) Of course there will be skip connections and as additional way to improve chance of convergence I am planning to add simplified boolean 3d tensor (from area around the prosthesis) that will just tell wether a voxel is below or above a treshold (the most important information while looking for prosthesis infection is presence of gas bubbles that have far lower density than anything else)
Why this may be relevant? lack of operation when there is infection of aortic vascular prosthesis according to some authors is 100% and risk of patient death when operation is done may be as high as 50% wrong decision here makes huge diffrence, and there are not many cases of it so there are not many physicians having any experience with it.

1 Like

@Jakub_Mitura Wow! That is fantastic work.
Many years ago when I worked in a PET scanning unit one of the doctors was conducting a study on patients who had I think heart surgery or artery surgery. He was scanning the blood supply to their brains post surgery. One of the rather sad side effects of major surgery like that is plaques can break off and occlude the vessels which supply the brain, which is not fatal but can have effects.

I cloned your repo, works for me.
Make sure the environment is activated by pressing ]. You should see (PetJuliaVascProsthesis) pkg>.
After that, if using PetJuliaVascProsthesis still does not work, I suspect Atom is doing something funny.

EDIT: This is probably wrong, see comment of @MA_Laforge

So I suppose Atom id doing sth funny :slight_smile:

@AndiMD :

Have you activated the package environment?
]activate path/to/PetJuliaVascProsthesis

In my experience, activating your directory this way does not help if your intent is to use PetJuliaVascProsthesis as a module (i.e. it does not make your module available to be loaded with using or import).

So what does activate do?

What activate-ing does is bring all packages you added to PetJuliaVascProsthesis/Project.toml available for your current Julia working environment.

Unless I am mistaken: I don’t think that’s what you are trying to do here, @Jakub_Mitura

What to do to get Pkg.add to work:

Unless I am mistaken, your error with Pkg.add was in your argument. You probably wanted the following:


(Though you might want to check the help system using ?Pkg.add)
You might also need to provide absolute path values, I am unsure about this part.

But here is what really think you want:

If you are developing the package, you probably want to use develop instead of add:


This way, you can test the changes you are currently making to that Git repository.

When you use add instead of develop:

  • Julia actually clones your directory to its own managed ``~/.julia/…` subdirectory.
  • It then uses that clone to run your code.

In other words, to try out changes you are making to your packages (when using add instead of develop):

  1. You must commit the changes to your package in “/path/to/PetJuliaVascProsthesis”.
  2. You must then update your package using Julia’s package manager (it will then update its Git directory accordingly.)

So I would just use Pkg.develop(). It simplifies the process of making code changes to your module.

1 Like

Thanks It helped !