Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Issues #17

Open
rsnyman opened this issue Jul 18, 2015 · 8 comments
Open

Installation Issues #17

rsnyman opened this issue Jul 18, 2015 · 8 comments

Comments

@rsnyman
Copy link

rsnyman commented Jul 18, 2015

$ wget --no-check-certificate -O- https://raw.github.com/gawel/oh-my-vim/master/tools/install.sh | sh -  
--2015-07-18 16:56:56--  https://raw.github.com/gawel/oh-my-vim/master/tools/install.sh
Resolving raw.github.com (raw.github.com)... 185.31.18.133
Connecting to raw.github.com (raw.github.com)|185.31.18.133|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://raw.githubusercontent.com/gawel/oh-my-vim/master/tools/install.sh [following]
--2015-07-18 16:56:58--  https://raw.githubusercontent.com/gawel/oh-my-vim/master/tools/install.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.31.18.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.31.18.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1848 (1.8K) [text/plain]
Saving to: ‘STDOUT’

-                              100%[======================================================>]   1.80K  --.-KB/s   in 0s     

2015-07-18 16:56:59 (68.8 MB/s) - written to stdout [1848/1848]

Using /usr/bin/python2.7
Installing virtualenv using /usr/bin/python2.7...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0
100 99413  100 99413    0     0  27973      0  0:00:03  0:00:03 --:--:--  241k
Cannot find a wheel for setuptools
Cannot find a wheel for pip
Traceback (most recent call last):
  File "virtualenv.py", line 2363, in <module>
    main()
  File "virtualenv.py", line 832, in main
    symlink=options.symlink)
  File "virtualenv.py", line 1004, in create_environment
    install_wheel(to_install, py_executable, search_dirs)
  File "virtualenv.py", line 969, in install_wheel
    'PIP_NO_INDEX': '1'
  File "virtualenv.py", line 910, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /home/user/.oh-my-vim/env/bin/python2.7 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel failed with error code 1
sh: 28: source: not found
sh: 28: .: Can't open /home/user/.oh-my-vim/env/bin/activate
@gawel
Copy link
Owner

gawel commented Jul 18, 2015

Look like you have a weird sh binary. What is the output of ls -l /bin/sh ?

@rsnyman
Copy link
Author

rsnyman commented Jul 18, 2015

$ ls -l /bin/sh        
lrwxrwxrwx 1 root root 4 Aug 14  2014 /bin/sh -> dash

dash? Weird, let me try with bash proper.

$ wget --no-check-certificate -O- https://raw.github.com/gawel/oh-my-vim/master/tools/install.sh | bash -
--2015-07-18 19:01:10--  https://raw.github.com/gawel/oh-my-vim/master/tools/install.sh
Resolving raw.github.com (raw.github.com)... 185.31.18.133
Connecting to raw.github.com (raw.github.com)|185.31.18.133|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://raw.githubusercontent.com/gawel/oh-my-vim/master/tools/install.sh [following]
--2015-07-18 19:01:12--  https://raw.githubusercontent.com/gawel/oh-my-vim/master/tools/install.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.31.19.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.31.19.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1848 (1.8K) [text/plain]
Saving to: ‘STDOUT’

-                              100%[======================================================>]   1.80K  --.-KB/s   in 0s     

2015-07-18 19:01:13 (41.0 MB/s) - written to stdout [1848/1848]

Using /usr/bin/python2.7
Installing virtualenv using /usr/bin/python2.7...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
100 99413  100 99413    0     0  31391      0  0:00:03  0:00:03 --:--:-- 50361
Cannot find a wheel for setuptools
Cannot find a wheel for pip
Traceback (most recent call last):
  File "virtualenv.py", line 2363, in <module>
    main()
  File "virtualenv.py", line 832, in main
    symlink=options.symlink)
  File "virtualenv.py", line 1004, in create_environment
    install_wheel(to_install, py_executable, search_dirs)
  File "virtualenv.py", line 969, in install_wheel
    'PIP_NO_INDEX': '1'
  File "virtualenv.py", line 910, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /home/user/.oh-my-vim/env/bin/python2.7 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel failed with error code 1
