Re: Help: 'django.utils.six.moves' is not a package

2018-04-10 Thread Babatunde Akinyanmi
Do you have any module making use of six? Also is there any change in the
story if you do `python3 manage.py [command]`
On Tue, 10 Apr 2018, 18:57 Julio Biason,  wrote:

> Six is self-contained it does look anywhere, it has its own list of “how
> it was before and how it is now”.
>
> In the case of moves, it has conditions of “module urlparse is urlparse in
> python 2 and urllib.parse in python 3” and then sets its own move module to
> point to one of those, based on python version.
>
> It’s weird that it can find six, but not the “moves” module. Have you
> tried deleting your virtual end and creating it again, with the new
> versions?
>
> Get Outlook for iOS <https://aka.ms/o0ukef>
> --
> *From:* django-users@googlegroups.com  on
> behalf of Derek Zeng 
> *Sent:* Tuesday, April 10, 2018 10:31:27 AM
> *To:* django-users@googlegroups.com
> *Subject:* Re: Help: 'django.utils.six.moves' is not a package
>
>
>
> On Tue, Apr 10, 2018, 1:39 AM Babatunde Akinyanmi 
> wrote:
>
>>
>>
>> On Tue, 10 Apr 2018, 02:47 Derek Zeng,  wrote:
>>
>>> I'm using django 2.0.
>>> What exactly is the purpose of django.utils.six.moves module?
>>>
>> Allowing a code base to be able to run on both python 2 and python 3
>>
>
> yeah, but what role does moves module play here? if an old module is not
> found here, where does it look for it?
>
>
>> I have read the source but don't quite understand. Seems like a poly-fill
>>> of pre-existing libraries like urllib
>>>
>>>
>>> On Mon, Apr 9, 2018 at 3:47 PM, Avraham Serour 
>>> wrote:
>>>
>>>> sounds like django 2 removed six and some library you are using still
>>>> hopes it exists.
>>>>
>>>> what django version are you using?
>>>>
>>>> On Mon, Apr 9, 2018 at 3:39 AM, Derek Zeng  wrote:
>>>>
>>>>> I got the following error when running pytest in django. Help is
>>>>> appreciated.
>>>>>
>>>>> This is the test I run
>>>>>
>>>>> import pytest
>>>>> from .factories import *
>>>>>
>>>>> @pytest.mark.django_db
>>>>> def test_with_client(client):
>>>>>   PostFactory.create() # if commented out, the error is gone
>>>>>   response = client.get('/')
>>>>>
>>>>>   body = str(response.content)
>>>>>   assert 'Mysite' in body
>>>>>
>>>>> PostFactory creates a Post object in the database
>>>>>
>>>>>
>>>>> apps/blog/tests/test_post.py:5 (test_with_client)
>>>>> client = 
>>>>> @pytest.mark.django_db
>>>>> def test_with_client(client):
>>>>> p = PostFactory.create()
>>>>>
>>>>> > response = client.get('/')
>>>>> blog/tests/test_post.py:10:
>>>>> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>>>>> _ _ _ _ _
>>>>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:517:
>>>>> in get
>>>>> response = super().get(path, data=data, secure=secure, **extra)
>>>>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:332:
>>>>> in get
>>>>> return self.generic('GET', path, secure=secure, **r)
>>>>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:404:
>>>>> in generic
>>>>> return self.request(**r)
>>>>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:467:
>>>>> in request
>>>>> response = self.handler(environ)
>>>>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:125:
>>>>> in __call__
>>>>> self.load_middleware()
>>>>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/core/handlers/base.py:37:
>>>>> in load_middleware
>>>>> middleware = import_string(middleware_path)
>>>>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/utils/module_loading.py:17:
>>>>> in import_string
>>>>> module = import_module(module_path)
>>>>> ../../../../.virtualenvs/django/lib/python3.6/importlib/__init__.py:126:
>>>>> in import_module
>>>>> return _boots

Re: Help: 'django.utils.six.moves' is not a package

2018-04-10 Thread Julio Biason
Six is self-contained it does look anywhere, it has its own list of "how it was 
before and how it is now".

In the case of moves, it has conditions of "module urlparse is urlparse in 
python 2 and urllib.parse in python 3" and then sets its own move module to 
point to one of those, based on python version.

It's weird that it can find six, but not the "moves" module. Have you tried 
deleting your virtual end and creating it again, with the new versions?

Get Outlook for iOS<https://aka.ms/o0ukef>

