参考Ubuntu安装Onedrive教程在Centos安装onedrive过程中出现一个问题,Error: setup script does not support your distro token centos,现在记录如下:
$ git clone https://github.com/xybu92/onedrive-d.git
$ cd onedrive-d
然后
./install.sh
Error: setup script does not support your distro token centos.
google找到类似的错误,I cant install on elementary OS #71大致是没有将该版本写入到.sh文件,vi install.sh,定位到case $DISTRIB_ID,作为一个菜鸟,我是在fedora后面看到“sudo yum install”,在fedora后面加上了|centos,保存退出,执行./install.sh,安装成功。
case $DISTRIB_ID in
# Debian/Ubuntu family
elementaryos|debian|ubuntu|linuxmint|raspbian)
PACKAGE_INST=‘sudo apt-get install’
PIP_PKG_NAME=‘python3-pip’
PYGOBJECT_PKG_NAME=‘python3-gi’
INOTIFY_PKG_NAME=‘inotify-tools’
PYTHON_DEV_PKG_NAME=‘python3-dev’
;;
fedora|centos)
PACKAGE_INST=‘sudo yum install’
PIP_PKG_NAME=‘python3-pip’
PYGOBJECT_PKG_NAME=‘pygobject3’
INOTIFY_PKG_NAME=‘inotify-tools’
PYTHON_DEV_PKG_NAME=‘python3-devel’
;;
arch|archarm|manjarolinux)
PACKAGE_INST=‘sudo pacman -S --needed’
PIP_PKG_NAME=‘python-pip’
PYGOBJECT_PKG_NAME=‘python-gobject’
INOTIFY_PKG_NAME=‘inotify-tools’
PYTHON_DEV_PKG_NAME=’’
;;
opensuse)
PACKAGE_INST=‘sudo zypper install’
PIP_PKG_NAME=‘python3-pip’
PYGOBJECT_PKG_NAME=‘python3-gobject’
INOTIFY_PKG_NAME=‘inotify-tools’
PYTHON_DEV_PKG_NAME=‘python3-devel’
之后按照Ubuntu安装Onedrive教程
时,出错,在查找问题时,有人建议放弃onedrive-d old,使用onedrived-dev。
参考linux下使用onedrive同步记录错误:
pip3 install -e .
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Obtaining file:///root/onedrived-dev
Requirement already satisfied: setuptools>=30.0.0 in /usr/local/lib/python3.6/site-packages (from onedrived==2.0.0)
Collecting colorama>=0.3.7 (from onedrived==2.0.0)
Downloading http://us1.mirrors.cloud.aliyuncs.com/pypi/packages/c9/dc/45cdef1b4d119eb96316b3117e6d5708a08029992b2fee2c143c7a0a5cc5/colorama-0.4.3-py2.py3-none-any.whl
Requirement already satisfied: click>=6.6 in /root/.local/lib/python3.6/site-packages/click-7.1.2-py3.6.egg (from onedrived==2.0.0)
Collecting onedrivesdk (from onedrived==2.0.0)
Downloading http://us1.mirrors.cloud.aliyuncs.com/pypi/packages/b3/76/9a3fe5b36079f5c40b33c89ad6f7737e3b8609010a80c9ed24d762ddb93e/onedrivesdk-2.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-h9xoxpeb/onedrivesdk/setup.py", line 9, in <module>
with open(NOTICE, 'r', encoding='utf-8') as f:
NotADirectoryError: [Errno 20] Not a directory: '/tmp/pip-build-h9xoxpeb/onedrivesdk/setup.py/../NOTICE.rst'
----------------------------------------
解决方法参考:https://github.com/OneDrive/onedrive-sdk-python/issues/167
pip install https://github.com/OneDrive/onedrive-sdk-python/archive/master.zip
onedrived-pref account add
Failed to save account: No recommended backend was available. Install a recommended 3rd party backend package; or, install the keyrings.alt package if you want to use the non-recommended backends. See https://pypi.org/project/keyring for details..
解决:
pip3 install keyrings.alt
下载ngrok:
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
解压:
unzip ngrok-stable-linux-amd64.zip
启动:
NGROK=~/ngrok onedrived start
经测试,可以同步