Opened 8 years ago

Closed 8 years ago

#27591 closed Uncategorized (invalid)

running manage.py with virtual environment

Reported by: Satheesan Varier Owned by: nobody
Component: Uncategorized Version: 1.10
Severity: Normal Keywords: Django, Virtualenv, Powershell
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Tim Graham)

Virtual Environment : Windows Powershell 5.0 / virtualenvironmentwrapper-powershell
Python : 2.7.12 / Django: 1.10.4


Outside venvs the following are installed
virtualenv==15.1.0
virtualenvwrapper-powershell==12.7.8


Inside venv, Django is installed


django-admin startproject mysite


manage.py shell ( throws ImportError )


try:
    import django
except ImportError:
    raise 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?"
    )

Observation 1 : Even though manage.py is unable to import Django
if we open a python shell, we can import django


Observation 2 : If we pip install Django outside the venv redundantly
then manage.py will not throw ImportError on any of the manage.py
commands. it will pickup django from there.


Issue : manage.py should get Django from the virtualenv


Change History (1)

comment:1 by Tim Graham, 8 years ago

Description: modified (diff)
Resolution: invalid
Status: newclosed

To get help, please see TicketClosingReasons/UseSupportChannels. If Django turns out to be at fault, please reopen with an explanation of why.

Note: See TracTickets for help on using tickets.
Back to Top