From: django-users@googlegroups.com  on behalf 
of Derek Zeng 
Sent: Tuesday, April 10, 2018 10:31:27 AM
To: django-users@googlegroups.com
Subject: Re: Help: 'django.utils.six.moves' is not a package



On Tue, Apr 10, 2018, 1:39 AM Babatunde Akinyanmi 
mailto:tundeba...@gmail.com>> wrote:


On Tue, 10 Apr 2018, 02:47 Derek Zeng, 
mailto:zen1...@gmail.com>> wrote:
I'm using django 2.0.
What exactly is the purpose of django.utils.six.moves module?
Allowing a code base to be able to run on both python 2 and python 3

yeah, but what role does moves module play here? if an old module is not found 
here, where does it look for it?


I have read the source but don't quite understand. Seems like a poly-fill of 
pre-existing libraries like urllib


On Mon, Apr 9, 2018 at 3:47 PM, Avraham Serour 
mailto:tovm...@gmail.com>> wrote:
sounds like django 2 removed six and some library you are using still hopes it 
exists.

what django version are you using?

On Mon, Apr 9, 2018 at 3:39 AM, Derek Zeng 
mailto:zen1...@gmail.com>> wrote:
I got the following error when running pytest in django. Help is appreciated.

This is the test I run

import pytest
from .factories import *

@pytest.mark.django_db
def test_with_client(client):
  PostFactory.create() # if commented out, the error is gone
  response = client.get('/')

  body = str(response.content)
  assert 'Mysite' in body

PostFactory creates a Post object in the database


apps/blog/tests/test_post.py:5 (test_with_client)
client = 
@pytest.mark.django_db
def test_with_client(client):
p = PostFactory.create()

> response = client.get('/')
blog/tests/test_post.py:10:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:517:
 in get
response = super().get(path, data=data, secure=secure, **extra)
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:332:
 in get
return self.generic('GET', path, secure=secure, **r)
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:404:
 in generic
return self.request(**r)
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:467:
 in request
response = self.handler(environ)
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:125:
 in __call__
self.load_middleware()
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/core/handlers/base.py:37:
 in load_middleware
middleware = import_string(middleware_path)
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/utils/module_loading.py:17:
 in import_string
module = import_module(module_path)
../../../../.virtualenvs/django/lib/python3.6/importlib/__init__.py:126: in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
:994: in _gcd_import
???
:971: in _find_and_load
???
:955: in _find_and_load_unlocked
???
:665: in _load_unlocked
???
:678: in exec_module
???
:219: in _call_with_frames_removed
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
from __future__ import absolute_import

import re

from django import http
from django.apps import apps
from django.utils.cache import patch_vary_headers
> from django.utils.six.moves.urllib.parse import urlparse
E ModuleNotFoundError: No module named 'django.utils.six.moves.urllib'; 
'django.utils.six.moves' is not a package
../../../../.virtualenvs/django/lib/python3.6/site-packages/corsheaders/middleware.py:8:
 ModuleNotFoundError


--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/23957c7e-9aca-4494-a06a-20cbf0fc857b%40googlegroups.com<https://groups.google.com/d/msgid/django-users/23957c7e-9aca-4494-a06a-20cbf0fc857b%40googlegroups.com?utm_medium=email&utm_source=

Re: Help: 'django.utils.six.moves' is not a package

2018-04-10 Thread Derek Zeng
On Tue, Apr 10, 2018, 1:39 AM Babatunde Akinyanmi 
wrote:

>
>
> On Tue, 10 Apr 2018, 02:47 Derek Zeng,  wrote:
>
>> I'm using django 2.0.
>> What exactly is the purpose of django.utils.six.moves module?
>>
> Allowing a code base to be able to run on both python 2 and python 3
>

yeah, but what role does moves module play here? if an old module is not
found here, where does it look for it?


