Installing eyed3 in windows - python

trying to install eyed3 under python 2.7.5
I have done a google search and have been following what I found to install eyed3. The instructions were as follows
extract the zip file to a temp folder (filename eyeD3-0.7.3.zip) I
did using a temp folder on my desktop.
In the eyeD3 folder (under src) rename the init.py.in to
setup.py. I did not find _init++.py.in in the eyed3 folder, but
init_.py was,so I assumed this latest version used that file.
In the main folder (I assume eyeD3-0.7.3) run python setup.py.in
install. setup.py.in didnot exist, but I ran it anyway and got the
expected file not found message, however, setup.py did exist so I
executed python setup.py install and got the following Traceback
Traceback (most recent call last): File "C:\Users\Me\Desktop\New
folder\eyeD3-0.7.3\setup.py", line 10, in <module>
paver.tasks.main() File "paver-minilib.zip\paver\tasks.py", line
883, in main File "paver-minilib.zip\paver\tasks.py", line 851,
in _launch_pavement File "pavement.py", line 28, in <module>
import setuptools ImportError: No module named setuptools
a cmd line search of the python 2.7.5 dir and sub-directories did not find setuptools.py, however I did find the following two files
setuptools_build_ext.py and setuptools_extension.py.
Do I need to rename one of these files or do you know what I am doing wrong or what the fix would be?
Thank you

Depending on where you got your Python from, it may not have come with setuptools. In particular, it does not come in the standard Windows installers from Python.org.
Some packages' setup.py scripts have special code that tries to download and install setuptools (or distribute) if it's missing, or that bundles in just enough of setuptools into the package itself. But not all of them do.
The answer is to install setuptools yourself.
While you're at it, you probably want to also install pip, and then you can just pip install . from within the directory, or pip install eyeD3-0.7.3.zip without unzipping, or even just pip install eyeD3 without even downloading. (Among other things, it will also download and install any dependencies that eyeD3 might need.)
In fact, the eyeD3 installation docs explicitly say "Stable releases of eyeD3 are best installed via pip…".

Related

Python 3 installing tweepy

I have looked at all the forums, but nothing has worked so far. I have spent hours trying to install it so any help would be appreciated.
i have downloaded and unzipped tweepy, went on to the command prompt, typed "cd tweepy-master". This works, but when i type "python setup.py install" or "python setup.py build".
When i type "python setup.py install" the error says.
Traceback (most recent call last):
File "setup.py", line 4, in <module>
from setuptools import setup, find_packages
File "C:\Users\Sam Terrett\Documents\Portable Python 3.2.5.1\App\lib\site-packages\setuptools\__init__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "C:\Users\Sam Terrett\Documents\Portable Python 3.2.5.1\App\lib\site-packages\setuptools\extension.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "C:\Users\Sam Terrett\Documents\Portable Python 3.2.5.1\App\lib\site-packages\setuptools\dist.py", line 103
except ValueError, e:
^
SyntaxError: invalid syntax
When i type "python setup.py build"
Traceback (most recent call last):
File "setup.py", line 4, in <module>
from setuptools import setup, find_packages
File "C:\Users\Sam Terrett\Documents\Portable Python 3.2.5.1\App\lib\site-packages\setuptools\__init__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "C:\Users\Sam Terrett\Documents\Portable Python 3.2.5.1\App\lib\site-packages\setuptools\extension.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "C:\Users\Sam Terrett\Documents\Portable Python 3.2.5.1\App\lib\site-packages\setuptools\dist.py", line 103
except ValueError, e:
^
SyntaxError: invalid syntax
I saw alot of people saying to use pip, but i am struggling to install that to.
Thanks for the help
pip is the good way to install a package. If you are not interested then you can install from source.
But you have to remember that, If you are using virtualenv or virtualenvwrapper then you can use python setup.py install otherwise you should use sudo python setup.py install.
If you are windows user then, open your cmd with administator privilege and type python setup.py install.
Have you installed Python using the Windows installer from python.org?
Cause this comes with pip already bundled into it. (I can not check the exact location atm, as I am on a Mac, but according to this SO post it should be located under C:\PythonX.X\Scripts, if you kept the default install location - otherwise it should be located in <path-to-python>\Scripts of course).
Otherwise pip can easily installed using this script. Simply call python get-pip.py in the script location and pip should be available afterwards (if not directly from commandline with pip, than at least by using python -m pip.)
Having pip finally available, you should be able to easily install tweepy calling pip install tweepy (or python -m pip install tweepy respectively).
For further information on pip and the other options to install it, check https://pip.pypa.io/en/stable/installing/.
PS. If installing the package via pip does not work, this may be a compatibility issue. According to the tweepy github-page python 3.2 is not amongst the supported python versions. So if your portable python really has an interpreter versioned 3.2.... (you can check the version of your interpreter running python from cmd, which should print something like > Python 3.X.X), the package may not run properly at all (even if you can install it without a problem).
As the portable python apparently is no longer supported anyways, it may be worth trying a different solution. There are plenty suggested on the portable python website (I just know about Anaconda, but this works flawlessly). But if you only want to use python with tweepy and don't need anything like scipy or numpy, I'd suggest simply downloading the installer from the official website. As said, pip gets shipped with the standard installation and can be used to easily install most of the packages you will need. (Except for e.g. the abovementioned scipy/numpy, which require additional non-python libraries whose "manual" installation may not be worth the trouble and hence legitimates the use of a more comprehensive environment like Anaconda).

