bad interpreter when setting up virtualenv - django

So I have done the install for virtualenv but when I try to create my folder this is what I get:
desktop duwaynew$ virtualenv someone -bash: /usr/local/bin/virtualenv: /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory
What does this mean?

virtualenv creation in windows:
http://pymote.readthedocs.io/en/latest/install/windows_virtualenv.html
virtualenv creation in ubunutu(Linux platform)
Install pip using sudo apt-install pip and pip install virtualenv
create a env ( example global ) virtualenv global , and activate
source global/bin/activate

Related

pip3 is installing django globally not inside my environment

I used virtualenvwrapper to create a new env but when I tried to install pip3 to install newer versions of django it was install globally although my environment was activated , which leads to global installation of django ..
How can I use it only inside my virtual env
did you activated virtual env first ? If you see env name in front of name in terminal - it is activated. If it is activated try python3 -m pip install --upgrade pip
then python3 -m pip install django
it is obliged to install last stable version of django (3rd for now) I'm doing this often
Use below commands to install django inside virtual environment.
1) upgrade pip3:
python3 -m pip install --upgrade pip
2) Install virtual env
pip3 install virtualenv
3) You can then create a virtualenv using the full path like this:
virtualenv -p /home/example_username/opt/python-3.6.2/bin/python3 venv
4) Activate virtual env
source venv/bin/activate
5) install Django
pip3 install Django
1.create a virtualenvironment with virtualenv or venv.
2.Activate the virtual environment by entering in the virtual environment folder and type this command if you are on windows cd scripts then type activate.bat or if you are using git bash just do . scripts/activate then you will see ("name of your virtual environment") which proves that your virtual environment is active.
3.Then you can pip install django in your virtual environment
some images below to guide you
enter image description here
enter image description here
you are welcomed!!!

python virtualenv on windows: Fatal error in launcher: Unable to create process using '"'

I have created a virtualenv in python 2.7 (Anaconda) on a dev machine and (after package installation) copied it to another windows machine in a PROD setting (no communication to outside). Executing any of the installed ".exe" entry points for a program in the virtualenv produces this error on the target machine however runs fine on the source machine:
(env) D:\app\pyvenv>env\Scripts\pip.exe
Fatal error in launcher: Unable to create process using '"'
The location of python installation on both machines is set to the same folder: C:\ProgramData\Anaconda2
Also see my additional notes at the bottom of this post. thanks
in my case, I previously changed the name of the python.exe executable to python3.exe so when I run:
virtualenv project1_env
it can't locate the python.exe if that was your case too .. just rename it again to python.exe and it should work.
In my case I solve by upgrading pip using following code in activate environment.
python -m pip install --upgrade pip
In my case I uninstalled venv and then installed it again and it worked.
pip uninstall virtualenv to uninstall it and use pip install virtualenv to install it again.
I had the same problem. Try making virtualenv with this command:
virtualenv --python C:\Path\To\Python\python.exe venv
Note that you should specify the path to your python installation folder after --python option.
python -m pip install --upgrade pip
Run this while in the venv. seems like a system change occured and reinstalling it restores it to default.

django installation not working virtualenv

I have installed virtualenv
pip3 install virtualenv
create a virtualenv
virtualenv djangoenv
access the virtualenv
source ./djangoenv/bin/activate
Then I install
pip3 install django
when import django I get errorno module named django
django-admin.py --version displalys 1.9.4 So it is installed. what am I doing wrong ??
Install virtualenv with pip :
sudo pip install virtualenv
create Virtualenv
virtualenv -p /usr/local/bin/python3 virtualenv_name
activte Virtualenv
source virtualenv_name/bin/activate
finally install django
pip install django
With that you will get django installed using python3

I have installed virtualenvwrapper but getting error- workon: command not found

I have just installed virtualenvwrapper by it documentation site and from link http://www.openbookproject.net
but on running command-
workon <vir.Env.Name>
i am getting the following error-
workon: command not found The list of commands i used to install are-
sudo aptitude install python-virtualenv
sudo aptitude install python-dev
mkdir mydjangoapp
cd mydjangoapp/
virtualenv --no-site-packages mydjangoappvenv
virtualenv --no-site-packages jango
source jango/bin/activate
pip install virtualenv
pip install virtualenvwrapper
pip install --install-option="--user" virtualenvwrapper
cat >> ~/.bash_profile
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/directory-you-do-development-in
source /usr/local/bin/virtualenvwrapper.sh
I guess my virtualenvwrapper is not installed. Plz anybody can tell whats the problem.Also tell me what is .bash file and where it is found in our file directory.
I think you may have installed virtualenvwrapper inside any virtual enviroment like this-
rahul#rahulpc:~/mydjangoapp$ source jango/bin/activate
(jango)rahul#rahulpc:~/mydjangoapp$ pip install virtualenvwrapper
So before installing virtualenvwrapper you have to deactivate virtual enviroment.
(jango)rahul#rahulpc:~/mydjangoapp$ deactivate
rahul#rahulpc:~/mydjangoapp$ pip install virtualenvwrapper
now follow all further steps.

Django not installed in venv?

Would anyone know possible reasons why Django is being installed in the global site package and not my venv's site package folder?
Here's my set up and what I did, this is a bit detailed since I'm new to Python/Django and not sure which information is important:
Python 3.3 is installed in c:\python33
I have virtualenv, pip, easy_install installed in C:\Python33\Scripts.
My venv is c:\users\username\projects\projB
This venv was created using pyvenv, not virtualenv.
I activated the venv.
I changed directory to C:\Python33\Scripts to run "pip install django".
Django was created inside C:\Python33\Lib\site-packages and not inside C:\users\username\projects\projB\Lib\site-packages.
Do I need to install pip inside my venv and use that to install Django?
You can specify in your virutalenv wich python version you whant:
$ virtualenv -p <PATH TO PYTHON VERSION> my_virtualenv
Then:
$ source my_virtualenv/bin/activate
$ pip install Django==1.5.2
This will install the good version of django in your virtualenv according to your python version.
Thanks to virtualanv, you will be able to save/freeze and install your environement on another machine:
$ pip freeze > requirement.txt
$ pip install -r requirement.txt
You will see in the requirement.txt file the django dependency.
Pip should be installed when you create the virtual environment. Don't change directory into C:\Python33\Scripts before running pip. It looks like that means you use the base install's pip instead of your virtual environment's pip.
You should be able to run pip from any other directory. However I'm not familiar with python on Windows, so I'm not certain that pip is added to the path when you activate the environment. If that doesn't work, you'll have to change directory into the bin directory of your virtual environment, then run pip.
What happened to me was that I was trying to install django from outside the environment directory/folder.
So make sure you are inside the environment directory and then use pip install django