# Microsoft Q#: "Namespace declarations can only occur at a global scope" error

I am having challenges with Microsoft Q#. I wrote this short code and it says it can only occur at a global scope.

How do I fix this error? Any ideas? Thank you

• thanks is working Jul 3, 2020 at 21:31

In Q# Jupyter notebooks, code is automatically wrapped in a namespace - there is no need to declare one in your code. If you remove the namespace Quantum.Kata.SingleQubitGates declaration from your code, it should work.