ImportError: No module named virtualenv

前端 未结 8 2040
孤城傲影
孤城傲影 2021-02-01 00:50

I am using Django 1.3.7 and python 2.7.6 on windows7 I got an error when I executing my manage.py in this line of code

import shutil, sys, virtualenv, subprocess         


        
相关标签:
8条回答
  • 2021-02-01 01:26
    >virtualenv
    ImportError: No module named 'virtualenv'
    >pip uninstall virtualenv
    PermissionError: [Errno 13] Permission denied:
    
    >sudo pip uninstall virtualenv
    Successfully uninstalled virtualenv-15.1.0
    >pip install virtualenv
    Collecting virtualenv
    
    >virtualenv
    Options:
    

    Bingo!

    0 讨论(0)
  • 2021-02-01 01:36

    Install virtualenv using pip install virtualenv. If you have it already installed, try reinstalling it by removing it with pip uninstall virtualenv and then reinstalling it. Good Luck.

    0 讨论(0)
  • 2021-02-01 01:36

    I just ran into this same problem. I had to pip uninstall virtualenv as a user with admin rights, then pip install virtualenv as a normal user. I think it's some kind of permissions issue if you installed virtualenv under admin rights.

    0 讨论(0)
  • 2021-02-01 01:38

    Use pip3 instead of pip. I had the same issue and pip3 worked for me.

    $ pip3 install virtualenv
    $ virtualenv venv --python=python3
    
    0 讨论(0)
  • 2021-02-01 01:40

    I had the same problem when I created my virtualenv via pycharm and installed requirements with pycharm. After trail and error , I found that installed requirements are not taken into account by the virtualenv.

    The solution is to reinstall all requirements once you have activated your virtualenv:

    venv\scripts\activate

    python -m pip install -r YourRequirements.txt

    Next time I'd better create my virtualenv directly with command line

    0 讨论(0)
  • 2021-02-01 01:44

    Try

    python3 -m pip uninstall virtualenv
    
    
    python3 -m pip install virtualenv
    
    0 讨论(0)
提交回复
热议问题