<p>First, make sure that Cytoscape is running -- you should be able to connect to the Cytoscape GUI.  Second, Cytoscape typically opens up it's REST port as port 1234.  Try and see if you can reach http://localhost:1234/v1/commands and see if you get a response.  Note: there is no &quot;api&quot; between the port and the version.</p>

CC BY-SA 4.0
2024-05-13T06:41:43.980Z
I can see a Cytsocape GUI at port 6080, but there is nothing at port 1234. I have tried all three Docker images described in the [https://hub.docker.com/r/cytoscape/cytoscape-desktop](link) above. Is there a different way I should run Cytoscape so that there is activity at port 1234?
Mara
CC BY-SA 4.0
2024-05-09T03:35:10.920Z
2024-05-09T03:35:10.920Z
Scooter Morris
<p>I have bunch of python code that uses cytoscape, specifically the cyrest.cyclient part of cytoscape. I know that the code itself <em>can</em> work, as a colleague of mine has used this previously on a small server, and I am now trying to run this locally.</p>
<p>I have installed py4cytoscape using the Docker image (see <a href="https://hub.docker.com/r/cytoscape/cytoscape-desktop" rel="nofollow noreferrer">Docker hub</a>).
This results in two different ports being used by cytoscape, one user interface of the program itself at port 6080, which is not what I want to use, and one Jupyter wrapper at port 8888. Only this last one seems to have an api, as the http://localhost:8888/api results in a (very sparse) page. However, I seem to not be able to access anything from this API.</p>
<p>When making the cyclient instance, I specify the port to be 8888, as that is the one with the API page. Within the cyclient, I use the network object. From the code, this contains the parameter <code>self.___url</code>, which is defined as follows:</p>
<pre><code>class network(object):
    &quot;&quot;&quot;
    cytoscape network interface as shown in CyREST's swagger documentation for 'network'.


    ':param url: an url of the type http://' + host + ':' + str(port) + '/' + version + '/'.
    &quot;&quot;&quot;

    def __init__(self, url):
        self.__url = url + 'commands/network'
    
</code></pre>
<p>The default <code>host</code> value is <code>localhost</code>, which is perfectly fine, and the default <code>version</code> is <code>v1</code>. This last part seems to be the issue, as both http://localhost:8888/api/v1 and http://localhost:8888/v1 give a 404 page not found error. For completeness sake, I also tested this with the port being 6080, but that, too, gave 404 page not found errors. Is there a way to find the correct version, or should I use a different port or Docker image for this to work?</p>

<cytoscape>
How can I access the Cytoscape infrastructure from a local Python file?
# How can I access the Cytoscape infrastructure from a local Python file?

(Asked by: username_0 on 2024-05-08)

I have bunch of python code that uses cytoscape, specifically the cyrest.cyclient part of cytoscape. I know that the code itself can work, as a colleague of mine has used this previously on a small server, and I am now trying to run this locally.
I have installed py4cytoscape using the Docker image (see Docker hub).
This results in two different ports being used by cytoscape, one user interface of the program itself at port 6080, which is not what I want to use, and one Jupyter wrapper at port 8888. Only this last one seems to have an api, as the http://localhost:8888/api results in a (very sparse) page. However, I seem to not be able to access anything from this API.
When making the cyclient instance, I specify the port to be 8888, as that is the one with the API page. Within the cyclient, I use the network object. From the code, this contains the parameter self.___url, which is defined as follows:
class network(object):
    """
    cytoscape network interface as shown in CyREST's swagger documentation for 'network'.


    ':param url: an url of the type http://' + host + ':' + str(port) + '/' + version + '/'.
    """

    def __init__(self, url):
        self.__url = url + 'commands/network'
    

The default host value is localhost, which is perfectly fine, and the default version is v1. This last part seems to be the issue, as both http://localhost:8888/api/v1 and http://localhost:8888/v1 give a 404 page not found error. For completeness sake, I also tested this with the port being 6080, but that, too, gave 404 page not found errors. Is there a way to find the correct version, or should I use a different port or Docker image for this to work?

**Tags:** cytoscape

---

## 1 answers

### Answer by username_1 on 2024-05-09. Score: 1

First, make sure that Cytoscape is running -- you should be able to connect to the Cytoscape GUI. Second, Cytoscape typically opens up it's REST port as port 1234. Try and see if you can reach http://localhost:1234/v1/commands and see if you get a response. Note: there is no "api" between the port and the version.

> **Comments:**
> **username_0**: I can see a Cytsocape GUI at port 6080, but there is nothing at port 1234. I have tried all three Docker images described in the [https://hub.docker.com/r/cytoscape/cytoscape-desktop](link) above. Is there a different way I should run Cytoscape so that there is activity at port 1234?  

---

