Problems with installation
I am just starting setting up ocean and the D-Wave cloud on my laptop, but I have met several problems. I am following the step described here: https://docs.ocean.dwavesys.com/en/latest/overview/install.html.
So, I created a new environment, installed dwave-ocean-sdk, and tried to create a config file, but I get an error message right away:
```$ dwave config create
Traceback (most recent call last):
File "/Users/elisabettavaliante/git/ocean/bin/dwave", line 6, in <module>
from dwave.cloud.cli import cli
ImportError: No module named cloud.cli```
I have OSX 10.14.4, and I notices that the installation has only been testes on OSX 10.13, could this be the problem?
I repeated the steps above in a docker with ubuntu16 installed. I am able to create the config file, but I don't find any solver when calling ping:
```# dwave ping
Using endpoint: https://cloud.dwavesys.com/sapi
Error: Solver not available. (code: 6)```
I can find the solver if I use a Python interpreter:
```>>> from dwave.cloud import Client
>>> client = Client.from_config(token='XXXXX')
>>>client.get_solvers()
[Solver(id=u'DW_2000Q_2_1')]```
But, when using the Python interpreter, I cannot file the sampler and I get `SolverNotFoundError`:
```>>> from dwave.system.samplers import DWaveSampler
>>> sampler = DWaveSampler()
SolverNotFoundError Traceback (most recent call last)
<ipython-input-5-63c6d7b35973> in <module>()
----> 1 sampler = DWaveSampler()
/root/git/ocean/lib/python2.7/site-packages/dwave/system/samplers/dwave_sampler.pyc in __init__(self, **config)
111
112 self.client = Client.from_config(**config)
--> 113 self.solver = self.client.get_solver()
114
115 # need to set up the nodelist and edgelist, properties, parameters
/root/git/ocean/lib/python2.7/site-packages/dwave/cloud/client.pyc in get_solver(self, name, refresh, **filters)
953 return self.get_solvers(refresh=refresh, **filters)[0]
954 except IndexError:
--> 955 raise SolverNotFoundError("Solver with the requested features not available")
956
957 def _submit(self, body, future):
SolverNotFoundError: Solver with the requested features not available```
Any idea what is wrong?
Comments
Hello,
For Mac OSX 10.14.4, there might be a number of issues caused by the newer version being used.
If you can verify that dwave-ocean-sdk successfully installed, that would be a good place to start.
I imagine that there were issues on installation, since some of the libraries might require specific steps to get them working.
Were there any errors when installing the ocean tools?
What version of Python are you using?
For the Ubuntu16 install, could you please provide the configuration (censoring sensitive data like your API token, of course).
You can use this command to print out the config file information in terminal:
dwave config inspect
Also, can you verify that DW_2000Q_2_1 is in your supported solvers at the bottom of your leap home page:
https://cloud.dwavesys.com/leap/
Thank you very much for the answers!
Mac OSX 10.14.4: the installation of dwave-ocean-sdk was smooth, I did not get any error. Below, at the end of this message, are all the messages I got during installation. I am using Python 2.7.15.
Ubuntu16: here is my config file, I created it just following the initial instructions I linked above. On ubuntu, I'm using Python 2.7.12.
```Configuration file: auto-detected
Profile: auto-detected
---
token = XXX
endpoint = https://cloud.dwavesys.com/sapi
client = qpu
solver = {"qpu": true, "vfyc": true}```
Dashboard: yes, I confirm that DW_2000Q_2_1 is the only solver available for me.
```DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting dwave-ocean-sdk
Using cached https://files.pythonhosted.org/packages/1f/a5/071bc7e1c156d0645ab1aac64b3ab865901570a179241d6496d653ac12cd/dwave_ocean_sdk-1.3.0-py2.py3-none-any.whl
Collecting dwave-system<0.8.0,>=0.7.0 (from dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/e8/17/cc35eaf3a497467fac93e31d5d56dfb75551d4a3ea05fa83074c6666baf0/dwave_system-0.7.3-py2.py3-none-any.whl
Collecting dwave-networkx<0.8.0,>=0.7.0 (from dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/ce/2b/34463199016d3d2af38a56c56494ea0642e339a6e48d13370029a1ed92ff/dwave_networkx-0.7.1-py2.py3-none-any.whl
Collecting dwavebinarycsp[mip]<0.1.0,>=0.0.9; (platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64") and python_version != "3.4" (from dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/97/c2/070e77f2b4b8db26f50fca1dec625eb50660ff39a2f80c8913f59cf0a89c/dwavebinarycsp-0.0.11-py2.py3-none-any.whl
Collecting dwave-hybrid<0.3.0,>=0.2.0 (from dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/0e/60/71e8f3104737e7f55a71e8f0cc150548f1a820bfabf6b196cd5cbb1acc46/dwave_hybrid-0.2.1-py2.py3-none-any.whl
Collecting dimod<0.9.0,>=0.8.0 (from dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/25/0b/db5be8f088749943190ae91ff7b1772b59732d4388a4b7051bdef44a82fe/dimod-0.8.12-cp27-cp27m-macosx_10_13_x86_64.whl
Collecting dwave-qbsolv<0.3.0,>=0.2.7 (from dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/63/32/bf248838bc035de6926cb3bed4fecd84e603e05d7e8ce12639814bad0240/dwave_qbsolv-0.2.10-cp27-cp27m-macosx_10_13_x86_64.whl
Collecting dwave-tabu<0.2.0,>=0.1.3 (from dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/38/e3/6536a8fd9f9013673fbe6e5918b19169d18c4e40284d8b5d4d9e94f9820f/dwave_tabu-0.1.4-cp27-cp27m-macosx_10_13_x86_64.whl
Collecting numpy<1.16.0 (from dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/c0/b9/2b485bb32d0b26631f433580d90daad5dea830e6dc5bd18c4f227b1829f7/numpy-1.15.4-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting dwave-neal<0.5.0,>=0.4.0 (from dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/50/92/4e7e7140691d5e84780a9c51e5ee20b1c13e6cf3543e8f7aec09258c3a27/dwave_neal-0.4.6-cp27-cp27m-macosx_10_13_x86_64.whl
Collecting six<2.0.0,>=1.11.0 (from dwave-system<0.8.0,>=0.7.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting minorminer<0.2.0,>=0.1.3 (from dwave-system<0.8.0,>=0.7.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/48/45/4c740cbf3868065ff9d14d7e501a95914f7cd77d95357f69975200e55748/minorminer-0.1.8-cp27-cp27m-macosx_10_12_x86_64.whl
Collecting dwave-cloud-client<0.6.0,>=0.5.0 (from dwave-system<0.8.0,>=0.7.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/9a/9e/e9259a3479b26bb316a42ba2303b5600d9c04682a59eb10652dc2f1404d3/dwave_cloud_client-0.5.4-py2.py3-none-any.whl
Collecting homebase<2.0.0,>=1.0.0 (from dwave-system<0.8.0,>=0.7.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/50/ad/e0080c35bd177682d5118a95bc2e7c1ac0541394b4ffce5e9554b6a077f9/homebase-1.0.1-py2.py3-none-any.whl
Collecting networkx<3.0,>=2.0 (from dwave-system<0.8.0,>=0.7.0->dwave-ocean-sdk)
Collecting decorator<5.0.0,>=4.1.0 (from dwave-networkx<0.8.0,>=0.7.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/5f/88/0075e461560a1e750a0dcbf77f1d9de775028c37a19a346a6c565a257399/decorator-4.4.0-py2.py3-none-any.whl
Collecting penaltymodel-cache<0.5.0,>=0.4.0 (from dwavebinarycsp[mip]<0.1.0,>=0.0.9; (platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64") and python_version != "3.4"->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/38/36/1580a020e09aff581297efd6ea58c882202ac4ef574613ee5a6709b1f2b5/penaltymodel_cache-0.4.0-py2.py3-none-any.whl
Collecting penaltymodel<0.17.0,>=0.16.0 (from dwavebinarycsp[mip]<0.1.0,>=0.0.9; (platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64") and python_version != "3.4"->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/ec/3c/a61423b81bb178198d6670aa0d4b8f69c5d39379f8b24def4ad5595656cd/penaltymodel-0.16.2-py2.py3-none-any.whl
Collecting penaltymodel-mip<0.3.0,>=0.2.0; extra == "mip" (from dwavebinarycsp[mip]<0.1.0,>=0.0.9; (platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64") and python_version != "3.4"->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/08/ae/dcb44d5167d02addc6eef020c23e584b81540867524073d35952714192ed/penaltymodel_mip-0.2.1-py2.py3-none-any.whl
Collecting click>5 (from dwave-hybrid<0.3.0,>=0.2.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl
Collecting plucky>=0.4.3 (from dwave-hybrid<0.3.0,>=0.2.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/d8/70/7b43e7280284bafecb345f4edb3eea7042cf0d089c5d112920eda650fda5/plucky-0.4.3-py2.py3-none-any.whl
Collecting futures; python_version == "2.7" (from dwave-hybrid<0.3.0,>=0.2.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/2d/99/b2c4e9d5a30f6471e410a146232b4118e697fa3ffc06d6a65efde84debd0/futures-3.2.0-py2-none-any.whl
Collecting enum34<2.0.0,>=1.1.6; python_version <= "3.3" (from dimod<0.9.0,>=0.8.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/c5/db/e56e6b4bbac7c4a06de1c50de6fe1ef3810018ae11732a50f15f62c7d050/enum34-1.1.6-py2-none-any.whl
Collecting jsonschema<3.0.0,>=2.6.0 (from dimod<0.9.0,>=0.8.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/77/de/47e35a97b2b05c2fadbec67d44cfcdcd09b8086951b331d82de90d2912da/jsonschema-2.6.0-py2.py3-none-any.whl
Collecting python-dateutil>=2.7 (from dwave-cloud-client<0.6.0,>=0.5.0->dwave-system<0.8.0,>=0.7.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl
Collecting requests[socks]>=2.18 (from dwave-cloud-client<0.6.0,>=0.5.0->dwave-system<0.8.0,>=0.7.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl
Collecting configparser; python_version == "2.7" (from dwave-cloud-client<0.6.0,>=0.5.0->dwave-system<0.8.0,>=0.7.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/ba/05/6c96328e92e625fc31445d24d75a2c92ef9ba34fc5b037fe69693c362a0d/configparser-3.7.4-py2.py3-none-any.whl
Collecting ortools<7.0.0,>=6.6.4659 (from penaltymodel-mip<0.3.0,>=0.2.0; extra == "mip"->dwavebinarycsp[mip]<0.1.0,>=0.0.9; (platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64") and python_version != "3.4"->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/bd/3a/7b20bd8d3d1b5f17fb457f3a5b2c8efb762fcd2c147a83b7134aa28aa003/ortools-6.10.6025-cp27-cp27m-macosx_10_13_x86_64.whl
Collecting functools32; python_version == "2.7" (from jsonschema<3.0.0,>=2.6.0->dimod<0.9.0,>=0.8.0->dwave-ocean-sdk)
Collecting certifi>=2017.4.17 (from requests[socks]>=2.18->dwave-cloud-client<0.6.0,>=0.5.0->dwave-system<0.8.0,>=0.7.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/60/75/f692a584e85b7eaba0e03827b3d51f45f571c2e793dd731e598828d380aa/certifi-2019.3.9-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests[socks]>=2.18->dwave-cloud-client<0.6.0,>=0.5.0->dwave-system<0.8.0,>=0.7.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting idna<2.9,>=2.5 (from requests[socks]>=2.18->dwave-cloud-client<0.6.0,>=0.5.0->dwave-system<0.8.0,>=0.7.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
Collecting urllib3<1.25,>=1.21.1 (from requests[socks]>=2.18->dwave-cloud-client<0.6.0,>=0.5.0->dwave-system<0.8.0,>=0.7.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/01/11/525b02e4acc0c747de8b6ccdab376331597c569c42ea66ab0a1dbd36eca2/urllib3-1.24.3-py2.py3-none-any.whl
Collecting PySocks!=1.5.7,>=1.5.6; extra == "socks" (from requests[socks]>=2.18->dwave-cloud-client<0.6.0,>=0.5.0->dwave-system<0.8.0,>=0.7.0->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/fe/82/c7db0c22c41a9e67d6fd92cc7187e51192937372cb640b13f4fd5a27bad2/PySocks-1.7.0-py27-none-any.whl
Collecting protobuf>=3.6.1 (from ortools<7.0.0,>=6.6.4659->penaltymodel-mip<0.3.0,>=0.2.0; extra == "mip"->dwavebinarycsp[mip]<0.1.0,>=0.0.9; (platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64") and python_version != "3.4"->dwave-ocean-sdk)
Using cached https://files.pythonhosted.org/packages/6d/4d/b4ba2bb8bd7e7ef6846f295a095e07f61ce896c83786dcea48a1dd4149f5/protobuf-3.7.1-cp27-cp27m-macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Requirement already satisfied: setuptools in ./ocean/lib/python2.7/site-packages (from protobuf>=3.6.1->ortools<7.0.0,>=6.6.4659->penaltymodel-mip<0.3.0,>=0.2.0; extra == "mip"->dwavebinarycsp[mip]<0.1.0,>=0.0.9; (platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64") and python_version != "3.4"->dwave-ocean-sdk) (41.0.1)
Installing collected packages: six, numpy, minorminer, python-dateutil, certifi, chardet, idna, urllib3, PySocks, requests, click, plucky, configparser, enum34, homebase, futures, dwave-cloud-client, decorator, networkx, functools32, jsonschema, dimod, dwave-networkx, dwave-system, penaltymodel, penaltymodel-cache, protobuf, ortools, penaltymodel-mip, dwavebinarycsp, dwave-neal, dwave-tabu, dwave-hybrid, dwave-qbsolv, dwave-ocean-sdk
Successfully installed PySocks-1.7.0 certifi-2019.3.9 chardet-3.0.4 click-7.0 configparser-3.7.4 decorator-4.4.0 dimod-0.8.12 dwave-cloud-client-0.5.4 dwave-hybrid-0.2.1 dwave-neal-0.4.6 dwave-networkx-0.7.1 dwave-ocean-sdk-1.3.0 dwave-qbsolv-0.2.10 dwave-system-0.7.3 dwave-tabu-0.1.4 dwavebinarycsp-0.0.11 enum34-1.1.6 functools32-3.2.3.post2 futures-3.2.0 homebase-1.0.1 idna-2.8 jsonschema-2.6.0 minorminer-0.1.8 networkx-2.2 numpy-1.15.4 ortools-6.10.6025 penaltymodel-0.16.2 penaltymodel-cache-0.4.0 penaltymodel-mip-0.2.1 plucky-0.4.3 protobuf-3.7.1 python-dateutil-2.8.0 requests-2.21.0 six-1.12.0 urllib3-1.24.3```
So for the configuration file, you will want to use the actual name of the solver.
Here is an example of my config file:
Looking into the Mac version issue further and will update with info as soon as it becomes available!
Please let us know if this helps fix your issue on Ubuntu.
Thanks in advance!
Hi David,
thanks a lot for the tip, modifying the configuration file according with your suggestion did actually work.
Please keep me updated on any news on how to fix the Mac problem.
Thanks again!
So, I am working on a couple of thoughts on this.
I was able to install dwave-ocean-sdk and then run dwave config create without any issues after upgrading to Mac OSX 10.14.4.
If you are a little confused, you can just follow the instructions and send the output from the commands back here.
I tried to include enough information that could help you troubleshoot on your own, but it is a bit complicated, so don't feel bad if you get stuck and need some help.
It's suspicious that the dwave command can be found but not the dwave.cloud.cli library.
Are you running dwave config create inside of the virtualenv?
Did you install the dwave-ocean-sdk while the virtualenv is activated?
The virtualenv is activated by running the following command in terminal:
$ source ocean/bin/activate
You will see (ocean) at the beginning of the command prompt once you run this command.
This means that the libraries are being installed into the confines of the virtual environment that you named "ocean" when you created it.
Another thing I was thinking is maybe different python installs are being called?
Can you please check the following:
What is the first line in this file:
/Users/elisabettavaliante/git/ocean/bin/dwave
Compare that to the output of running these commands in the command prompt (while you are in the virtualenv):
$ which python
Also run this command too to make sure the path matches the which python output:
$ which pip
The python instance being called by the dwave file should be the same as the one being called from the command line when you are in the virtual environment.
It's possible that the dwave.cloud.cli library got installed for the command line python but the dwave script is pointing to a different python where the cloud client is not installed.
This is a weird situation, but it can happen.
Another nice way of seeing if the cloud client is installed in the virtulenv python install is by running:
$ pip freeze | grep dwave-cloud-client
You can also open python in a terminal and try to import the cli library like this:
$ python
>>> from dwave.cloud.cli import cli
You can do the same by using the path on the first line of the dwave file, and see if the cli imports in one and not the other.
$ first/line/of/dwave/file/python
>>> from dwave.cloud.cli import cli
When you created your virtualenv, it will have used a python and pip version installed on the machine.
Sometimes these configurations can get a bit messy, especially if you have multiple installs of python.
Try deactivating the virtualenv and running the which commands on python an pip as in the following:
$ deactivate
$ which python
$ which pip
The paths for pip and python should match up.
This is a lot for now, so let's see where this takes us.
Hi David,
thanks a lot for looking into this.
I have done all the tests you suggested, with some weird results. I write my words in italic and I quote your suggestions with the '>' symbol, to try to keep things clear.
I installed the dwave-ocean-sdk inside ocean, while it was activated and I run `dwave config create` inside ocean.
> What is the first line in this file: /Users/elisabettavaliante/git/ocean/bin/dwave
#!/Users/elisabettavaliante/git/ocean/bin/python2.7
> $ which python
/Users/elisabettavaliante/git/ocean/bin/python
> $ which pip
/Users/elisabettavaliante/git/ocean/bin/pip
> $ pip freeze | grep dwave-cloud-client
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
dwave-cloud-client==0.5.4
> $ python
> >>> from dwave.cloud.cli import cli
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named cloud.cli
The same happen if I do:
> $ /Users/elisabettavaliante/git/ocean/bin/python
> >>> from dwave.cloud.cli import cli
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named cloud.cli
But see what happens if instead I call IPython:
$ ipython
/usr/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py:726: UserWarning: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv.
warn("Attempting to work in a virtualenv. If you encounter problems, please "
Python 2.7.15 (default, Jan 12 2019, 21:07:57)
Type "copyright", "credits" or "license" for more information.
IPython 5.7.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: from dwave.cloud.cli import cli
In [2]: cli.help
Out[2]: u'D-Wave Cloud Client interactive configuration tool.'
So, I find the library if I call it from IPython (which is not installed in the virtual environment), but I don't if I call it from python.
Interestingly, I cannot find the library any more if I deactivate the environment.
> $ deactivate
> $ which python
/usr/local/opt/python@2/bin/python
> $ which pip
/usr/local/opt/python@2/bin/pip
$ python
Python 2.7.15 (default, Jan 12 2019, 21:07:57)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from dwave.cloud.cli import cli
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named cloud.cli
Same if I use IPython:
$ ipython
Python 2.7.15 (default, Jan 12 2019, 21:07:57)
Type "copyright", "credits" or "license" for more information.
IPython 5.7.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: from dwave.cloud.cli import cli
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-b8f90f1905a1> in <module>()
----> 1 from dwave.cloud.cli import cli
ImportError: No module named cloud.cli
One more thing I just tried was doing a query on the file like this:
ls -alh /Users/elisabettavaliante/git/ocean/bin/python
It basically just assured that the python file is linked to python2.7 in the same folder.
I did the same with pip and it was just an executable, so nothing interesting there.
I'd be curious to see if it's the same for yours.
Another thought I had was to pip uninstall dwave-cloud-client and reinstall explicitly:
pip uninstall dwave-cloud-client
pip install dwave-cloud-client
But it does seem weird that pip freeze shows it and but python can't import it.
One more thing I have done when I really want to nail down the install to make sure there is no room for ambiguity is explicitly point to the python version I want when creating the virtual environment.
I had to do this when creating the virtual environment to debug this issue, because the default I have is python 3.
So in order to select the python you want, you can use the -p option with the path to the location of the python executable.
If this doesn't work, you might want to consider installing python in another location and using that one as the python for this virtualenv.
The virtualenv command will look like this:
virtualenv -p path/to/python
This kind of thing can happen when installing mutliple versions of python to the default locations.
They should work together, but often don't unfortunately.
I also found this stack overflow article about permissions.
Maybe the installed library has elevated permissions.
Here's the link:
https://stackoverflow.com/questions/14295680/unable-to-import-a-module-that-is-definitely-installed
I wonder if you could try running dwave config create with the sudo command:
sudo dwave config create
Also check out the stack overflow though.
I saw a comment in there that might be a better solution than running dwave with sudo.
Here's their comment:
This happened to me, just running
sudo pip install .... Simple fix:sudo chmod -R ugo+rX /lib/python2.7/site-packages/Please sign in to leave a comment.