gmvault
gmvault copied to clipboard
Installation failure
Hi there, I tried to install gmvault via pip, however the setup failed, I'm not familiar at all with python. Did I got something wrong ?
$ pip3 install gmvault
Collecting gmvault
Downloading gmvault-1.9.1.tar.gz (97 kB)
|████████████████████████████████| 97 kB 6.4 MB/s
Collecting argparse
Downloading argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Collecting Logbook==0.10.1
Downloading Logbook-0.10.1.tar.gz (155 kB)
|████████████████████████████████| 155 kB 18.2 MB/s
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/[email protected]/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3_/ff3xnwm57k33ctrbjtsxx2vr0000gn/T/pip-install-9j233xxr/logbook/setup.py'"'"'; __file__='"'"'/private/var/folders/3_/ff3xnwm57k33ctrbjtsxx2vr0000gn/T/pip-install-9j233xxr/logbook/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/3_/ff3xnwm57k33ctrbjtsxx2vr0000gn/T/pip-pip-egg-info-gokc7vup
cwd: /private/var/folders/3_/ff3xnwm57k33ctrbjtsxx2vr0000gn/T/pip-install-9j233xxr/logbook/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/3_/ff3xnwm57k33ctrbjtsxx2vr0000gn/T/pip-install-9j233xxr/logbook/setup.py", line 57, in <module>
from setuptools import setup, Extension, Feature
ImportError: cannot import name 'Feature' from 'setuptools' (/usr/local/lib/python3.8/site-packages/setuptools/__init__.py)
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
$ pip3 --version
pip 20.2.4 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
$ python3 --version
Python 3.8.6
You need to use Python 2.7 instead of Python 3.8.
@vladimir-poleh Thanks, indeed ! The stacktrace wasn't straightforward, I ended up installing gmvault in a custom docker image with python 2.7.
Here a snipplet for installing Python2.7.18 in $HOME/.bin/Python2
and gmvault in a virtualenv in $HOME/.bin/gmvault_env
(necessary on Debian 11 Bullseye):
## here we install Python2.7.18
sudo apt-get install -y libssl-dev <&-
pathprog="$HOME/.bin/Python2"
rm -fRr "$HOME/.bin/Python2"
mkdir -p "$pathprog/static/bin" "$pathprog/static/lib"
cd "$pathprog"
wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tar.xz
tar xvfJ Python-2.7.18.tar.xz
cd Python-2.7.18
CXX=/usr/bin/g++ ./configure --prefix="$pathprog/static" --datadir="$pathprog/static" --enable-optimizations --enable-ipv6
CXX=/usr/bin/g++ make
CXX=/usr/bin/g++ make install
cd "$pathprog"
wget -O "$pathprog/get-pip.py" https://bootstrap.pypa.io/pip/2.7/get-pip.py
$HOME/.bin/Python2/static/bin/python2 get-pip.py --python-version 2 --only-binary=:all: --target "$pathprog/static/lib/python2.7/site-packages" --force-reinstall
$HOME/.bin/Python2/static/bin/python2 -m pip install --upgrade pip==20.3.4
$HOME/.bin/Python2/static/bin/python2 -m pip install --upgrade virtualenv
## here we install gmvault
$HOME/.bin/Python2/static/bin/python2 -m virtualenv $HOME/.bin/gmvault_env --python=$HOME/.bin/Python2/static/bin/python2
source $HOME/.bin/gmvault_env/bin/activate
pip install --upgrade gmvault
deactivate
cd
echo -e "#\041/bin/bash
source $HOME/.bashrc
source $HOME/.bin/gmvault_env/bin/activate
cd $HOME/.bin/gmvault_env/bin/
$HOME/.bin/gmvault_env/bin/gmvault \"\$@\"
cd -
deactivate
exit 0" > $HOME/.bin/gmvault_env/gmvault
chmod a+x $HOME/.bin/gmvault_env/gmvault
if [[ "$(cat $HOME/.bashrc | grep "gmvault_env/gmvault")" == "" ]]; then
echo -e "alias gmvault=\"$HOME/.bin/gmvault_env/gmvault\"\n" >> $HOME/.bashrc
fi
declare -a bindirs=("$HOME/.bin/gmvault_env")
if [[ "$(cat $HOME/.bashrc | grep -P "^PATH=" )" == "" ]]; then
echo -e "PATH=\"\$PATH\"" >> $HOME/.bashrc
fi
for binfolder in "${bindirs[@]}"
do
if [[ "$(cat $HOME/.bashrc | grep -P "^PATH=" | grep "$binfolder")" == "" ]]; then
sed -i -e "s/^PATH=\"\(.*\)\"/PATH=\"\1:$(echo "$binfolder" | sed "s/\//\\\\\//g")\"/g" $HOME/.bashrc # place with no spaces in it
export PATH="$PATH:$binfolder"
fi
done
If you want to save emails in $HOME/.gmail-backup
, you can now use gmvault in bash terminal with a command like
gmvault sync -d $HOME/.gmail-backup --resume [email protected] | tee $HOME/.gmail-backup/gmail.com.log 2>&1
or in a bash script (where bash aliases may not be working) with a command like
$HOME/.bin/gmvault_env/gmvault sync -d $HOME/.gmail-backup --resume [email protected] | tee $HOME/.gmail-backup/gmail.com.log 2>&1
@vladimir-poleh Thanks, indeed ! The stacktrace wasn't straightforward, I ended up installing gmvault in a custom docker image with python 2.7.
May I ask you to share the dockerfile here please @bric3?
@pke Sorry, I switched jobs, and I forgot to backup a few things, like this dockerfile