bash: line 28: /home/user/.oh-my-vim/env/bin/activate: No such file or directory
bash: line 28: /home/user/.oh-my-vim/env/bin/activate: No such file or directory
Installing dependencies...
bash: line 31: pip: command not found
Installing ranger...
bash: line 34: pip: command not found
Installing oh-my-vim...
bash: line 39: pip: command not found
bash: line 43: /home/user/.oh-my-vim/bin/oh-my-vim: No such file or directory
bash: line 44: /home/user/.oh-my-vim/bin/oh-my-vim: No such file or directory
Sucessfully installed oh-my-vim  to /home/user/.oh-my-vim
Binary can be found at /home/user/.oh-my-vim/bin/oh-my-vim

Still errors :-(

@rsnyman
Copy link
Author

rsnyman commented Jul 18, 2015

I am running zsh for my shell, but that shouldn't make a difference, should it?

@gawel
Copy link
Owner

gawel commented Jul 18, 2015

Yep that's strange. Got the same issue:

% /bin/dash
$ source
/bin/dash: 1: source: not found

I have to dig into this one.

For the second one try to rm -Rf ~/.oh-my-vim and run the script with bash again

(I'm using zsh too)

@rsnyman
Copy link
Author

rsnyman commented Jul 20, 2015

I did that before running with bash.

@gawel
Copy link
Owner

gawel commented Jul 20, 2015

Looks like virtualenv cant install pip. That's weird...

I need to try an install from scratch too.

@rsnyman
Copy link
Author

rsnyman commented Jul 20, 2015

So, I've been playing around, and this is what I've discovered.

If I let the script download virtualenv.py, then it can't create a virtualenv. If I use my system virtualenv (python-virtualenv on Ubuntu 15.04), then (with some editing) I can make the script work.

Also, in the script, I had to remove the "env" and just make ~/.oh-my-vim the virtualenv. Once I adjusted the initial paths in the script, it worked. I've pasted the script below:

#!/bin/sh
py=`which python2.7 || which python2.6`

if ! [ -x $py ]
then
    echo "Can't find a python interpreter"
    exit
fi

echo "Using $py"

ohmyvim="bin/oh-my-vim"
install_dir=$HOME/.oh-my-vim
bundles=$HOME/.vim/bundle
mkdir -p $install_dir
cd $install_dir

if ! [ -d "$install_dir/bin" ]
then
    echo "Installing virtualenv using $py..."
    venvurl='https://raw.github.com/pypa/virtualenv/master/virtualenv.py'
    curl -O -L $venvurl || wget --no-check-certificate -c $venvurl
    $py virtualenv.py -q --distribute .
fi

! [ -d $bundles ] && mkdir -p $bundles

echo $install_dir/bin/activate
source $install_dir/bin/activate || . $install_dir/bin/activate

echo "Installing dependencies..."
pip install -q ConfigObject argparse

echo "Installing ranger..."
pip install -q --src="$HOME/.vim/bundle/" \
    --install-option="--script-dir=$install_dir/bin" \
    -e "git+https://github.com/hut/ranger.git@master#egg=ranger"

echo "Installing oh-my-vim..."
pip install -q --src="$HOME/.vim/bundle/" \
    --install-option="--script-dir=$install_dir/bin" \
    -e "git+https://github.com/gawel/oh-my-vim.git@master#egg=oh-my-vim"

$install_dir/bin/oh-my-vim version > /dev/null
version=`$install_dir/bin/oh-my-vim version`

echo "Sucessfully installed oh-my-vim $version to $install_dir"
echo "Binary can be found at $install_dir/$ohmyvim"

add_path() {
    if [ "`grep $install_dir $1`" = "" ]
    then
        echo "Adding $install_dir/bin to \$PATH in $1"
        cat << EOF >> $1
# Added by oh-my-vim
export PATH=\$PATH:$install_dir/bin

EOF
    echo "Now source it!"
    echo ""
    echo "    source $1"
    fi
}

if [ -f ~/.zshrc ]
then
    add_path ~/.zshrc
elif [ -f ~/.bashrc ]
then
    add_path ~/.bashrc
else
    echo ""
    echo "!! Please add $install_dir/bin to your \$PATH"
    echo ""
    echo "    export PATH=\$PATH:$install_dir/bin"
fi
echo ""

@rsnyman
Copy link
Author

rsnyman commented Jul 21, 2015

This is probably not exactly what you want though. I'm guessing you probably want to create a bin directory in .oh-my-vim, and then a virtual environment in env, and then symlink env/bin/oh-my-vim to bin/oh-my-vim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants