zoukankan      html  css  js  c++  java
  • mac python3安装virtualenv出现的问题

    pip3 install virtualenv

    pip3 install virtualenvwrapper

    安装成功后可能 找不到该命令, 解决办法

    1.在 vim ~/.bashrc

    export WORKON_HOME=$HOME/.virtualenvs  # 这个貌似是存放虚拟环境的位置,可自己设置
    
    export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3  # 指定python解释器
    
    source /Library/Frameworks/Python.framework/Versions/3.6/bin/virtualenvwrapper.sh  # 启动virtualenvwrapper配置,
    该配置位置可通过 sudo find / -name 'virtualenvwrapper.sh'查找

    2.加载.bashrc配置

    source ~/.bashrc

    3.执行命令 mkvirtualenv 如果出现以下错误,是因为通过python3安装的virtualenv路径会变化吧?

    ERROR: virtualenvwrapper could not find virtualenv in your path

    解决办法:软链接 同样通过sudo find / -name 'virtualenv'可查找到路径

    sudo ln -s /Library/Frameworks/Python.framework/Versions/3.6/bin/virtualenv /usr/local/bin/virtualenv

    然后就没有然后了...
    吐槽一下,TMD还是的靠英文文档啊~~

    重启终端后居然得重新source .bashrc气得我马上查了下解决方法
    vim ~/.bash_profile 加入以下代码,可重启终端后自动加载.bashrc配置
    # if running bash
    if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
    fi
    # set PATH so it includes user's private bin if it exists
    if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
    fi


  • 相关阅读:
    js去java的变量
    android:layout_alignLeft=""和android:layout_toLeftOf=""
    c:foreach遍历list
    fragment的getActivity和activity的getapplication实现共享方法和变量
    java.lang.IllegalStateException: commit already called
    选择图片时调用手机拍摄和相册图片
    android:duplicateParentState属性
    java日期事件处理
    汉字字符串编码转换
    JAVA入门到精通-第5讲-类和对象
  • 原文地址:https://www.cnblogs.com/tangpg/p/9450248.html
Copyright © 2011-2022 走看看