Q# install issue

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)

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.