Cannot install openpyxl (ImportError: setuptools)

I am new to Python so sorry if the question is trivial. I need to work with python and Excel tables, therefore I was looking to install Openpyxl. I downloaded the .tar.gz pack and unizipped with Peazip, went to the terminal, set the directory to where the setup.py file is and run "py setup.py install". What I get is the following error:
C:\Python27\openpyxl>py setup.py install
Traceback (most recent call last):
File "setup.py", line 30, in <module>
from setuptools import setup, Extension, find_packages
ImportError: No module named setuptools
I did not modify anything with the files I downloaded, this is the folder I am running the code in:
http://i.stack.imgur.com/cxPwM.png
What could the problem be?
It seems that setuptools is not installed on your system, try installing it: https://pypi.python.org/pypi/setuptools
You can try this first: pip install setuptools, and then try to install what you want.

Python: Sharing python site-packages libraries between two python installations

I have Python 2.7 installed on my C: drive. I then install Python 2.7 on a separate machine and copy the folder onto my J: drive. How can I share or point the J: installation of python to use my C: drive site-package packages?
i.e. How can I share my site-packages path between two installations of Python on the same machine?
When I try to install wxPython with pip and virtualenv I get the following:
pip install wxPython
Downloading from URLhttp://downloads.sourceforge.net/wxpython/wxPython-src-3.0.2.0.tar.bz2 (from http://wxPython.org/download.php)
Running setup.py egg_info for package wxPython
Traceback (most recent call last):
File "<string>", line 16, in <module>
IOError: [Errno 2] No such file or directory: '.virtualenvs\\engineer\\build\\wxPython\\setup.py'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
IOError: [Errno 2] No such file or directory: .virtualenvs\\engineer\\build\\wxPython\\setup.py
I find it difficult to build and compile on windows however the wxPython installer seems to work with virtualenv.
The comments below are useful however the question which I am asking is now that I have almost all of the packages in the virtualenv how can I make a reference to the packages which I do not have access to and are proprietary but can be installed by the user at a later date in their own python installation?
So far I have stumbled across the PkgResource api which maybe what I need.
The way to resolve this external dependency where the user does not have the power of including it in the virtualenv package is to use the package called pkg_resources:
Python code
# One approach is to find pythonhome by an environment variable
# Another is to use the windows registry but beware of different
# issue regarding 64 and 32 bit windows as shown in the link below:
Python _winreg woes
import pkg_resources
import os
pythonhome = os.environ["PYTHONHOME"]
pkgs = pkg_resources.find_distributions(pythonhome + "/Lib/site-packages")
for pkg in pkgs:
pkg_resources.working_set.add(pkg)
# import the modules
# Note: that this does not import the dependencies of the packages imported
# You could get the dependencies by following the guide here:
pkg_resource documentation
keeping in mind the following:
(Naive way of doing this:)
import pkg_resources
distributions, errors = pkg_resources.working_set.find_plugins(pkg_resources.Environment(("C:/Python27/Lib/site-packages",)))
for dsts in distributions:
for requirements in dsts.requires():
# load the requirements aswell
for requiredDsts in list(distributions):
if requirements.project_name == requiredDsts.project_name and requirements.version >= requiredDsts.specs[0][1]:
# the >= may not be whats required as it is specified in specs[0][0]
pkg_resources.working_set.add(requiredDsts)
To get setup with the virtualenv follow the instructions as given by the link provided by (bruno desthuilliers) https://pypi.python.org/pypi/virtualenv/12.0.5 followed by a nice tutorial for windows users windows tutorial on virtualenv (link provided by bruno desthuilliers):
Activate the current virtual environment
Download and install wxPython from the website (it will pickup the virtualenv)
Install any other dependencies via pip or easy_install
Perform the operation above with pkg_resources to include any packages which cannot be installed via pip or easy_install and that the user would have to install them manually.
Note: you can only import packages which are suitable for the python interpreter itself such as 32 bit or 64 bit