> I have read the source but don't quite understand. Seems like a poly-fill
>> of pre-existing libraries like urllib
>>
>>
>> On Mon, Apr 9, 2018 at 3:47 PM, Avraham Serour  wrote:
>>
>>> sounds like django 2 removed six and some library you are using still
>>> hopes it exists.
>>>
>>> what django version are you using?
>>>
>>> On Mon, Apr 9, 2018 at 3:39 AM, Derek Zeng  wrote:
>>>
 I got the following error when running pytest in django. Help is
 appreciated.

 This is the test I run

 import pytest
 from .factories import *

 @pytest.mark.django_db
 def test_with_client(client):
   PostFactory.create() # if commented out, the error is gone
   response = client.get('/')

   body = str(response.content)
   assert 'Mysite' in body

 PostFactory creates a Post object in the database


 apps/blog/tests/test_post.py:5 (test_with_client)
 client = 
 @pytest.mark.django_db
 def test_with_client(client):
 p = PostFactory.create()

 > response = client.get('/')
 blog/tests/test_post.py:10:
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 _ _ _ _
 ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:517:
 in get
 response = super().get(path, data=data, secure=secure, **extra)
 ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:332:
 in get
 return self.generic('GET', path, secure=secure, **r)
 ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:404:
 in generic
 return self.request(**r)
 ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:467:
 in request
 response = self.handler(environ)
 ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:125:
 in __call__
 self.load_middleware()
 ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/core/handlers/base.py:37:
 in load_middleware
 middleware = import_string(middleware_path)
 ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/utils/module_loading.py:17:
 in import_string
 module = import_module(module_path)
 ../../../../.virtualenvs/django/lib/python3.6/importlib/__init__.py:126:
 in import_module
 return _bootstrap._gcd_import(name[level:], package, level)
 :994: in _gcd_import
 ???
 :971: in _find_and_load
 ???
 :955: in _find_and_load_unlocked
 ???
 :665: in _load_unlocked
 ???
 :678: in exec_module
 ???
 :219: in _call_with_frames_removed
 ???
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 _ _ _ _
 from __future__ import absolute_import

 import re

 from django import http
 from django.apps import apps
 from django.utils.cache import patch_vary_headers
 > from django.utils.six.moves.urllib.parse import urlparse
 E ModuleNotFoundError: No module named 'django.utils.six.moves.urllib';
 'django.utils.six.moves' is not a package
 ../../../../.virtualenvs/django/lib/python3.6/site-packages/corsheaders/middleware.py:8:
 ModuleNotFoundError

 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to django-users+unsubscr...@googlegroups.com.
 To post to this group, send email to django-users@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/23957c7e-9aca-4494-a06a-20cbf0fc857b%40googlegroups.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Django users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/django-users/EmfIjFICjyU/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>>

Re: Help: 'django.utils.six.moves' is not a package

2018-04-09 Thread Babatunde Akinyanmi
On Tue, 10 Apr 2018, 02:47 Derek Zeng,  wrote:

> I'm using django 2.0.
> What exactly is the purpose of django.utils.six.moves module?
>
Allowing a code base to be able to run on both python 2 and python 3

I have read the source but don't quite understand. Seems like a poly-fill
> of pre-existing libraries like urllib
>
>
> On Mon, Apr 9, 2018 at 3:47 PM, Avraham Serour  wrote:
>
>> sounds like django 2 removed six and some library you are using still
>> hopes it exists.
>>
>> what django version are you using?
>>
>> On Mon, Apr 9, 2018 at 3:39 AM, Derek Zeng  wrote:
>>
>>> I got the following error when running pytest in django. Help is
>>> appreciated.
>>>
>>> This is the test I run
>>>
>>> import pytest
>>> from .factories import *
>>>
>>> @pytest.mark.django_db
>>> def test_with_client(client):
>>>   PostFactory.create() # if commented out, the error is gone
>>>   response = client.get('/')
>>>
>>>   body = str(response.content)
>>>   assert 'Mysite' in body
>>>
>>> PostFactory creates a Post object in the database
>>>
>>>
>>> apps/blog/tests/test_post.py:5 (test_with_client)
>>> client = 
>>> @pytest.mark.django_db
>>> def test_with_client(client):
>>> p = PostFactory.create()
>>>
>>> > response = client.get('/')
>>> blog/tests/test_post.py:10:
>>> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>>> _ _ _ _
>>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:517:
>>> in get
>>> response = super().get(path, data=data, secure=secure, **extra)
>>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:332:
>>> in get
>>> return self.generic('GET', path, secure=secure, **r)
>>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:404:
>>> in generic
>>> return self.request(**r)
>>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:467:
>>> in request
>>> response = self.handler(environ)
>>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:125:
>>> in __call__
>>> self.load_middleware()
>>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/core/handlers/base.py:37:
>>> in load_middleware
>>> middleware = import_string(middleware_path)
>>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/utils/module_loading.py:17:
>>> in import_string
>>> module = import_module(module_path)
>>> ../../../../.virtualenvs/django/lib/python3.6/importlib/__init__.py:126:
>>> in import_module
>>> return _bootstrap._gcd_import(name[level:], package, level)
>>> :994: in _gcd_import
>>> ???
>>> :971: in _find_and_load
>>> ???
>>> :955: in _find_and_load_unlocked
>>> ???
>>> :665: in _load_unlocked
>>> ???
>>> :678: in exec_module
>>> ???
>>> :219: in _call_with_frames_removed
>>> ???
>>> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>>> _ _ _ _
>>> from __future__ import absolute_import
>>>
>>> import re
>>>
>>> from django import http
>>> from django.apps import apps
>>> from django.utils.cache import patch_vary_headers
>>> > from django.utils.six.moves.urllib.parse import urlparse
>>> E ModuleNotFoundError: No module named 'django.utils.six.moves.urllib';
>>> 'django.utils.six.moves' is not a package
>>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/corsheaders/middleware.py:8:
>>> ModuleNotFoundError
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/23957c7e-9aca-4494-a06a-20cbf0fc857b%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/EmfIjFICjyU/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAFWa6tJVq15fdBc8u%3DP6tRsrJo5D0sHNQtZh1a6U2y4uNm38mw%40mail.gmail.com
>> 
>> .
>>
>> For more options, 

