Note: You can also use the Ocean SDK in the Leap 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).
Note: If you have a 64-bit Windows OS and are running 32-bit Python, see also Are 32-bit and 64-bit Python Supported?
- 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.