0

I want to install pymongo for the pypy3 2.1 Beta 1. I'm using ubuntu. The installation instruction says I should go through the following steps:

(1) $ curl -O http://python-distribute.org/distribute_setup.py

(2) $ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py

(3) $ ./pypy-2.1/bin/pypy distribute_setup.py

(4) $ ./pypy-2.1/bin/pypy get-pip.py

(5) $ ./pypy-2.1/bin/pip install pygments # for example

The first three steps are all OK (at least I didn't find any error messages). But when I execute step (4), there is an error:

An error occurred while trying to run get-pip.py. Make sure you have setuptools or distribute installed

What's the matter? How can I proceed to install pymongo in pypy3 2.1 Beta 1? In addition, since I'm using python3, I installed the pymongo library designed particularly for python3 using python3-pip (pip-3.3). Do I need to modify the above installation steps accordingly to accommodate pymongo for python3? Thank you.

user2339071
  • 4,254
  • 1
  • 27
  • 46
user2384994
  • 1,759
  • 4
  • 24
  • 29
  • 1
    Try installing setuptools. Distribute is now defunct. – Lennart Regebro Aug 27 '13 at 05:07
  • @Lennart Regebro : Thank you for the comment. I installed the setuptools and passed the step (4). However, it's now step (5)'s turn to give me an error. Could you please take a look at the question: http://stackoverflow.com/questions/18477583/pip-isnt-working-when-importing-something Thank you again. – user2384994 Aug 28 '13 at 01:16

1 Answers1

0

Just install the latest setuptools by downloading ez_setup.py and running it from the target Python interpretator (cpython, pypy or etc.). Installation error may occur in case you have not defined PYTHONPATH then you should set PYTHONPATH to the site-packages directory of your target Python interpretator, for example:

PYTHONPATH="/opt/pypy3/site-packages"  /opt/pypy3/bin/pypy ./ez_setup.py

Or export PYTHONPATH as environment var. Then you should be able to successfully install get-pip.py:

PYTHONPATH="/opt/pypy3/site-packages"  /opt/pypy3/bin/pypy ./get-pip.py
luart
  • 1,383
  • 1
  • 18
  • 25