Question

How to install pymongo module in redhat server which doesnt have internet connection. I downloaded the source file and tried python setup.py install, it throws an error

Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.30.tar.gz Traceback (most recent call last):   File "setup.py", line 25, in <module>
    use_setuptools()   File "/home/MLI/pymongo-2.6.2/distribute_setup.py", line 152, in use_setuptools
    return _do_download(version, download_base, to_dir, download_delay)   File "/home/MLI/pymongo-2.6.2/distribute_setup.py", line 131, in _do_download
    to_dir, download_delay)   File "/home/MLI/pymongo-2.6.2/distribute_setup.py", line 201, in download_setuptools
    src = urlopen(url)   File "/usr/local/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)   File "/usr/local/lib/python2.7/urllib2.py", line 400, in open
    response = self._open(req, data)   File "/usr/local/lib/python2.7/urllib2.py", line 418, in _open
    '_open', req)   File "/usr/local/lib/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)   File "/usr/local/lib/python2.7/urllib2.py", line 1207, in http_open
    return self.do_open(httplib.HTTPConnection, req)   File "/usr/local/lib/python2.7/urllib2.py", line 1177, in do_open
    raise URLError(err) urllib2.URLError: <urlopen error [Errno 111] Connection refused>

Please help me to install it without accessing internet

No correct solution

OTHER TIPS

first download the package using pip

pip install --download /path/to/some/dir pymongo

after downloading the source files, install the package using this command

pip install --no-index --find-links /path/to/some/dir/ pymongo

hope this helps your query

You can clone source repository of Pymongo from Github and copy that one other machine without internet.

On machine with internet:

$ git clone git://github.com/mongodb/mongo-python-driver.git pymongo
$ scp -r pymongo <username>@<servername>:<location>

On machine without internet:

$ cd pymongo
$ python setup.py install

I am assuming that you have all dependencies already installed on machine without internet.

If you are installing from tar , before calling install, build setup.py first

python setup.py build

and then go for install.

 python setup.py install
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top