iqsharp icon indicating copy to clipboard operation
iqsharp copied to clipboard

iqsharp and qsharp conda packages are published only for Python 3.7

Open deepankarpal1985 opened this issue 5 years ago • 7 comments

Describe the bug python -c "import qsharp" gives the following error

To Reproduce python -c "import qsharp"

Expected behavior Gives an error on trying to enable the qsharp environment in conda using python -c "import qsharp" Ideally should pass

Error Preparing Q# environment... Access to the path 'C:\WINDOWS\system32\LogFiles\WMI\RtBackup' is denied.

Screenshots If applicable, add screenshots to help explain your problem.

System information

  • Windows
  • Norton Antivirus Enabled (is it causing the issue)
  • Version 10

Additional context Add any other context about the problem here.

deepankarpal1985 avatar Aug 16 '20 13:08 deepankarpal1985

@deepankarpal1985 could you report which version of the qsharp package you have installed (i.e., pip show qsharp or conda list qsharp)?

This is possibly related to https://github.com/microsoft/iqsharp/issues/149. Can you try switching to a different directory in the command prompt and then running the command again? It may also be worth closing other processes or restarting the computer in case something has an open handle to that folder.

rmshaffer avatar Aug 16 '20 15:08 rmshaffer

Here is the version number iqsharp 0.10.1910.2102a1 py36_0 quantum-engineering qsharp 0.10.1910.2102a1 py36_0 quantum-engineering

I will also try other instructions you have provided and get back to you shortly.

deepankarpal1985 avatar Aug 17 '20 00:08 deepankarpal1985

Interesting, thanks. That is an old version from nearly a year ago. Can you try updating the conda packages and/or creating a new environment, as described here? https://docs.microsoft.com/en-us/quantum/quickstarts/install-python

rmshaffer avatar Aug 17 '20 00:08 rmshaffer

Yes I did follow exactly the steps in the link and created an environ etc. yesterday

deepankarpal1985 avatar Aug 17 '20 00:08 deepankarpal1985

On changing the directory to Documents\subfolder it passes

deepankarpal1985 avatar Aug 17 '20 00:08 deepankarpal1985

I updated the Qdk using instructions ( and then listed qsharp-the version number didn't change) conda update -c quantum-engineering qsharp Collecting package metadata (current_repodata.json): done Solving environment: done

==> WARNING: A newer version of conda exists. <== current version: 4.8.3 latest version: 4.8.4

Please update conda by running

$ conda update -n base -c defaults conda

All requested packages already installed.

(qsharp-env) C:\Users\deepa\Documents\QFEM>python -c "import qsharp; qsharp.reload()"

Although I was able to run the first example

deepankarpal1985 avatar Aug 17 '20 00:08 deepankarpal1985

I think I see the problem. You are using Python 3.6, and 0.10.1910.2102a1 is the latest version of the qsharp conda package that was published for Python 3.6. Is it possible for you to try creating an environment with Python 3.7 instead? If not, you should be able to get the latest version working with Python 3.6 by following these instructions: https://docs.microsoft.com/en-us/quantum/quickstarts/install-python?tabs=tabid-dotnetcli

That is not due to any underlying incompatibility, but just the fact that the recent conda packages have only been built and published for Python 3.7. I'm updating the title of this issue to reflect that we should support additional versions.

I've mitigated this for now by moving these old versions to beta label of the Anaconda channel so that they won't get installed by default.

rmshaffer avatar Aug 17 '20 11:08 rmshaffer

This should be fixed with #685, but please feel free to re-open if there's any additional information. Thank you!

cgranade avatar Sep 27 '22 16:09 cgranade