How to generate a PYTHONPATH environment variable for django

0

I recently updated my Ubuntu operating system 14.04 to 16.04 and it turns out that I can no longer run a project on Django that is running on a virtualenv throws me this error.

  File "./manage.py", line 17, in <module>
    "Couldn't import Django. Are you sure it's installed and "
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

How can you regenerate the python PATH?

    
asked by Alex Ancco Cahuana 17.02.2017 в 04:23
source

1 answer

1

You are saying that Django is not installed in the python version you are using, I guess it will be the default, so you should install Django

pip install Django

test python --version to corroborate that it is the version with which you created your virtualenv.

Alternatively if you have several versions of python running you can specify which version of python you want to use in the following way

 virtualenv --python=/usr/bin/python2.6 <path/to/new/virtualenv/>

Additionally to see the packages that you have installed in the environment or in the virtualenv write:

$ pip freeze

Greetings

    
answered by 02.06.2017 в 22:12