rigetti / pyquil

A Python library for quantum programming using Quil.
http://docs.rigetti.com
Apache License 2.0
1.4k stars 342 forks source link

Cannot find .pyquil_config file #91

Closed akhil21 closed 7 years ago

akhil21 commented 7 years ago

I cannot find the config file named ".pyquil_config". I have downloaded Anaconda and then installed pyquil through pip

vontell commented 7 years ago

Hello @akhil21, it's great to see that you are trying out pyquil! The .pyquil_config file is not created upon installation; it is a file that you will have to create yourself. In your home directory you will want to create a file named .pyquil_config, and then type in the correct information as found here.

akhil21 commented 7 years ago

@vontell Thanks for replying. I tried making a file by .pyquil.config and placed it in the folder of Anaconda from where i am running my command prompt also. But, it's not working. can you please help?

vontell commented 7 years ago

The .pyquil_config file should be placed in the home directory of your computer user account, not within the Anaconda installation or project folder. For example, on Windows this may be C:\Users\yourUsername, on Mac this may be /Users/yourUsername, and on Ubuntu this may be /home/yourUsername.

akhil21 commented 7 years ago

@vontell I now placed this file in my Users\Username folder and started Anaconda prompt in that directory and tried running "pyquil.forest" but it's showing an error that this command is not recognized.

vontell commented 7 years ago

It seems as though parts of the tutorial are out of date; pyquil.forest has been replaced with pyquil.api. It would be best to follow the example at the top of this page.

akhil21 commented 7 years ago

@vontell I followed the procedure given in the doc but still it's not working. I will explain what I have done in detail below :

  1. In Users\myUser I downloaded Anaconda
  2. In Users\myUser I made a new folder "Forest"
  3. In Users\myUser\Forest within cmd prompt, I did "pip install pyquil"
  4. I placed .pyquil_config.INI file in Users\myUser\Forest
  5. I tried running the command pyquil.api and pyquil.forest. Both of them aren't working.
vontell commented 7 years ago

You will want to make sure that you follow these instructions:

  1. Your config file should be named exactly .pyquil_config, not .pyquil_config.ini
  2. The config file should not be placed in a folder in your root user directory. Your file should be placed directly in the root user folder, at the location Users\myUser\.pyquil_config
  3. pyquil.api is not a command; it is a python module that should be imported for use. Are there specific errors that you are receiving? If so, can you paste them here?
akhil21 commented 7 years ago

Thanks for replying.

  1. I named the config file as .pyquil_config and placed it in Users\myUser directly.
  2. I created a folder "Forest " as Users\myUser\Forest
  3. Pulled pyquil repository from rigetti github into it
  4. So now it is Users\myUser\Forest\pyquil
  5. Now, if I open IPython console in " Users\myUser " or " Users\myUser\Forest "and give "import pyquil.api " then I get the following error :

! WARNING: ! There was an error reading your pyQuil config file. ! Make sure you have a .pyquil_config file either in ! your home directory, or you have the environment ! variable PYQUIL_CONFIG set to a valid path. You must ! have permissions to read this file.

  1. And if I try to run examples -> hello-world.quil, then also it shows error and Python stops working.

Thanks

On Tue, Aug 1, 2017 at 4:08 AM, Aaron Vontell notifications@github.com wrote:

You will want to make sure that you follow these instructions:

  1. Your config file should be named exactly .pyquil_config, not .pyquil_config.ini
  2. The config file should not be placed in a folder in your root user directory. Your file should be placed directly in the root user folder, at the location Users\myUser.pyquil_config
  3. pyquil.api is not a command; it is a python module that should be imported for use. Are there specific errors that you are receiving? If so, can you paste them here?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rigetticomputing/pyquil/issues/91#issuecomment-319166351, or mute the thread https://github.com/notifications/unsubscribe-auth/ANb2mpvvmeLg5Jhjxm9x5VQOlDsETabEks5sTiY9gaJpZM4Ok4fW .

-- Akhil Pratap Singh

Phone : +81 080-9569-3356 E-mail : akhilpratap.singh21@gmail.com

vontell commented 7 years ago

Sorry it has taken a while to get back to you @akhil21. I would recommend taking a look at the configuration generation script for creating your pyquil configuration file automatically: https://github.com/rigetticomputing/pyquil#connecting-to-the-rigetti-forest

akhil21 commented 7 years ago

Thanks @vontell . Now I am able to connect. Now will try to run few examples.