zoukankan      html  css  js  c++  java
  • Python虚拟环境- 构建或安装包过程中出现的错误

    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

  • 相关阅读:
    LeetCode 204
    华为OJ2051-最小的K个数(Top K问题)
    华为OJ1964-求解立方根(牛顿迭代法)
    华为OJ2288-合唱队(最长递增子序列)
    华为OJ2011-最长公共子串
    【Unix编程】进程间通信(IPC)
    可利用空间表(Free List)
    13.10 Scrapy 通用爬虫
    13.9 Scrapy 对接 Splash
    第十四章 分布式爬虫
  • 原文地址:https://www.cnblogs.com/sunxiuwen/p/13538087.html
Copyright © 2011-2022 走看看