Linux:CentOS7

python

系统默认python版本2.7,利用python启动

自己安装python版本3.8,利用python3启动


问题描述:

在上述环境中利用virtualenvwrapper创建虚拟环境时,发生以下错误

/usr/bin/python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is set properly.

https://blog.csdn.net/Sun_White_Boy/article/details/81144924

原因是在virtualenvwrapper.sh中有以下代码

# Locate the global Python where virtualenvwrapper is installed.
if [ "${VIRTUALENVWRAPPER_PYTHON:-}" = "" ]
then
VIRTUALENVWRAPPER_PYTHON="$(command \which python)"
fi

所以,在virtualenvwrapper初始化时,命令“which python”调用的是python2.7,而我的virtualenvwrapper是由pip3下载,所以会有错误“No module named virtualenvwrapper

解决办法:

直接修改其command语句

VIRTUALENVWRAPPER_PYTHON="$(command \which python3)"

参考文章:https://blog.csdn.net/Sun_White_Boy/article/details/81144924

利用virtualenvwrapper创建虚拟环境出现错误“/usr/bin/python: No module named virtualenvwrapper”的更多相关文章

  1. 问题1-/usr/bin/python: No module named virtualenvwrapper

    操作系统:Ubuntu 问题:创建虚拟环境时,出现:/usr/bin/python: No module named virtualenvwrapper 解决方法: 1.切换到用户家目录 2.打开隐藏 ...

  2. Mac安装virtualwrapper时报错No module named virtualenvwrapper

    1. 前言 我在使用mac安装virtualwrapper的时候遇到了问题,搞了好长时间,才弄好,在这里总结一下分享出来,供遇到相同的问题的朋友使用,少走些弯路. 2. 问题说明 Mac默认系统的py ...

  3. /usr/bin/python^M: 解释器错误: 没有那个文件或目录

    遇见问题 因为linux在虚拟机中,所以就在本地敲python代码,敲完后再拿到虚拟机去执行,再输入./filename.py时,就遇到这样的一个问题: bash: ./filename.py: /u ...

  4. 解决:执行python脚本,提示错误:/usr/bin/python^M: 解释器错误: 没有那个文件或目录。

    执行python脚本,提示错误: /usr/bin/python^M: 解释器错误: 没有那个文件或目录. 产生错误原因: \r字符被显示为^M,这时候只需要删除这个字符就可以了. Linux环境下: ...

  5. 【转】链接任意目录下库文件(解决错误“/usr/bin/ld: cannot find -lxxx”

    netbeans构建项目也出现了同样的问题.猜测是netbeans内部就用的是-l 这种编译方式,所以需要把***.a手动改为lib***.a 原文地址:链接任意目录下库文件(解决错误“/usr/bi ...

  6. /usr/bin/python: can't decompress data; zlib not available 的异常处理

    1. 问题背景 使用Pycharm连接远程服务器端pipenv虚拟环境的python解释器,运行python spark脚本时报错如下错误: 2018-09-12 23:56:00 ERROR Exe ...

  7. 【转】关于Python脚本开头两行的:#!/usr/bin/python和# -*- coding: utf-8 -*-的作用 – 指定文件编码类型

    原文网址:http://www.crifan.com/python_head_meaning_for_usr_bin_python_coding_utf-8/ #!/usr/bin/python 是用 ...

  8. 【转载】关于Python脚本开头两行的:#!/usr/bin/python和# -*- coding: utf-8 -*-的作用 – 指定文件编码类型

    1.#!/usr/bin/python 是用来说明脚本语言是 python 的 是要用 /usr/bin下面的程序(工具)python,这个解释器,来解释 python 脚本,来运行 python 脚 ...

  9. Python脚本开头两行:#!/usr/bin/python和# -*- coding: utf-8 -*-的作用

    转于:https://www.crifan.com/python_head_meaning_for_usr_bin_python_coding_utf-8/ 出处:在路上 一.基本功能 1)#!/us ...

随机推荐

  1. javaScript 面向对象 触发夫级构造函数

    class Person{ constructor(name,age){ //直接写属性 this.name=name; this.age=age; console.log('a'); } showN ...

  2. 吴裕雄--天生自然python学习笔记:python安装配置tesseract-ocr-setup-3.05.00dev.exe

    下载地址:https://digi.bib.uni-mannheim.de/tesseract/tesseract-ocr-setup-3.05.00dev.exe 点击安装,记得复制安装的路径,待会 ...

  3. 吴裕雄--天生自然C语言开发:存储类

    { int mount; auto int month; } { register int miles; } #include <stdio.h> /* 函数声明 */ void func ...

  4. plsql中文显示问号

    1. select userenv('language') from dual 2. 复制查询的值配置系统环境变量 NLS_LANG=AMERICAN_AMERICA.ZHS16GBK 3.配置系统环 ...

  5. kubectl格式化输出和调试

    1.格式化输出 以特定的格式想终端输出详细信息,可以在 kubectl 命令中添加 -o  或者 -output 选项 输出格式 描述 -o=custom-columns=<spec> 使 ...

  6. VisionPro控件的使用 C# 开发篇

    VisionPro 常用控件的说明 工具设置窗体 CogPMAlignEditV2  [ 模版匹配设置窗体控件 ] CogPMAlignEditV2.Subject : 工具关联对象 如:CogPMA ...

  7. nonparametric method|One-Mean t-Interval Procedure|

    8.4 Confidence Intervals for One Population Mean When σ Is Unknown 原先是 standardized version of x bar ...

  8. va_list、va_start和va_end使用

    我们知道va_start,va_arg,va_end是在stdarg.h中被定义成宏的,由于1.硬件平台的不同 2.编译器的不同,所以定义的宏也有所不同. 在ANSI C中,这些宏的定义位于stdar ...

  9. Java使用JNDI技术获取DataSource对象

    package common; import java.sql.Connection; import java.sql.SQLException; import javax.naming.Contex ...

  10. linux上hosts文件如何配置

    linux上hosts文件如何配置 一.什么是host Hosts是一个没有扩展名的系统文件,其基本作用就是将一些常用的网址域名与其对应的IP地址建立一个关联“数据库”,当用户在浏览器中输入一个需要登 ...