Re: Help: 'django.utils.six.moves' is not a package

2018-04-09 Thread Derek Zeng
I'm using django 2.0.
What exactly is the purpose of django.utils.six.moves module?
I have read the source but don't quite understand. Seems like a poly-fill
of pre-existing libraries like urllib


On Mon, Apr 9, 2018 at 3:47 PM, Avraham Serour  wrote:

> sounds like django 2 removed six and some library you are using still
> hopes it exists.
>
> what django version are you using?
>
> On Mon, Apr 9, 2018 at 3:39 AM, Derek Zeng  wrote:
>
>> I got the following error when running pytest in django. Help is
>> appreciated.
>>
>> This is the test I run
>>
>> import pytest
>> from .factories import *
>>
>> @pytest.mark.django_db
>> def test_with_client(client):
>>   PostFactory.create() # if commented out, the error is gone
>>   response = client.get('/')
>>
>>   body = str(response.content)
>>   assert 'Mysite' in body
>>
>> PostFactory creates a Post object in the database
>>
>>
>> apps/blog/tests/test_post.py:5 (test_with_client)
>> client = 
>> @pytest.mark.django_db
>> def test_with_client(client):
>> p = PostFactory.create()
>>
>> > response = client.get('/')
>> blog/tests/test_post.py:10:
>> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>> _ _ _
>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:517:
>> in get
>> response = super().get(path, data=data, secure=secure, **extra)
>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:332:
>> in get
>> return self.generic('GET', path, secure=secure, **r)
>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:404:
>> in generic
>> return self.request(**r)
>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:467:
>> in request
>> response = self.handler(environ)
>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:125:
>> in __call__
>> self.load_middleware()
>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/
>> django/core/handlers/base.py:37: in load_middleware
>> middleware = import_string(middleware_path)
>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/
>> django/utils/module_loading.py:17: in import_string
>> module = import_module(module_path)
>> ../../../../.virtualenvs/django/lib/python3.6/importlib/__init__.py:126:
>> in import_module
>> return _bootstrap._gcd_import(name[level:], package, level)
>> :994: in _gcd_import
>> ???
>> :971: in _find_and_load
>> ???
>> :955: in _find_and_load_unlocked
>> ???
>> :665: in _load_unlocked
>> ???
>> :678: in exec_module
>> ???
>> :219: in _call_with_frames_removed
>> ???
>> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>> _ _ _
>> from __future__ import absolute_import
>>
>> import re
>>
>> from django import http
>> from django.apps import apps
>> from django.utils.cache import patch_vary_headers
>> > from django.utils.six.moves.urllib.parse import urlparse
>> E ModuleNotFoundError: No module named 'django.utils.six.moves.urllib';
>> 'django.utils.six.moves' is not a package
>> ../../../../.virtualenvs/django/lib/python3.6/site-packages/corsheaders/middleware.py:8:
>> ModuleNotFoundError
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/23957c7e-9aca-4494-a06a-20cbf0fc857b%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/django-users/EmfIjFICjyU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAFWa6tJVq15fdBc8u%3DP6tRsrJo5D0sHNQtZh1a6U2y4uNm
> 38mw%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-us

Re: Help: 'django.utils.six.moves' is not a package

2018-04-09 Thread Avraham Serour
sounds like django 2 removed six and some library you are using still hopes
it exists.

what django version are you using?

On Mon, Apr 9, 2018 at 3:39 AM, Derek Zeng  wrote:

