Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Can not install dj-diabetes #12

Closed
petrk94 opened this issue Jan 18, 2018 · 9 comments
Closed

Can not install dj-diabetes #12

petrk94 opened this issue Jan 18, 2018 · 9 comments

Comments

@petrk94
Copy link

petrk94 commented Jan 18, 2018

Hello,
Im facing an issue on the shared host server, Im using

$ pip install -r requirements.txt
You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting arrow==0.12.0 (from -r requirements.txt (line 1))
  Using cached arrow-0.12.0.tar.gz
Collecting Django==2.0 (from -r requirements.txt (line 2))
  Using cached Django-2.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-lDX5xx/Django/setup.py", line 32, in <module>
        version = __import__('django').get_version()
      File "django/__init__.py", line 1, in <module>
        from django.utils.version import get_version
      File "django/utils/version.py", line 61, in <module>
        @functools.lru_cache()
    AttributeError: 'module' object has no attribute 'lru_cache'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-lDX5xx/Django

This is the error message I get.
I hope you can help me

@foxmask
Copy link
Owner

foxmask commented Jan 19, 2018

are you using python 3 ?

@petrk94
Copy link
Author

petrk94 commented Jan 19, 2018

By default on the shared host server is Python -V 2.7
But there is even Python 3.
The problem, Pip seems to choose the older Python version. And I don't know how to use pip with Python3

@foxmask
Copy link
Owner

foxmask commented Jan 19, 2018

Use pip3 instead ;)

@petrk94
Copy link
Author

petrk94 commented Jan 19, 2018

I have tried, looked good a the beginning, but failed too:
$ pip3 install -r requirements.txt
Collecting arrow==0.12.0 (from -r requirements.txt (line 1))
  Using cached arrow-0.12.0.tar.gz
Collecting Django==2.0 (from -r requirements.txt (line 2))
  Downloading Django-2.0-py3-none-any.whl (7.1MB)
    100% |████████████████████████████████| 7.1MB 92kB/s
Collecting six==1.11.0 (from -r requirements.txt (line 3))
  Downloading six-1.11.0-py2.py3-none-any.whl
Collecting flake8==3.5.0 (from -r requirements.txt (line 4))
  Downloading flake8-3.5.0-py2.py3-none-any.whl (69kB)
    100% |████████████████████████████████| 71kB 4.7MB/s
Collecting python-dateutil (from arrow==0.12.0->-r requirements.txt (line 1))  Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
    100% |████████████████████████████████| 194kB 1.2MB/s
Collecting pytz (from Django==2.0->-r requirements.txt (line 2))
  Downloading pytz-2017.3-py2.py3-none-any.whl (511kB)
    100% |████████████████████████████████| 512kB 1.1MB/s
Collecting mccabe<0.7.0,>=0.6.0 (from flake8==3.5.0->-r requirements.txt (line 4))
  Downloading mccabe-0.6.1-py2.py3-none-any.whl
Collecting pycodestyle<2.4.0,>=2.0.0 (from flake8==3.5.0->-r requirements.txt (line 4))
  Downloading pycodestyle-2.3.1-py2.py3-none-any.whl (45kB)
    100% |████████████████████████████████| 51kB 4.8MB/s
Collecting pyflakes<1.7.0,>=1.5.0 (from flake8==3.5.0->-r requirements.txt (line 4))
  Downloading pyflakes-1.6.0-py2.py3-none-any.whl (227kB)
    100% |████████████████████████████████| 235kB 2.8MB/s
Installing collected packages: six, python-dateutil, arrow, pytz, Django, mccabe, pycodestyle, pyflakes, flake8
Exception:
Traceback (most recent call last):
  File "/package/host/localhost/python-3.4.6/lib/python3.4/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/package/host/localhost/python-3.4.6/lib/python3.4/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/package/host/localhost/python-3.4.6/lib/python3.4/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/package/host/localhost/python-3.4.6/lib/python3.4/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/package/host/localhost/python-3.4.6/lib/python3.4/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/package/host/localhost/python-3.4.6/lib/python3.4/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/package/host/localhost/python-3.4.6/lib/python3.4/site-packages/pip/wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
  File "/package/host/localhost/python-3.4.6/lib/python3.4/shutil.py", line 109, in copyfile
    with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/package/host/localhost/python-3.4.6/lib/python3.4/site-packages/six.py'

@foxmask
Copy link
Owner

foxmask commented Jan 19, 2018

This error occurs because you are connected as an end-user and try to install files into directories where you dont have the rights.

So first of all start by creating a new virtualenv like this:

python -m venv <the name of virtualenv you want>

then go into that virtualenv

cd <the name of virtualenv you want>

activate the virtualenv by:

source bin/activate

then clone

git clone https://github.com/foxmask/dj-diabetes.git

then install

cd dj-diabetes
pip3 install -r requirements.txt

@petrk94
Copy link
Author

petrk94 commented Jan 20, 2018

ok thanks, this worked now all and the migration was successful.
But now I have it in /var/www/virtual/xxxx/diabetes/dj-diabetes/

How I can run it as subdomain and which commands are necessary to start the python server for this project?

@tylergale
Copy link

I'm assuming you would need some sort of HTTP proxy, such as Nginx? Check https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04

@petrk94
Copy link
Author

petrk94 commented Jan 26, 2018

@tylergale is it even possible without?
This all seems to be very complicated, just to set this up and make it reachable, especially I can not just easily install a Nginx Server on my shared host account.

@foxmask
Copy link
Owner

foxmask commented Jan 26, 2018

@petrk94 you can install this project on your desktop for your own usage and thus no need to setup NGINX, just start

python manage.py runserver &

and access to the project by http://127.0.0.1:8000/

If you plan to host it on a (shared hosting) server provider without any knowledge, that will be very complicated.

@foxmask foxmask closed this as completed Sep 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants