H
H
HeartOfProgrammer2016-08-11 15:01:26
Django
HeartOfProgrammer, 2016-08-11 15:01:26

How to change python2.7 to python3.5?

I decided to deploy a site on pythonanywhere.com hosting via bash.
I do everything as it is written in the article
. I registered everything as needed, but bash swears. Perhaps this is due to the fact that python2.7 is used according to the standard, and python3.5 is needed for my task, but I don’t know how to enable it so that it goes according to the standard.
Django project uploaded via git clone
Here is what bash gives me:

11:51 ~ $ ls
Django_blog  README.txt
11:51 ~ $ cd Django_blog
11:51 ~/Django_blog (master)$ source virtualenv/bin/activate
(virtualenv) 11:51 ~/Django_blog (master)$ pip install django whitenoise
Requirement already satisfied (use --upgrade to upgrade): django in /usr/local/lib/python2.7/dist-packages
Collecting whitenoise
  Using cached whitenoise-3.2.1-py2.py3-none-any.whl
Installing collected packages: whitenoise
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 742, in install
    **kwargs
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 831, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 1032, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 346, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 317, in clobber
    ensure_dir(destdir)
  File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/whitenoise'
(virtualenv) 11:52 ~/Django_blog (master)$

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2016-08-11
@sim3x

$ virtualenv lolpython3env -p `which python3`

$ source lolpython3env/bin/activate

$ python -V
which python
pip --version

Python 3.5
/tmp/lolpython3env/lolpython3env/bin/python
pip 8. from /tmp/lolpython3env/lolpython3env/lib/python3.5/site-packages (python 3.5)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question