Command that works in local computer, but doesn't work in server?

江枫思渺然 提交于 2019-12-23 19:28:00

问题


I am using ubuntu 10.04 for my desktop and Ubunt 10.04 server edition ofr my server.

the following commnad:

sudo pip install -e git+http://github.com/facebook/python-sdk.git#egg=facebook

Works on my deskotp, but doesnt work on the server.

On the server, I received the following error message:

Obtaining facebook from git+http://github.com/facebook/python-sdk.git#egg=facebook
  Cloning http://github.com/facebook/python-sdk.git to ./src/facebook
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/pip/basecommand.py", line 115, in main
    self.run(options, args)
  File "/usr/local/lib/python2.6/dist-packages/pip/commands/install.py", line 155, in run
    requirement_set.install_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/local/lib/python2.6/dist-packages/pip/req.py", line 805, in install_files
    req_to_install.update_editable(not self.is_download)
  File "/usr/local/lib/python2.6/dist-packages/pip/req.py", line 356, in update_editable
    vcs_backend.obtain(self.source_dir)
  File "/usr/local/lib/python2.6/dist-packages/pip/vcs/git.py", line 104, in obtain
    [self.cmd, 'clone', '-q', url, dest])
  File "/usr/local/lib/python2.6/dist-packages/pip/vcs/__init__.py", line 100, in cmd
    raise BadCommand('Cannot find command %s' % self.name)
BadCommand: Cannot find command git

Storing complete log in ./pip-log.txt

May I know what am I missing? I have already installed pip, easy_install. What lese have I missed?

How to I get the command working?

Thank you!


回答1:


It looks like you are missing git, the tool that is used to clone the repository:

BadCommand: Cannot find command git

Try installing git on your server:

sudo apt-get install git-core



回答2:


I had the same issue. Even though the git package was installed the first answer was correct. sudo apt-get install git-core solved the problem.




回答3:


On Fedora, git and git-core packages were installed in /usr/local/bin, but my su wasn't looking there--security feature of our Linux distros, perhaps? A symlink from /bin, /usr/bin, to /usr/local/bin/git should do the trick. This worked for me:

sudo ln -s `which git` /bin/git


来源:https://stackoverflow.com/questions/3610639/command-that-works-in-local-computer-but-doesnt-work-in-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!