Seafile部署--Ubuntu系统按官方教程一步步安装

准备工作:

1、更换阿里源,参见Seafile部署--官方一键安装脚本
2、apt update更新下,顺带测试阿里源

第一步

#按官方说明安装各种包
apt-get install python2.7 libpython2.7 python-setuptools python-imaging python-ldap python-urllib3 ffmpeg python-pip python-mysqldb python-memcache

第二步

#pip更换阿里源
pip install -i https://mirrors.aliyun.com/pypi/simple pip -U
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple

记录第一个坑

#第一次使用的不是https地址,结果报错
pip config set global.index-url http://mirrors.aliyun.com/pypi/simple
ERROR: unknown command "config"

#更换https地址,结果又报错
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in 
    from pip import main
ImportError: cannot import name main

解决方法

vi /usr/bin/pip
#然后修改from pip import main为from pip._internal import main

第三步

pip install pillow moviepy

发现报错,遇到第二个坑,如下

#报错一
Ignoring imageio: markers 'python_version >= "3.4"' don't match your environment  '
Ignoring imageio-ffmpeg: markers 'python_version >= "3.4"' don't match your environment  '

#报错二
Collecting numpy (from moviepy)
  Downloading https://mirrors.aliyun.com/pypi/packages/ac/36/325b27ef698684c38b1fe2e546e2e7ef9cecd7037bcdb35c87efec4356af/numpy-1.17.2.zip (6.5MB)
     |████████████████████████████████| 6.5MB 2.2MB/s 
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-BKYrs4/numpy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-BKYrs4/numpy/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 pip-egg-info
         cwd: /tmp/pip-install-BKYrs4/numpy/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "", line 1, in 
      File "/tmp/pip-install-BKYrs4/numpy/setup.py", line 31, in 
        raise RuntimeError("Python version >= 3.5 required.")
    RuntimeError: Python version >= 3.5 required.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

先解决第二个,发现python最高只支持numpy1.16,因此安装如下:

pip install numpy==1.16

pip install MoviePy重新安装MoviePy,pip list发现imageio和moviepy都在了,剩下imageio-ffmpeg

Package          Version  
---------------- ---------
......
imageio          2.4.1    
moviepy          1.0.1    
......

MoviePy官方提示需要安装依赖包ez_setup

pip  install  ez_setup`
pip install MoviePy

发现imageio-ffmpeg安装成功,但是出现另个报报错

ERROR: moviepy 1.0.1 has requirement imageio<3.0,>=2.5, but you’ll have imageio 2.4.1 which is incompatible.
然后升级imageio到2.5.0,然后又报错
ERROR: moviepy 1.0.1 has requirement imageio<2.5,>=2.0, but you’ll have imageio 2.5.0 which is incompatible.
偶滴乖乖,这是什么鬼

最后

无视报错,先检查数据库是否正常安装,然后直接运行安装包中setup-seafile-mysql.sh,安装正常,系统登录正常。

总结

系统和应用总是在不断变化,需要注意各个应用之间版本的依赖关系。

你可能感兴趣的:(Seafile部署--Ubuntu系统按官方教程一步步安装)