Anyone have experience using the Nessi Python Network Simulator? - python

I am working on creating a simulation for the selective-reject ARQ protocol for my networking class. I found a great network simulator, written in python called Nessi:
http://jer.iict.ch/logiciels
The one problem is that it seems Nessi relies on an older version of python (2.4) than what I currently have installed on my computer(2.7).
There is almost no documentation and I am trying to figure out where to begin!
I have two questions:
Has anyone tried installing Nessi on Snow Leopard, OSX?
I am thinking of using virtualenv to have a contained version of
python and the necessary modules for Nessi. Is there something else
I should be considering?

It is possible to run it in Snow Leopard.
Use a package management system like fink to install the dependencies required for this package, I think most of the dependencies can be installed using fink like(psyco, numpy, matplotlib,wxpython), you have to experiment with newer version of python to see how it goes, because certain libraries available in fink are for newer version of python.
Fink separates the binary it installs from system binaries, so you can work without fear of damaging your system binaries.

Related

How is Anaconda related to Python?

I am a beginner and I want to learn computer programming. So, for now, I have started learning Python by myself with some knowledge about programming in C and Fortran.
Now, I have installed Python version 3.6.0 and I have struggled finding a suitable text for learning Python in this version. Even the online lecture series ask for versions 2.7 and 2.5 .
Now that I have got a book which, however, makes codes in version 2 and tries to make it as close as possible in version 3 (according to the author); the author recommends "downloading Anaconda for Windows" for installing Python.
So, my question is: What is this 'Anaconda'? I saw that it was some open data science platform. What does it mean? Is it some editor or something like Pycharm, IDLE or something?
Also, I downloaded my Python (the one that I am using right now) for Windows from Python.org and I didn't need to install any "open data science platform".
So what is this happening?
Please explain in easy language. I don't have too much knowledge about these.
Anaconda is a commercial python and R distribution. It aims to provide everything you need (Python-wise) for data science "out of the box".
It includes:
The core Python language
100+ Python "packages" (libraries)
Spyder (IDE/editor - like PyCharm) and Jupyter
conda, Anaconda's own package manager, used for updating Anaconda and packages
Your course may have recommended it as it comes with these extras but if you don't need them and are getting on fine with vanilla Python that's OK too.
Learn more: https://www.anaconda.com/distribution/
Anaconda is a Python distribution that makes it easy to install Python plus a number of its most often used 3rd party libraries in a flexible way on a Windows or Linux machine.
My experiences with it are very positive, both on Windows and Linux. It is quite complete and avoids problems in building libraries that you need from source code, that frequently plague one by one installations of those libraries by tools like pip.
By the way: It's very wise to start with 3.5 or 3.6 since 2.7 is approaching the end of its lifecycle, though many applications still depend on it.
As for tutorials: Pythons own docs are quite suitable for learning the language.
https://docs.python.org/3/tutorial/
Anaconda is a Python-based data processing and scientific computing platform. It has built in many very useful third-party libraries. Installing Anaconda is equivalent to automatically installing Python and some commonly used libraries such as Numpy, Pandas, Scrip, and Matplotlib, so it makes the installation so much easier than regular Python installation. If you don't install Anaconda, but instead only install Python from python.org, you also need to use pip to install various libraries one by one. It is painful and you need to consider compatibility, thus it is highly recommended to directly install Anaconda.

Why Should Homebrew be used to Install Python?

I have been reading a lot of the tutorials around the web and answers on the site about using Homebrew. When it comes to Python though, the advice leaves me with more questions than answers.
I understand the how, but none of the answers I have seen so far have really explained the why behind using Homebrew to install Python and what the benefits are to installing Python with Homebrew as opposed to using OS-X installers provided by the Python Foundation?
The newest versions of the installers from Python and the current implementation of PIP seem to be working pretty well, so I would really appreciate any input on my question. I have worked with Python for a while but from more of a tactical, one off problem solving perspective and I am brand new to tools like Brew and version control software such as Git. I am trying to get up the learning curve. Finding an answer to why I would choose to go with a Homebrew install over just heading over to python.org and downloading from them and then using pip to install packages might help me to understand the benefits of a tool like Homebrew.
So I guess, what does Homebrew give me that going through the installation put in place by TPF does not?
Are there advantages/disadvantages to where Homebrew installs Python and Python packages over the /Library/Frameworks/ and the site-packages folder within that framework?
Though this last question is too broad and likely out of scope, if anyone would also address or provide a link to a good answer on what the benefits are of using Homebrew in general, I'd appreciate it?
Thank you,
The big advantage of using a package manager like Homebrew is it makes it easier to keep your Python installation up to date. If you download Python from the website, then to update it means you'll need to go back to the website and download a new copy of Python (or whatever it is that you need to update that could have been installed with Homebrew).
Also, when downloading installers, I find they tend to clutter up my downloads folder and require me to periodically clean up unused files. I'd rather spend my time coding instead of managing my disk space usage.
When it comes to updating any package with Homebrew, the command is simple:
brew upgrade
And this will update all outdated packages that you installed with Brew.
Now, this isn't something unique to Homebrew. Macports, PIP, npm, Maven, and other package management tools are also able to manage the versions of modules or tools you install.
For more information, see Safari Books Online - Keeping Your Homebrew Up To Date.
A few reasons not to use system python on OS X from this post,
Apple doesn’t always do a good job on keeping the Python runtime environment up to date,
it can be cumbersome to play with permissions just to install third-party Python libraries,
finally, Apple has a tendency to wipe-out your site-packages with every major OS upgrade.
The use of an independent package manager for Python modules, such as Homebrew, conda, Macports, ets. is thus preferred.

