Forum Archive

How to install networkx (or any other package)

london_gambler

Hi, I was wondering whether there is a way to install networkx (which is a package on pypi) or how to install other packages in general. I am a bit confused with the different ways people are suggesting, such as using wget or using stash, etc. How do we actually install packages? I would greatly appreciate any help on this... Thanks.

ccc

If .you search on the forum for networkx, you will see that this question has been asked and answered several times.

london_gambler

It would be nice if you could actually be of help instead of telling me to 'look it up'. I already have- and the answer given two years ago (downloading package and then using iTunes and/or some other program to put it into site packages) no longer works since iOS 8. Pythonista doesn't have iTunes file sharing and from what I understand there is no way to actually import a package either by importing it or by using the 'open in' extension. This is why I asked the question even though an answer was given a couple of years ago.

abcabc

I did the following steps to install networkx.
1. In stash, I did "pip install networkx"
2. networkx got installed but it gave error in installing "decorator"
3. I tried installing "decorator" module separately ('pip install decorator"), it failed again.
4. I copied decorator.py from the following url to site-packages
https://github.com/micheles/decorator/tree/master/src

5, I tried the following basic example and it worked.
http://networkx.github.io/documentation/development/examples/basic/properties.html

london_gambler

Thanks so much for your help... I have gotten it to work after following your steps .. much appreciated!

jamesafoster

Sorry, I don't see how to install networkx on pythonista on my iPad from these instructions. I don't have a terminal, so I can't run pip, right? And what is stash?

JonB

"What is stash?" is probably the first question you should have asked :) In this case, the search button produced many threads about the StaSh.
https://github.com/ywangd/stash