1
$\begingroup$

I have followed the instructions to install Q# using conda as recommended, and given by MS. When I try to import qsharp from my virtual env within a Python program, I get the following error:

Microsoft.Quantum.IQSharp.Workspace[0] QS5022: No identifier with the name “v” exists.

Does any one have experience of this issue please? I have googled it but to no avail.

I use .NET run perfectly with example.qs and example.csproj files, but I would like to work within VSCode. (Ubuntu v. 20.04, .NET SDK v. 3.1, Python v. 3.7 + latest Miniconda)

$\endgroup$
0
$\begingroup$

When you call import qsharp, it will try to compile the .qs files in the current folder so the corresponding operations are available from Python. It seems the Q# compiler is having some problems with one of the files. Try to see if any of the .qs files in the directory have any syntax errors, and try removing the obj folder with temporary files if it exists.

$\endgroup$
1
  • $\begingroup$ Thank you El, I got there in the end after fixing some errors, as you pointed out $\endgroup$ Aug 24 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.