install natgrid in matplotlib in the environment of python 2.7

I'm quit new in using python. The current version I'm using is 2.7. I need to employ function mncontour in minuit which requires the installation of natgrid as additional toolkit for matplotlib. I downloaded natgrid 0.2.1 with a file named setup.py in it. I ran this setup.py through python shell without reaching any error. But it seems that the installation was not succeed. Anyone has any idea how the installation can be done? Many thanks.
Liang
Could you please provide some more information on this topic.
what operating system you are working with ( some offer more support than others for python)
have you installed python headers, and a C/C++ compiler in your environment? ( numerical libraries might require native code to speed up the computation)
Have you tried a package manager for python ( such as easy or pip)? Both work on both windows and unixes, and usually download and install all the needed packages to make your module working.
A piece of the setup's output before setup.py finished would help us help you greatly.
Python for Windows [Nt - 7] is compiled with either cygwin or mingw, thus you not only need the python environment, but also said compiler, and python headers. If you want a more point and click install, then there's this professor at this university who maintains a good and up to date repository of scientific python modules, that depend on native extensions ( among which numpy, scipy, matplotlib).
http://www.lfd.uci.edu/~gohlke/pythonlibs/
Manuals to setup mingw and python :
https://docs.python.org/2/using/windows.html
MingW can be downloaded from here:
http://www.mingw.org/
Best option for installing natgrid is from conda
conda install -c jochym natgrid=0.2

Allowing python use modules from other python installation

I normally use python 2.7.3 traditionally installed in /usr/local/bin, but I needed to rebuild python 2.6.6 (which I did without using virtualenv) in another directory ~/usr/local/ and rebuild numpy, scipy, all libraries I needed different versions from what I had for python 2.7.3 there...
But all the other packages that I want exactly as they were (meaning same version) in my default installation, I don't know how to just use them in the python 2.6.6 without having to download tarballs, build and installing them using --prefix=/home/myself/usr/local/bin.
Is there a fast or simpler way of "re-using" those packages in my "local" python 2.6.6?
Reinstall them. It may seem like a no-brainer to reuse modules (in a lot of cases, you can), but in the case of modules that have compiled code - for long term systems administration this can be an utter nightmare.
Consider supporting multiple versions of Python for multiple versions / architectures of Linux. Some modules will reference libraries in /usr/local/lib, but those libraries can be the wrong arch or wrong version.
You're better off making a requirements.txt file and using pip to install them from source.

Can EPD Python and MacPorts Python coexist on OS X (matplotlib)?

I've been using MacPorts Python 2.6 on OS X 10.6.
I am considering also installing the Enthought Python Distribution (EPD) on the same machine because it comes preconfigured with matplotlib and other nice data analysis and visualization packages.
Can the two Python distributions co-exist peacefully on the same machine?
What potential problems will I have to look out for (e.g., environment variables)?
I know that building matplotlib through MacPorts is an option, but the process is lengthy (on the order of a full day) and there are open questions about compiling some dependencies on 64bit Intel.
I would like to know about the tradeoffs before committing to one of the two approaches.
I'm not an OSX user, so I can't say for certain, but you should be fine.
EPD bundles its own python interpreter and all required libraries. The installer basically just extracts a tarball into a stand-alone folder.
The linux installer doesn't modify any environment variables (not even $PATH), so I assume the mac installer is similar.
(Because of this, you'll probably want to manually set up aliases to the EPD python/ipython/etc binaries so you can more easily call them without changing your $PATH.)
EPD really should be completely stand-alone, as far as I know. It should be safe to install along-side anything else.
I've used EPD on Windows 7. It works great. Only stalled on me a couple of times with rather large data set.
I also use OSX, and was about to install EPD but hesitating a bit.
I think python 2.7.3 that comes with EPD (early 2013) will become the default python. Normally, upgrading to 2.7 from 2.6 should not be much of problem based on my personal experience. But I am a bit concerned to have 2 versions of 2.7 and what kind of impact it will have on using GAE SDK on my OSX. (Upgrading created a bit of hassle with GAE SKD.)
Here is what EPD readme says:
A full installation will install the following:
* Python framework -- installed into:
/Library/Frameworks/Python.framework/Versions/7.3
Python applications -- installed into
/Applications/Enthought
System fixes -- makes the EPD Python your default one by adding lines to
your .bash_profile to your path.
I think I will sleep on this.

Categories