1. lxml 依赖库问题:
1,安装的libxml2
tar -xzvf libxml2-2.9.0.tar.gz
./configure --prefix=/home/was/software/lxml_libxml2 --without-python
make
make install
2,安装的libxslt
./configure --prefix=/home/was/software/lxml_libxml2 --without-crypto --without-python --with-libxml-prefix=/home/was/software/lxml_libxml2/
make
make install
3,安装LXML
tar -xzvf lxml-4.2.3.tar.gz
cd lxml-4.2.3
# 解压缩、编译
/home/was/software/python27/bin/python ./setup.py build --with-xslt-config=/home/was/software/lxml_libxml2/bin/xslt-config
# 虚拟环境下的 安装:
python ./setup.py install
# 指定在 本地python
```python
/home/was/software/python27/bin/
python ./setup.py build --with-xslt-config=/home/was/env/bin/xslt-config
lxml
./configure --prefix=/home/was/env --without-python
./configure --prefix=/home/was/env --without-crypto --without-python --with-libxml-prefix=/home/was/env/
2. mkvirtualenv异常时
mkvirtualenv misc --no-setuptools --no-pip
3. 在生成镜像时,安装指定python包时报错
> RUN pip install -i https://doubanio.com/simple/ -r requirement.txt
ERROR: Could not install packages due to an EnvironmentError: [Errno 39] Directory not empty: '/usr/local/python3/lib/python3.6/site-packages/certifi-2018.11.29.dist-info/'
解决方案
发现还是权限问题,故需加入参数--user解决
RUN pip install --user -i https://doubanio.com/simple/ -r requirement.txt