> I got the following error when running pytest in django. Help is
> appreciated.
>
> This is the test I run
>
> import pytest
> from .factories import *
>
> @pytest.mark.django_db
> def test_with_client(client):
>   PostFactory.create() # if commented out, the error is gone
>   response = client.get('/')
>
>   body = str(response.content)
>   assert 'Mysite' in body
>
> PostFactory creates a Post object in the database
>
>
> apps/blog/tests/test_post.py:5 (test_with_client)
> client = 
> @pytest.mark.django_db
> def test_with_client(client):
> p = PostFactory.create()
>
> > response = client.get('/')
> blog/tests/test_post.py:10:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _ _ _
> ../../../../.virtualenvs/django/lib/python3.6/site-
> packages/django/test/client.py:517: in get
> response = super().get(path, data=data, secure=secure, **extra)
> ../../../../.virtualenvs/django/lib/python3.6/site-
> packages/django/test/client.py:332: in get
> return self.generic('GET', path, secure=secure, **r)
> ../../../../.virtualenvs/django/lib/python3.6/site-
> packages/django/test/client.py:404: in generic
> return self.request(**r)
> ../../../../.virtualenvs/django/lib/python3.6/site-
> packages/django/test/client.py:467: in request
> response = self.handler(environ)
> ../../../../.virtualenvs/django/lib/python3.6/site-
> packages/django/test/client.py:125: in __call__
> self.load_middleware()
> ../../../../.virtualenvs/django/lib/python3.6/site-
> packages/django/core/handlers/base.py:37: in load_middleware
> middleware = import_string(middleware_path)
> ../../../../.virtualenvs/django/lib/python3.6/site-
> packages/django/utils/module_loading.py:17: in import_string
> module = import_module(module_path)
> ../../../../.virtualenvs/django/lib/python3.6/importlib/__init__.py:126:
> in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
> :994: in _gcd_import
> ???
> :971: in _find_and_load
> ???
> :955: in _find_and_load_unlocked
> ???
> :665: in _load_unlocked
> ???
> :678: in exec_module
> ???
> :219: in _call_with_frames_removed
> ???
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _ _ _
> from __future__ import absolute_import
>
> import re
>
> from django import http
> from django.apps import apps
> from django.utils.cache import patch_vary_headers
> > from django.utils.six.moves.urllib.parse import urlparse
> E ModuleNotFoundError: No module named 'django.utils.six.moves.urllib';
> 'django.utils.six.moves' is not a package
> ../../../../.virtualenvs/django/lib/python3.6/site-packages/corsheaders/middleware.py:8:
> ModuleNotFoundError
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/23957c7e-9aca-4494-a06a-20cbf0fc857b%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFWa6tJVq15fdBc8u%3DP6tRsrJo5D0sHNQtZh1a6U2y4uNm38mw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Help: 'django.utils.six.moves' is not a package

2018-04-08 Thread Derek Zeng
I got the following error when running pytest in django. Help is 
appreciated.

This is the test I run

import pytest
from .factories import *

@pytest.mark.django_db
def test_with_client(client):
  PostFactory.create() # if commented out, the error is gone
  response = client.get('/')

  body = str(response.content)
  assert 'Mysite' in body

PostFactory creates a Post object in the database


apps/blog/tests/test_post.py:5 (test_with_client)
client = 
@pytest.mark.django_db
def test_with_client(client):
p = PostFactory.create()

> response = client.get('/')
blog/tests/test_post.py:10: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ 
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:517:
 
in get
response = super().get(path, data=data, secure=secure, **extra)
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:332:
 
in get
return self.generic('GET', path, secure=secure, **r)
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:404:
 
in generic
return self.request(**r)
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:467:
 
in request
response = self.handler(environ)
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/test/client.py:125:
 
in __call__
self.load_middleware()
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/core/handlers/base.py:37:
 
in load_middleware
middleware = import_string(middleware_path)
../../../../.virtualenvs/django/lib/python3.6/site-packages/django/utils/module_loading.py:17:
 
in import_string
module = import_module(module_path)
../../../../.virtualenvs/django/lib/python3.6/importlib/__init__.py:126: in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
:994: in _gcd_import
???
:971: in _find_and_load
???
:955: in _find_and_load_unlocked
???
:665: in _load_unlocked
???
:678: in exec_module
???
:219: in _call_with_frames_removed
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ 
from __future__ import absolute_import

import re

from django import http
from django.apps import apps
from django.utils.cache import patch_vary_headers
> from django.utils.six.moves.urllib.parse import urlparse
E ModuleNotFoundError: No module named 'django.utils.six.moves.urllib'; 
'django.utils.six.moves' is not a package
../../../../.virtualenvs/django/lib/python3.6/site-packages/corsheaders/middleware.py:8:
 
ModuleNotFoundError

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/23957c7e-9aca-4494-a06a-20cbf0fc857b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.