Note: You can also use a supported integrated development environment (IDE).
Create a Virtual Environment
When working with Python, you’ll often need install a number of packages using pip for each program you’re working on. Since these packages are updated regularly and may sometimes conflict with each other, a good development practice is to create virtual environments.
Using a tool like virtualenv, a virtual environment provides a separate development environment where you can install packages and run a program without changing or interfering with your system package and settings.
Due to the frequency with which Python packages are modified, it’s a good idea to regularly create new virtual environments when working on an ongoing project.
Install the Ocean SDK
Follow these instructions to access and install the Ocean™ SDK (Python).
We recommend that you work in a virtual environment. If you are new to Python in virtual environments, see our Getting Started guidelines in the Ocean software documentation.
Command-line install:
- To set up the required dependencies, run the following command from your terminal:
pip install dwave-ocean-sdk && dwave setup - Follow the script and:
- accept the terms and conditions,
- agree to create a configuration file, and
- answer the prompts to add your information to the config file.
- Paste your API token into your terminal when prompted. You can find your API token on the Leap™ dashboard.
- Paste your Solver API Endpoint into your terminal when prompted. You can also find this on the Leap dashboard, towards the bottom of the page.
- All other settings can be left blank for default settings by hitting "Enter".
- You should now be able to connect to a D-Wave™ system. Verify with the following command: dwave ping.
Solve your own problems or begin with our end-to-end examples.
Comments
Article is closed for comments.