Why is Python easy_install not working on my Mac?

I have a Mac running Python 2.6. When I try to use easy_install I get this message:
/usr/bin/easy_install-2.6:7: UserWarning: Module pkg_resources was already imported from /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.pyc, but /Library/Python/2.6/site-packages is being added to sys.path
from pkg_resources import load_entry_point
/usr/bin/easy_install-2.6:7: UserWarning: Module site was already imported from /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site.pyc, but /Library/Python/2.6/site-packages is being added to sys.path
from pkg_resources import load_entry_point
Traceback (most recent call last):
File "/usr/bin/easy_install-2.6", line 10, in <module>
load_entry_point('setuptools==0.6c9', 'console_scripts', 'easy_install')()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 271, in load_entry_point
return False
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 2173, in load_entry_point
deps = []
ImportError: Entry point ('console_scripts', 'easy_install') not found
I am very confused by this and I want to know how I can fix this. Previously I didn't get this message, then after installing pip and uninstalling it, easy_install no longer works. I was wondering how I could fix this, or restore the default Python or easy_install setting on Mac.
Check your /usr/bin and /usr/local/bin for easy_install installations and remove any old script:
sudo rm -f /usr/bin/easy_install*
sudo rm -f /usr/local/bin/easy_install*
Download and run distribute:
curl -O https://svn.apache.org/repos/asf/oodt/tools/oodtsite.publisher/trunk/distribute_setup.py
sudo python distribute_setup.py
sudo rm distribute_setup.py
Try again, and enjoy. E.g.:
sudo easy_install pip
I suspect the easiest way you can get easy_install working again is to install distribute, which is an improved version of distutils that bundles it's own version of easy_install. Installation is simple:
curl -O http://python-distribute.org/distribute_setup.py
/usr/bin/python2.6 distribute_setup.py
I had the same problem just after installing the new Operating System (Lion OSX).
After install python and execute it
sudo easy_install ipython
ipython
I got the following error:
Traceback (most recent call last):
File "/usr/local/bin/ipython", line 8, in <module>
load_entry_point('ipython==0.10.2', 'console_scripts', 'ipython')()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 318, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2220, in load_entry_point
raise ImportError("Entry point %r not found" % ((group,name),))
ImportError: Entry point ('console_scripts', 'ipython') not found
Then I realize it was a permission problem. If I execute the ipython script as sudo it worked.
sudo ipython
So I changed the ownership from root to my user () of the folder /Library/Python/2.7/site-packages/
sudo chown -R <your_user>:wheel /Library/Python/2.7/site-packages/
Use change ownership only if you don't have several accounts that uses python.
I hope it work for you.
Best
Your setuptools installation is broken. The easy_install-2.6 script in your /usr/bin directory, is only a wrapper that loads the actual easy_install module in your Python installation, and the latter is missing. Presumably uninstalling pip either broke the pointer to it (usually in the form of a .pth file in your site-packages directory) or removed the whole package but didn't remove the /usr/bin/easy_install-2.6 wrapper script.
Your best bet is to re-install setuptools from scratch again, by following the instructions on the setuptools PyPI page.
I had the same problem, I suspect caused by my installation of Homebrew which apparently installs its own version of easy_install blindly and screws up whatever you're currently running (enough times for homebrew to recognize it as a problem). I found my solution here Upgraded Python on Snowleopard Using Homebrew now pip and easy_install don't work
While I'm actually on Lion, it still fixed my problem. You just download ez_setup.py from http://pypi.python.org/pypi/ez_setup - run ez_setup.py through terminal and you're off to the races.
I had a similar error message after following similar steps. I suspect it's because I tried to install the distribute module, and it tried to install a new version of setuptools which
didn't quite work because it failed to correctly override the Mac OS X supplied setuptools. But that's only a suspicion.
I fixed my problem by doing the following. I found that the directory /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python
had 4 files with .OLD in the name. When I did a compare with similarly named files without the .OLD from when things worked (via Time Machine) I found that they were the same except for the name. So I did the following renames:
setuptools.OLD.1305936263.57 ->
setuptools
setuptools-0.6c9-py2.6.egg-info.OLD.1305936263.57 -> setuptools-0.6c9-py2.6.egg-info pkg_resources.py.OLD.1305936263.57
-> pkg_resources site.py.OLD.1305936263.59 -> site.py
I had to use the command line and sudo mv because the files are owned by root. For example: sudo mv setuptools.OLD.1305936263.57 setuptools. You'll have to enter your password.
The other thing I did was clean the /Library/Python/2.6/site-packages directory. I used Time Machine to set it back to its pre-messed up state. If you don't have Time Machine, then you should be able to recover if you delete any files or folders beginning with distribute, easy-install, pip, pkg_resources, setuptools and site.
If that doesn't do the trick, uninstall any modules you can from that directory. For example use pip uninstall if you installed modules with pip. The reason to do this is that installation can copy files into usr/local/bin and other places that pip will remove for you.
Next it's time to remove any remaining modules. Rename the folder (in case there's something you want later) and make a new empty one.
Reinstall the modules you want and with a little luck you're back in business...
Martijn Pieter's answer is correct.
Go to http://pypi.python.org/pypi/setuptools#downloads
Download setuptools-0.6c11-py2.7.egg
From your downloads directory run: sudo ./setuptools-0.6c11-py2.7.egg
Done :-)

setuptools easyinstall mysql-python-1.2.3

I have read a bunch of threads on setuptools here.
A lot of people seem not to like it very much.
But I need to install MySQL-python-1.2.3. and when I do that I get this error:
MySQL-python-1.2.3 X$ python setup.py cleanTraceback (most recent call last):
File "setup.py", line 5, in <module>
from setuptools import setup, Extension
ImportError: No module named setuptools
So it seems I need setuptools and that it is assumed that it is installed.
On the setuptools python homepage it says:
Setuptools will install itself using the matching version of Python (e.g. python2.4), and will place the easy_install executable in the default location for installing Python scripts (as determined by the standard distutils configuration files, or by the Python installation).
Does this mean it will replace any default easy install from python?
If so I dont want to use it.
If so can I install MySQL-python-1.2.3 without setupttools?
Thanks
You should use virtualenv and pip.
Virtualenv automatically creates a setuptools version within the new environment, so the default one is intact.
You may want to read how the packaging and installing works: 1, 2

Categories

Resources