Issue
I have found a custom http requests python module that greatly simplifies my task.
To be specific this one : http://docs.python-requests.org/en/latest/
So i downloaded the package from a site. Extracted the archive and attempted to install the module.
When i use the following command from the directory where the module is:
python setup.py install
it works flawlessly and the module is installed.
But i am wondering how can i do it from other directory ? When i try this:
python /home/some_user/setup.py install
i am getting the following error:
Traceback (most recent call last):
File "/home/some_user/setup.py", line 32, in <module>
with open('requests/__init__.py', 'r') as fd:
File "/usr/lib64/python2.6/codecs.py", line 881, in open
file = __builtin__.open(filename, mode, buffering)
IOError: [Errno 2] No such file or directory: 'requests/__init__.py'
I am asking because i will be needing to install it remotely to other machines.
Thanks in advance for any help.
Solution
if you not need to manage this package using pip
(as you not installed package from pip repository), you could just copy content of kennethreitz-requests-a693753/requests
folder to /usr/lib/pythonX.X/site-packages/requests/
, where x.x is your python version, like 3.4
By that way, package wouldn't be managed by any setup tool - you need to manage package manually, but you can freely import requests
module and use it.
P.S. As variant - create rpm/deb package and distribute across systems well fast
Answered By - Reishin
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.