Forums

Django version

I am new to this website. I installed a new virtual environment and it's using python 3.5 and Django 2.0.2. However, when my device to trying to access the server, it shows an error saying "cannot import name 'path'". And the Django version on Debug page is 1.1.0. I am very confused about it.

Your site looks like it's up and running now -- did you work out what the problem was?

I have the same issue. How in the deuce am I supposed to set up a Django 2 web app? It's here: http://pj2.pythonanywhere.com/

pa_autoconfigure_django.py --nuke https://github.com/moonpatroller/blog.git

< Running API sanity checks > \ ~<:>>>>>>>>> Cloning into '/home/pj2/pj2.pythonanywhere.com'... remote: Counting objects: 17, done. remote: Compressing objects: 100% (16/16), done. remote: Total 17 (delta 0), reused 17 (delta 0), pack-reused 0 Unpacking objects: 100% (17/17), done. Checking connectivity... done. < Creating virtualenv with Python3.6 > \ ~<:>>>>>>>>> /home/pj2/.virtualenvs/myvenv/bin/python: Error while finding module specification for 'virtualenvwrapper.hook_loader' (ModuleNotFoundError: No module na med 'virtualenvwrapper') virtualenvwrapper.sh: There was a problem running the initialization hooks. If Python could not import the module virtualenvwrapper.hook_loader, check that virtualenvwrapper has been installed for VIRTUALENVWRAPPER_PYTHON=/home/pj2/.virtualenvs/myvenv/bin/python and that PATH is set properly. Removing pj2.pythonanywhere.com... /home/pj2/.virtualenvs/myvenv/bin/python: Error while finding module specification for 'virtualenvwrapper.hook_loader' (ModuleNotFoundError: No module na med 'virtualenvwrapper') /home/pj2/.virtualenvs/myvenv/bin/python: Error while finding module specification for 'virtualenvwrapper.hook_loader' (ModuleNotFoundError: No module na med 'virtualenvwrapper') Running virtualenv with interpreter /usr/bin/python3.6 Using base prefix '/usr' New python executable in /home/pj2/.virtualenvs/pj2.pythonanywhere.com/bin/python3.6 Also creating executable in /home/pj2/.virtualenvs/pj2.pythonanywhere.com/bin/python Installing setuptools, pip, wheel...done. /home/pj2/.virtualenvs/myvenv/bin/python: Error while finding module specification for 'virtualenvwrapper.hook_loader' (ModuleNotFoundError: No module na med 'virtualenvwrapper') Traceback (most recent call last): File "/home/pj2/.local/bin/pa_autoconfigure_django.py", line 56, in <module> main(arguments['<git-repo-url>'], arguments['--domain'], arguments['--python'], nuke=arguments.get('--nuke')) File "/home/pj2/.local/bin/pa_autoconfigure_django.py", line 36, in main project.create_virtualenv(nuke=nuke) File "/home/pj2/.local/lib/python3.6/site-packages/pythonanywhere/django_project.py", line 20, in create_virtualenv self.virtualenv.create(nuke=nuke) File "/home/pj2/.local/lib/python3.6/site-packages/pythonanywhere/virtualenvs.py", line 24, in create subprocess.check_call(['bash', '-c', f'source virtualenvwrapper.sh && {command}']) File "/usr/lib/python3.6/subprocess.py", line 291, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['bash', '-c', 'source virtualenvwrapper.sh && rmvirtualenv pj2.pythonanywhere.com && mkvirtualenv --python=/usr/ bin/python3.6 pj2.pythonanywhere.com']' returned non-zero exit status 1. (myvenv) 00:07 ~ $

Are you running it from within a virtualenv? That may be preventing it from finding the libraries it needs. Alternatively, it's possible that something you've installed using pip --user is interfering with the script finding virtualenv wrapper.