Skip to content

nuget installed vts fails in Jupyter notebook #6

@scottprahl

Description

@scottprahl

Not sure what is going on. I installed vts using nuget

mkdir vts
cd vts
nuget install VirtualPhotonics.Vts

Then executed the following in a JupyterLab notebook

import os
import clr
import numpy as np
import matplotlib.pyplot as plt
from System.Diagnostics import FileVersionInfo

# Vts version installed using Nuget currently fails when the next cell is executed
nuget_dll = "/Users/prahl/vts/VirtualPhotonics.Vts.10.0.0/lib/net6.0/Vts.dll"
git_dll = "/Users/prahl/Documents/Code/git/vts/publish/local/Vts.dll"

print("stats for:", git_dll)
print("file size is ", os.path.getsize(git_dll))
print(FileVersionInfo.GetVersionInfo(git_dll))

print("stats for:", nuget_dll)
print("file size is ", os.path.getsize(nuget_dll))
print(FileVersionInfo.GetVersionInfo(nuget_dll))

Which shows identical versions, but different file sizes for the two dlls

file size is  10562560
File:             /Users/prahl/Documents/Code/git/vts/publish/local/Vts.dll
InternalName:     Vts.dll
OriginalFilename: Vts.dll
FileVersion:      10.0.0.0
FileDescription:  Vts
Product:          Vts
ProductVersion:   10.0.0
Debug:            False
Patched:          False
PreRelease:       False
PrivateBuild:     False
SpecialBuild:     False
Language:         Language Neutral

stats for: /Users/prahl/vts/VirtualPhotonics.Vts.10.0.0/lib/net6.0/Vts.dll
file size is  10601984
File:             /Users/prahl/vts/VirtualPhotonics.Vts.10.0.0/lib/net6.0/Vts.dll
InternalName:     Vts.dll
OriginalFilename: Vts.dll
FileVersion:      10.0.0.0
FileDescription:  Vts
Product:          Vts
ProductVersion:   10.0.0
Debug:            False
Patched:          False
PreRelease:       False
PrivateBuild:     False
SpecialBuild:     False
Language:         Language Neutral

if I follow the above code with

clr.AddReference(git_dll)
from Vts import *

then everything is fine. If I restart the kernel and then do

clr.AddReference(nuget_dll) 
from Vts import *

it fails with

ModuleNotFoundError: No module named 'Vts'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions