Answered

Installing dwave-ocean-sdk on a Mac

I normally stay in C; it has been many moons since I had to debug Python installs. I have no idea what kind of errors I am seeing. Using either pip install dwave-ocean-sdk --user or pip install dwave-ocean-sdk.

Complete output from command python setup.py egg_info:
Couldn't find index page for 'pysmt' (maybe misspelled?)
No local packages or download links found for pysmt==0.7.0
install_dir .

Using python 2.7.10:

$ python -V
Python 2.7.10

I tried to install pysmt, and now and am getting:

Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/cj/sdphvs2166z39xxlwn216ydw0000gn/T/pip-install-HLNPIR/penaltymodel-maxgap/setup.py", line 72, in <module>
zip_safe=False
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/Library/Python/2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/dist.py", line 221, in __init__
self.fetch_build_eggs(attrs.pop('setup_requires'))
File "/Library/Python/2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/dist.py", line 245, in fetch_build_eggs
parse_requirements(requires), installer=self.fetch_build_egg
File "/Library/Python/2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 556, in resolve
raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (PySMT 0.7.5 (/Users/flip/Library/Python/2.7/lib/python/site-packages), Requirement.parse('pysmt==0.7.0'))

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/cj/sdphvs2166z39xxlwn216ydw0000gn/T/pip-install-HLNPIR/penaltymodel-maxgap/

0

Comments

16 comments
  • Got it working. Did this:

    $ brew postinstall python3

    ==> Postinstalling python

    ==> /usr/local/Cellar/python/3.7.0/bin/python3 -s setup.py --no-user-cfg install

    ==> /usr/local/Cellar/python/3.7.0/bin/python3 -s setup.py --no-user-cfg install

    ==> /usr/local/Cellar/python/3.7.0/bin/python3 -s setup.py --no-user-cfg install

    $ which pip3

    /usr/local/bin/pip3

    $ pip3 install dwave-ocean-sdk

    [ dwave installs here, with config and API token ]

     

    1
    Comment actions Permalink
  • Hello Thomas,

    Thank you for posting your issue in the community. We're glad you were able to resolve the problem.

    Feel free to reach out if you are having any other difficulties.

    0
    Comment actions Permalink
  • I'm experiencing issues installing on a mac as well - any assistance would be greatly appreciated as I'm beta testing for D-Wave:

    virtualenv ocean

    New python executable in /Users/CT15/ocean/ocean/bin/python

    Installing setuptools, pip, wheel...done.

    (ocean) McKinley:ocean CT15$ source ocean/bin/activate

    (ocean) McKinley:ocean CT15$ pip install dwave-ocean-sdk

    Collecting dwave-ocean-sdk

      Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x10df6eb50>: Failed to establish a new connection: [Errno 64] Host is down',)': /simple/dwave-ocean-sdk/

      Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x10df6ef90>: Failed to establish a new connection: [Errno 64] Host is down',)': /simple/dwave-ocean-sdk/

      Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x10df95110>: Failed to establish a new connection: [Errno 64] Host is down',)': /simple/dwave-ocean-sdk/

      Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x10df95250>: Failed to establish a new connection: [Errno 64] Host is down',)': /simple/dwave-ocean-sdk/

      Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x10df95390>: Failed to establish a new connection: [Errno 64] Host is down',)': /simple/dwave-ocean-sdk/

      Could not find a version that satisfies the requirement dwave-ocean-sdk (from versions: )

    No matching distribution found for dwave-ocean-sdk

    0
    Comment actions Permalink
  • Hi Cynthia,

    Please check your other post on this under "General Discussion" for replies. We're looking into this.  Thanks!

    0
    Comment actions Permalink
  • Hello,

     

    I have tried to install the dwave-ocean-sdk on my Mac but it failed.

     

    The pip installation, "pip install dwave-ocean-sdk", fails with the error message:

    ...

    Collecting ortools<7.0.0,>=6.6.4659 (from penaltymodel-mip<0.2.0,>=0.1.2->dwavebinarycsp<0.1.0,>=0.0.2->dwave-ocean-sdk)
      Could not find a version that satisfies the requirement ortools<7.0.0,>=6.6.4659 (from penaltymodel-mip<0.2.0,>=0.1.2->dwavebinarycsp<0.1.0,>=0.0.2->dwave-ocean-sdk) (from versions: )
    No matching distribution found for ortools<7.0.0,>=6.6.4659 (from penaltymodel-mip<0.2.0,>=0.1.2->dwavebinarycsp<0.1.0,>=0.0.2->dwave-ocean-sdk)

     

    This is not surprising since the PyPi only supports Mac OS 10.13 (High Sierra) for ortools and my version of Mac OS is 10.11, El Capitan.

    I installed ortools from source for Python as indicated here. It works.

    I tried "pip install dwave-ocean-sdk" again but got the same error message. So, maybe the ocean installation script does not check whether a package is already installed.

    I then tried the alternative way indicated on the ocean installation page:

    git clone https://github.com/dwavesystems/dwave-ocean-sdk.git
    cd dwave-ocean-sdk
    python setup.py install

    This installation failed too with the error message:

    Installed /Users/myname/Documents/develop/ocean/lib/python3.7/site-packages/numpy-1.15.2-py3.7-macosx-10.11-x86_64.egg
    Searching for dimod<0.8.0,>=0.7.0
    Reading https://pypi.org/simple/dimod/
    Downloading https://files.pythonhosted.org/packages/cb/52/d282aff05a91c1cdfea82f0af3a6dd4222a0a7079ddd02dde37225b9f85e/dimod-0.7.5.tar.gz#sha256=65faaff6b6781428d579f67678f43dfc589cfd21cd51312ebf99d0408a689791
    Best match: dimod 0.7.5
    Processing dimod-0.7.5.tar.gz
    Writing /var/folders/_n/dntl426134x2gbhkvbzb_bqn_npq_c/T/easy_install-mnzpoyuk/dimod-0.7.5/setup.cfg
    Running dimod-0.7.5/setup.py -q bdist_egg --dist-dir /var/folders/_n/dntl426134x2gbhkvbzb_bqn_npq_c/T/easy_install-mnzpoyuk/dimod-0.7.5/egg-dist-tmp-duu5yu_3
    dimod/roof_duality/_fix_variables.cpp:1512:3: warning: code will never be executed [-Wunreachable-code]
      CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
      ^~~~~~~~~~~~~~~~~~~~~~~
    1 warning generated.
    dimod/roof_duality/src/fix_variables.cpp:29:10: fatal error: 'boost/graph/graph_traits.hpp' file not found
    #include <boost/graph/graph_traits.hpp>
             ^
    1 error generated.
    error: Setup script exited with error: command '/usr/bin/clang' failed with exit status 1

     

    Although the complete ocean installation failed, some dwave related packages seems to have been installed through this process (python setup.py install) as indicated by the command line:

    (ocean) [~/Documents/develop/dwave-ocean-sdk]$ pip list
    Package Version
    --------------- -------
    dwave-neal 0.4.2
    dwave-networkx 0.6.5
    dwave-ocean-sdk 1.0.1
    dwave-qbsolv 0.2.9
    dwave-system 0.5.3
    dwavebinarycsp 0.0.6

    ...

     

    I have exhausted all the ideas I could think of and spent a fair amount of time on this problem.

    Please let me know if you have any suggestion on how to install ocean on a Mac with 10.11.

    0
    Comment actions Permalink
  • Hi, try `pip install penaltymodel-maxgap`, that is an older package that serves the same purpose as `penaltymodel-mip` but uses pysmt rather than ortools

    0
    Comment actions Permalink
  • As suggested, I tried `pip install penaltymodel-maxgap` and the installation failed with a similar error than I got using "python setup.py install" indicated in my original post:

     

    ...    /usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -Idimod/roof_duality/src/ -I/opt/local/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c dimod/roof_duality/_fix_variables.cpp -o build/temp.macosx-10.11-x86_64-3.7/dimod/roof_duality/_fix_variables.o
        dimod/roof_duality/_fix_variables.cpp:1512:3: warning: code will never be executed [-Wunreachable-code]
          CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
          ^~~~~~~~~~~~~~~~~~~~~~~
        1 warning generated.
        /usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -Idimod/roof_duality/src/ -I/opt/local/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c dimod/roof_duality/src/fix_variables.cpp -o build/temp.macosx-10.11-x86_64-3.7/dimod/roof_duality/src/fix_variables.o
        dimod/roof_duality/src/fix_variables.cpp:29:10: fatal error: 'boost/graph/graph_traits.hpp' file not found
        #include <boost/graph/graph_traits.hpp>
                 ^
        1 error generated.
        error: command '/usr/bin/clang' failed with exit status 1

        ----------------------------------------
    Command "/Users/myname/Documents/develop/ocean/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/_n/dntl426134x2gbhkvbzb_bqn_npq_c/T/pip-install-k1_rz606/dimod/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/_n/dntl426134x2gbhkvbzb_bqn_npq_c/T/pip-record-2g1sk1e8/install-record.txt --single-version-externally-managed --compile --install-headers /Users/myname/Documents/develop/ocean/bin/../include/site/python3.7/dimod" failed with error code 1 in /private/var/folders/_n/dntl426134x2gbhkvbzb_bqn_npq_c/T/pip-install-k1_rz606/dimod/

     

    Do you have any suggestion to solve this problem?

     

    Is it possible to install ocean with the ortools for python that I have installed from source?

    0
    Comment actions Permalink
  • Hi, that was actually an issue with one of our dependencies, I've just released a new version and it should be live in an hour or so. Can you try again this evening?

    0
    Comment actions Permalink
  • Sure. I can try again later.

    Can you tell me which command I should try later?

    pip install penaltymodel-maxgap?

    pip install dwave-ocean-sdk?

    python setup.py install?

     

    Thank you.

     

    0
    Comment actions Permalink
  • `pip install penaltymodel-maxgap`

    0
    Comment actions Permalink
  • `pip install penaltymodel-maxgap` worked. Thank you.

     

    I then tried pip install dwave-ocean-sdk and got the error:

    Collecting ortools<7.0.0,>=6.6.4659 (from penaltymodel-mip<0.2.0,>=0.1.2; platform_machine != "x86" and python_version != "3.4"->dwavebinarycsp<0.1.0,>=0.0.2->dwave-ocean-sdk)
      Could not find a version that satisfies the requirement ortools<7.0.0,>=6.6.4659 (from penaltymodel-mip<0.2.0,>=0.1.2; platform_machine != "x86" and python_version != "3.4"->dwavebinarycsp<0.1.0,>=0.0.2->dwave-ocean-sdk) (from versions: )
    No matching distribution found for ortools<7.0.0,>=6.6.4659 (from penaltymodel-mip<0.2.0,>=0.1.2; platform_machine != "x86" and python_version != "3.4"->dwavebinarycsp<0.1.0,>=0.0.2->dwave-ocean-sdk)

     

    so I tried the alternate method:

    git clone https://github.com/dwavesystems/dwave-ocean-sdk.git

    cd dwave-ocean-sdk

    python setup.py install

    That nearly worked. I got the following message:

    Installed /Users/myname/Documents/develop/ocean/lib/python3.7/site-packages/Click-7.0-py3.7.egg
    Searching for ortools<7.0.0,>=6.6.4659
    Reading https://pypi.org/simple/ortools/
    No local packages or working download links found for ortools<7.0.0,>=6.6.4659
    error: Could not find suitable distribution for Requirement.parse('ortools<7.0.0,>=6.6.4659')

     

    The reason I got this message is that ortools is in my pythonpath but not in my pythonpath in the virtualenv ocean.

    What is the best way to add the path to my ortools installation to the ocean virtualenv?

    0
    Comment actions Permalink
  • I strongly recommend using pyenv (https://github.com/pyenv/pyenv) to manage your Pythons. Install it using brew (if on Mac) or follow the instructions on their Github README for Linux. This is still optional for the following, but recommended. And of course remove any other Pythons you have installed if possible.

    Then within your Pythons install pipenv (https://github.com/pypa/pipenv). "pip install pipenv".

    pipenv combines virtualenv and pip requirements.txt files, and adds lock file support. It's awesome, try it out. It works similar to how npm+yarn work

    1
    Comment actions Permalink
  • I have solved my problem by adding a path in the virtual environment to the system wide installed (from source) OR tools. I achieved that by adding the path in a .pth file placed in the virtual environment site-package directory. The installation of ocean has then worked.

    1
    Comment actions Permalink
  • Dear Alexandre,

    could you please share steps on installation dwave ocean sdk?

    I am still facing the problem of installation on my Mac and I will be happy if you can explain which commands you used?

    Thank you!

    0
    Comment actions Permalink
  • Gulzhan,

    I do not remember more details than the ones I shared in this post 5 years ago.

    Sorry

    0
    Comment actions Permalink
  • Hello,

    It might be a good idea to start a new thread giving a clear explanation of your problem, the steps you took, any error messages, your system specifications, and the resources you are using to install Ocean Tools.

    If you haven't had a chance to look at the Ocean Tools Getting Started guide, this is a great place to start.

    Thanks for your understanding and communication.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post