0

pip install mandrill

gives me following error

File "/home/rock/bin/pip", line 8, in ?
    sys.exit(
  File "/usr/local/lib/python2.4/site-packages/pkg_resources.py", line 357, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.4/site-packages/pkg_resources.py", line 2394, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.4/site-packages/pkg_resources.py", line 2108, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/home/rock/lib/python2.4/pip-6.0.3-py2.4.egg/pip/__init__.py", line 211
    except PipError as exc:
                     ^
SyntaxError: invalid syntax

how do i fix this ?

( i am using webfaction . i needed to install mandrill . i installed pip using easy_install pip )

ferrangb
  • 2,012
  • 2
  • 20
  • 34
silverkid
  • 9,291
  • 22
  • 66
  • 92
  • Only very few packages still support python2.4. You may want to install `python2.7`. I would suggest having a look at `pyenv`https://github.com/yyuu/pyenv. – cel Dec 31 '14 at 09:05

2 Answers2

3

found my way out (solution)

webfaction has a folder called webapps which contains the project within project there is a lib folder containing the python according the one you choose for installing django. there is another lib folder in home/username directory which contains older version of pythons also. if you run easy_install pip from there it will have problems. go inside the python2.7 folder within webapps/yourproject/lib/ and then run easy_install-2.7 pip . this solved the problem . then i could install mandrill using pip install mandrill

silverkid
  • 9,291
  • 22
  • 66
  • 92
  • 1
    Small note: You don't have to `cd` into any special folder. Just `easy_install-2.7 pip` will do the trick. – mbrochh Dec 31 '14 at 12:04
1

You have a Python version that is 10 years old and isn't supported anymore (2.4). The Mandrill package simply requires a more recent version of Python.

You probably should change hosts.

Thomas Orozco
  • 53,284
  • 11
  • 113
  • 116
  • or maybe just install python2.7 locally :) – cel Dec 31 '14 at 09:00
  • actually this is the configuration i have Django 1.5 (mod_wsgi 3.4/Python 2.7) , but i see that older versions of python also exists in lib folder so i think the error is related to the older version someway – silverkid Dec 31 '14 at 09:02
  • @silverkid It looks like you might have symlinked the Python 2.4 `pip` at `/home/rock/bin/pip` (and `home/rock/bin/` is first on your `PATH` I assume). Can you post the `/home/rock/bin/pip` file in your question? – Thomas Orozco Dec 31 '14 at 09:03
  • @cel Multiple versions of Python on the same box isn't always that easy to deal with so I wouldn't recommend it if you can avoid it. As it happens, it seems that having multiple Python versions is in fact the problem here. – Thomas Orozco Dec 31 '14 at 09:04
  • how do i attach pip ? btw here is the listing of bin directory cd bin/ [rock@web374 bin]$ ls mandrill pip pip2 pip2.4 sendmail.mandrill – silverkid Dec 31 '14 at 09:08
  • @silverkid Just run `cat /home/rock/bin/pip` and paste the output here. It shouldn't be more than a dozen lines long. – Thomas Orozco Dec 31 '14 at 09:08
  • #!/usr/local/bin/python2.4 # EASY-INSTALL-ENTRY-SCRIPT: 'pip==6.0.3','console_scripts','pip' __requires__ = 'pip==6.0.3' import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.exit( load_entry_point('pip==6.0.3', 'console_scripts', 'pip')() ) – silverkid Dec 31 '14 at 09:09
  • @silverkid As you can see from the first line (the "shebang line"), this uses Python 2.4. Did *you* create this file? – Thomas Orozco Dec 31 '14 at 09:12
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/67970/discussion-between-silverkid-and-thomas-orozco). – silverkid Dec 31 '14 at 09:12