'virtualenv' is not recognized as an internal or external command, operable program or batch file

前端 未结 11 1301
既然无缘
既然无缘 2020-11-30 04:04

i\'m completely new to the python and django.,after installation of python and django. i\'m trying to use virtualenv for django project purpose using virtula env . i install

相关标签:
11条回答
  • 2020-11-30 04:18

    py -3 -m venv venv

    try using the above command.

    virtualenv venv

    will work on only older version of python

    0 讨论(0)
  • 2020-11-30 04:20

    steps: - go to where you want create django app on that folder.

    then run this command on command prompt : python -m virtualenv .

    (eg. C:\Users\gshiv\Desktop\django>python -m virtualenv .)

    where django is the my folder i want run virtualenv and .(dot) indicates virtualenv install all it's folder in django folder otherwise you can use other folder name instead .(dot) this time virtulenv creates a folder in main folder(django) .

    • after running this command: run .\scripts\activate now you can see this type of line on cmd-prompt (django) C:\Users\gshiv\Desktop\django>
    • i.e main folder name before the source path. now you can install any modules for your project that belongs to that main folder only.

    pip install django works fine.

    0 讨论(0)
  • 2020-11-30 04:20

    For windows First, install -> pip install virtualenvwrapper-win Then setup -> mkvirtualenv myproject Then you see the list of virtual environment To see it you write-> lsvirtualenv For working this environment we write -> workon myproject

    0 讨论(0)
  • 2020-11-30 04:21

    Make sure that virtualenv has been installed correctly. Check in the python scripts subfolder - there must exist an .exe named virtualenv.exe. If not, uninstall will pip uninstall virtualenv and install again.

    0 讨论(0)
  • 2020-11-30 04:28

    There are three points that you need to consider:

    • Make sure that in the windows PATH variable there is an entry with your python installation and the scripts subfolder eg: C:\Program Files (x86)\Python36-32\ and C:\Program Files (x86)\Python36-32\Scripts\
    • When using pip install virtualenv, make sure that you run cmd as administrator. Otherwise, there might an access denied error during installation and virtualenv will not be installed properly.
    • Make sure that virtualenv has been installed correctly. Check in the python scripts subfolder - there must exist an .exe named virtualenv.exe. If not, uninstall will pip uninstall virtualenv and install again.
    0 讨论(0)
  • 2020-11-30 04:31

    If you can not find your 'virtualenv' command in the windows console after installing it with pip try this to make your environment:

    python -m virtualenv <nameOfEnv>
    

    If you need to use a specific version of python, initialize it like this:

    python -m virtualenv <nameOfEnv> -p=<C:/path/to/python/version3.x.x/python.exe>
    

    When using windows for first installation, you can use python from WindowsApp

    0 讨论(0)
提交回复
热议问题