11

I want to add music package to anaconda interpreter. I'm using ubuntu 14.04 64bit. I downloaded music21-1.9.3.tar.gz from anaconda cloud. I unpacked it to anaconda3/pkgs

ext                installer.py  music21           PKG-INFO   setup.cfg
installer.command  MANIFEST.in   music21.egg-info  README.md  setup.py

I found nothing on the web, or doesn't work. How can I install it?

Július Marko
  • 1,196
  • 5
  • 15
  • 37

1 Answers1

18

Are you using Windows? If so, open up a Command Prompt window.

What I like to do is Copy the Link Address of the package that I would like to install. In this case, a simple google search lead me to a popular python package site : https://pypi.python.org/pypi/music21/1.9.3

I right-click the tar.gz hyperlink and click "Copy Link Address" to get this : https://pypi.python.org/packages/source/m/music21/music21-1.9.3.tar.gz#md5=d271e4a8c60cfa634796fc81d1278eaf

Now to install this, in your command prompt window, type the following :

pip install https://pypi.python.org/packages/source/m/music21/music21-1.9.3.tar.gz#md5=d271e4a8c60cfa634796fc81d1278eaf

or

conda install https://pypi.python.org/packages/source/m/music21/music21-1.9.3.tar.gz#md5=d271e4a8c60cfa634796fc81d1278eaf

And it should automatically download the package from that link address, unzip it, and then attempt to install it in your python environment.

It's good to know how to install python packages manually as well for distributions that don't lend themselves as easily to cross-platform auto-installations.

What you would do is unzip the tar.gz file ( or any other compressed package file ) until you have a folder directory with a "setup.py" file name. You would go into your command prompt window and "cd" into that directory.

Then you would call the Python Executable by typing "python" which lets the command prompt know that you are calling python to run your command and finish the line so in total it looks like this :

python setup.py install 

There you have it.

RasikhJ
  • 601
  • 5
  • 10
  • Oh sorry, I forgot to tell which OS I'm currently using, I edited my answer. – Július Marko Mar 22 '16 at 21:30
  • In that case you can use the Terminal to try to install it manually instead of the windows command prompt. – RasikhJ Mar 22 '16 at 21:37
  • Glad I could help! – RasikhJ Mar 22 '16 at 22:27
  • If you happen to have `.so` or `.dylib` files (on a Mac), you can just copy them into the `site-packages` subdir of the appropriate anaconda environment (just search for directories named `site-packages` like this `find ~/anaconda/envs -name 'site-packages' -type d 2> /dev/null`. I had this situation with Autodesk FBX SDK for Python. They just distribute `.so` files and tell you to manually copy them into your global `site-packages`. But it works to copy them into local `site-packages` as well. – Reb.Cabin Jun 22 '17 at 22:13