0

I installed Q# with Python as per the instructions on Microsoft's site. Then, I tested the installation. It ran fine the first time. But subsequently, when I try to run any program, I get the message: Preparing Q# environment... Access to the path 'C:\Users\Sanjiv\Application Data' is denied. Then it waits for a while and then I get the message: Exception: Q# environment was not available in allocated time.

I have tried the following: 1. Changing ownership of C:\Users\Sanjiv and its subdirectories to myself. 2. Running the command window as admin.

I don't know what else to try to fix this problem.

Sanjiv
  • 1

2 Answers2

0

Application Data is not an actual folder, it is a Junction which is only there for backward compatibility. A Junction is a shortcut that redirects files and programs to a different location.

This particular Junction points to the C:Users\[yourusername]\AppData\Roaming folder.

There is a good explanation of Junction Points at the following website.

http://www.svrops.com/svrops/articles/jpoints.htm

source

Tin Nguyen
  • 5,250
  • 1
  • 12
  • 32
  • I also changed the ownership of C:Users\[yourusername]\AppData\Roaming folder to myself. It still continues to give the same error. – Sanjiv Apr 01 '20 at 12:41
  • That's not my code. This is Microsoft provided software. So I don't know how to fix it. – Sanjiv Apr 02 '20 at 05:51
0

This answer may be a little late for the original poster, but in case anyone else runs across this issue, there is a workaround discussed in this GitHub issue.

Basically it seems to be related to your Q# .ipynb notebook file living in your user profile folder, alongside the Application Data folder which for some reason is inaccessible in your file system.

You should be able to workaround this issue by creating/opening your Q# .ipynb notebook files from any other folder on your disk.

Ryan Shaffer
  • 405
  • 3
  • 12