I'm having trouble getting the namespace Microsoft.Quantum.MachineLearning
.
Here is an example Q# code:
namespace Temp {
open Microsoft.Quantum.Math;
open Microsoft.Quantum.Canon;
open Microsoft.Quantum.Intrinsic;
open Microsoft.Quantum.MachineLearning;
operation Hello () : Unit{
Message("Hello");
}
}
Here is the python script which drives the code:
import qsharp
from qsharp import Result
import json
import os
from Temp import Hello
Hello.simulate()
Here's the error that the VSCode terminal shows:
Preparing Q# environment...
fail: Microsoft.Quantum.IQSharp.Workspace[0]
QS6104: No namespace with the name "Microsoft.Quantum.MachineLearning" exists.
Traceback (most recent call last):
File "Driver.py", line 5, in <module>
from Temp import Hello
ModuleNotFoundError: No module named 'Temp'
Here are my component versions:
>>> qsharp.component_versions()
{'iqsharp': LooseVersion ('0.11.2004.2825'), 'Jupyter Core': LooseVersion ('1.3.52077.0'), '.NET Runtime': LooseVersion ('.NETCoreApp,Version=v3.1'), 'qsharp': LooseVersion ('0.11.2004.2825')}
I've tried adding the package manually into my conda environment:
>>> qsharp.packages.add("Microsoft.Quantum.MachineLearning::0.11.2004.2825")
Adding package Microsoft.Quantum.MachineLearning::0.11.2004.2825.>>> qsharp.reload()
But that doesn't help.
Also, it's worth to note that there is no such problem when I try to do the same in a local Jupyter Notebook which is weird since they run in the same environment.